/*
 * The look that ships with the plugin.
 *
 * It is neutral on purpose: it has to sit inside eighteen themes without
 * clashing with any of them, so it borrows the page's own font and keeps to a
 * quiet card, a clear amount and two solid buttons.
 *
 * A site that wants its own look pastes CSS into the field on the settings
 * page. That field replaces this file rather than adding to it, so that
 * everything the site does not style is inherited from the theme.
 */

.p4q {
	--p4q-ink: #1d2327;
	--p4q-muted: #6b7280;
	--p4q-line: #e2e5ea;
	--p4q-surface: #ffffff;
	--p4q-accent: #1f4e79;
	--p4q-accent-ink: #ffffff;
	--p4q-accent-hover: #163a5a;
	--p4q-danger: #a4232b;
	--p4q-radius: 10px;

	max-width: 520px;
	margin: 0 auto;
	direction: rtl;
	text-align: right;
	color: var(--p4q-ink);
	font-size: 16px;
	line-height: 1.6;
}

.p4q-box {
	background: var(--p4q-surface);
	border: 1px solid var(--p4q-line);
	border-radius: var(--p4q-radius);
	padding: 1.75em 1.5em;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.p4q-box[hidden] { display: none; }

/* The quotation itself */

.p4q-summary {
	border-bottom: 1px solid var(--p4q-line);
	padding-bottom: 1em;
	margin-bottom: 1.25em;
}

.p4q-row {
	margin: 0 0 0.4em;
	display: flex;
	gap: 0.5em;
	align-items: baseline;
	flex-wrap: wrap;
}

.p4q-row:last-child { margin-bottom: 0; }

.p4q-label {
	color: var(--p4q-muted);
	font-size: 0.9em;
}

.p4q-value { font-weight: 600; }

.p4q-row-amount .p4q-amount {
	font-size: 1.5em;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.p4q-description { font-weight: 500; }

/* Fields */

.p4q-field { margin: 0 0 1em; }

.p4q-field .p4q-label {
	display: block;
	margin-bottom: 0.3em;
}

.p4q-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65em 0.8em;
	border: 1px solid var(--p4q-line);
	border-radius: 8px;
	background: #fff;
	color: var(--p4q-ink);
	font: inherit;
	font-size: 1em;
}

.p4q-input:focus {
	outline: none;
	border-color: var(--p4q-accent);
	box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.12);
}

.p4q-field-split {
	display: flex;
	gap: 0.6em;
}

.p4q-field-terms {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	font-size: 0.95em;
}

.p4q-checkbox {
	margin: 0.35em 0 0;
	flex: 0 0 auto;
}

.p4q-terms-label a { text-decoration: underline; }

/* Buttons */

.p4q-buttons {
	display: flex;
	flex-direction: column;
	gap: 0.6em;
	margin: 1.25em 0 0;
}

.p4q-button {
	display: block;
	width: 100%;
	padding: 0.8em 1em;
	border: 1px solid var(--p4q-accent);
	border-radius: 8px;
	background: var(--p4q-accent);
	color: var(--p4q-accent-ink);
	font: inherit;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.p4q-button:hover,
.p4q-button:focus {
	background: var(--p4q-accent-hover);
	border-color: var(--p4q-accent-hover);
	color: var(--p4q-accent-ink);
}

.p4q-button-bitcoin {
	background: transparent;
	color: var(--p4q-accent);
}

.p4q-button-bitcoin:hover,
.p4q-button-bitcoin:focus {
	background: rgba(31, 78, 121, 0.07);
	color: var(--p4q-accent);
	border-color: var(--p4q-accent);
}

.p4q-back {
	margin: 1.25em 0 0;
	text-align: center;
}

.p4q-button-back {
	width: auto;
	padding: 0.35em 0.6em;
	border: 0;
	background: none;
	color: var(--p4q-muted);
	font-weight: 400;
	font-size: 0.95em;
	text-decoration: underline;
}

.p4q-button-back:hover,
.p4q-button-back:focus {
	background: none;
	color: var(--p4q-ink);
}

/* Errors and messages */

.p4q-error {
	margin: 0.4em 0 0;
	color: var(--p4q-danger);
	font-size: 0.9em;
	min-height: 0;
}

.p4q-error:empty { display: none; }

.p4q-message-title {
	margin: 0 0 0.5em;
	font-size: 1.15em;
}

.p4q-message-help { margin: 0; color: var(--p4q-muted); font-size: 0.95em; }

/* Bitcoin */

.p4q-step-bitcoin { text-align: center; }

.p4q-bitcoin-intro { margin: 0 0 1em; }

.p4q-qr {
	display: flex;
	justify-content: center;
	margin: 0 0 1em;
}

.p4q-qr img,
.p4q-qr canvas {
	display: block;
	max-width: 100%;
	height: auto;
	padding: 12px;
	background: #fff;
	border: 1px solid var(--p4q-line);
	border-radius: 8px;
}

.p4q-bitcoin-amount {
	margin: 0 0 0.25em;
	font-size: 1.2em;
	font-weight: 700;
	direction: ltr;
}

.p4q-bitcoin-rate {
	margin: 0;
	color: var(--p4q-muted);
	font-size: 0.9em;
}

/* PayPal */

.p4q-paypal { margin-top: 1em; }

.p4q-paypal-disabled {
	pointer-events: none;
	opacity: 0.4;
}

/* Success and failure */

.p4q-success-title,
.p4q-failure-title {
	margin: 0 0 0.5em;
	font-size: 1.25em;
}

.p4q-success-line { margin: 0; }

/* The confirmation number is Latin inside a Hebrew sentence. Forcing a
   direction on the line breaks it apart; letting the line stay right to left
   and the number be its own run keeps it whole and in place. */
.p4q-success-line bdi { unicode-bidi: isolate; }

.p4q-failure-text { margin: 0; }

/* The wait overlay, toggled by a class on <body> so that no ancestor of the
   form can trap it in a stacking context of its own. */

.p4q-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 2147483600;
	background: rgba(20, 24, 35, 0.78);
	align-items: center;
	justify-content: center;
}

body.p4q-processing .p4q-overlay { display: flex; }
body.p4q-processing { overflow: hidden; }

.p4q-overlay-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1em;
	padding: 2em 2.5em;
	min-width: 240px;
	background: #fff;
	border-radius: var(--p4q-radius);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
	color: var(--p4q-ink);
	direction: rtl;
	text-align: center;
}

.p4q-overlay-circle {
	width: 48px;
	height: 48px;
	border: 4px solid var(--p4q-line);
	border-top-color: var(--p4q-accent);
	border-radius: 50%;
	animation: p4q-spin 0.8s linear infinite;
}

.p4q-overlay-text { margin: 0; font-size: 1.05em; font-weight: 600; }

@keyframes p4q-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
	.p4q-box { padding: 1.25em 1em; }
	.p4q-field-split { flex-direction: column; }
}
