/**
 * Digit Moyasar Checkout — brand styles.
 * Tokens: Deep Green #064E3B · Emerald #0A8754 · Mint #34D399 · Paper #F4F3EE · Ink #0B1F17
 * Fonts:  IBM Plex Sans Arabic (UI) · Space Mono (small technical labels)
 */

.digit-pay-wrapper {
	--dp-green:   #064E3B;
	--dp-emerald: #0A8754;
	--dp-mint:    #34D399;
	--dp-paper:   #F4F3EE;
	--dp-ink:     #0B1F17;
	--dp-line:    rgba(11, 31, 23, 0.12);
	--dp-radius:  14px;

	direction: rtl;
	font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
	color: var(--dp-ink);
	max-width: 1080px;
	margin: 0 auto;
	padding: 8px 0 32px;
	line-height: 1.7;
	box-sizing: border-box;
}

.digit-pay-wrapper *,
.digit-pay-wrapper *::before,
.digit-pay-wrapper *::after { box-sizing: inherit; }

/* ---------- Layout ---------- */

.digit-pay-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	gap: 24px;
	align-items: start;
}

.digit-pay-side {
	display: flex;
	flex-direction: column;
	gap: 24px;
	position: sticky;
	top: 24px;
}

@media (max-width: 900px) {
	.digit-pay-grid { grid-template-columns: 1fr; }
	.digit-pay-side { position: static; order: -1; } /* summary first on mobile */
}

/* ---------- Cards ---------- */

.digit-pay-card {
	background: #fff;
	border: 1px solid var(--dp-line);
	border-radius: var(--dp-radius);
	padding: 24px;
	box-shadow: 0 8px 28px rgba(6, 78, 59, 0.06);
}

.digit-pay-h {
	margin: 0 0 16px;
	font-size: 20px;
	font-weight: 700;
	color: var(--dp-green);
}

.digit-pay-eyebrow {
	display: inline-block;
	font-family: "Space Mono", monospace;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dp-emerald);
	background: rgba(52, 211, 153, 0.14);
	border-radius: 999px;
	padding: 3px 10px;
	margin-bottom: 10px;
	direction: ltr;
}

.digit-pay-muted { color: rgba(11, 31, 23, 0.62); font-size: 13px; }

/* ---------- Form ---------- */

.digit-pay-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

@media (max-width: 640px) {
	.digit-pay-row { grid-template-columns: 1fr; }
}

.digit-pay-field { margin-bottom: 14px; }

.digit-pay-field label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
}

.digit-pay-field .req { color: #C0392B; }
.digit-pay-field .opt { color: rgba(11, 31, 23, 0.45); font-weight: 400; font-size: 12px; }

.digit-pay-field input[type="text"],
.digit-pay-field input[type="email"],
.digit-pay-field input[type="tel"],
.digit-pay-field input[type="number"],
.digit-pay-field select,
.digit-pay-field textarea {
	width: 100%;
	padding: 11px 14px;
	font: inherit;
	font-size: 15px;
	color: var(--dp-ink);
	background: var(--dp-paper);
	border: 1px solid var(--dp-line);
	border-radius: 10px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.digit-pay-field input:focus,
.digit-pay-field select:focus,
.digit-pay-field textarea:focus {
	border-color: var(--dp-emerald);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(10, 135, 84, 0.15);
}

.digit-pay-field input:disabled,
.digit-pay-field select:disabled,
.digit-pay-field textarea:disabled { opacity: 0.6; cursor: not-allowed; }

.digit-pay-field input[aria-invalid="true"],
.digit-pay-field select[aria-invalid="true"] { border-color: #C0392B; }

.digit-pay-hint { display: block; margin-top: 4px; font-size: 12px; color: rgba(11, 31, 23, 0.55); }

.digit-pay-check label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.digit-pay-check input[type="checkbox"] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--dp-emerald); flex: none; }
.digit-pay-terms { margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--dp-line); }
.digit-pay-terms a { color: var(--dp-emerald); text-decoration: underline; }

/* Honeypot: visually removed, still in the DOM for bots. */
.digit-pay-hp {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	clip: rect(0 0 0 0);
	overflow: hidden;
}

/* ---------- Buttons ---------- */

.digit-pay-btn {
	display: inline-block;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	padding: 13px 26px;
	border-radius: 12px;
	border: 2px solid transparent;
	cursor: pointer;
	text-align: center;
	text-decoration: none !important;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.digit-pay-btn:active { transform: translateY(1px); }

.digit-pay-btn-primary { background: var(--dp-emerald); color: #fff !important; width: 100%; }
.digit-pay-btn-primary:hover { background: var(--dp-green); color: #fff !important; }
.digit-pay-btn-primary:disabled { opacity: 0.6; cursor: wait; }

.digit-pay-btn-outline { background: transparent; color: var(--dp-green) !important; border-color: var(--dp-green); }
.digit-pay-btn-outline:hover { background: var(--dp-green); color: #fff !important; }

.digit-pay-btn-whatsapp { background: #25D366; color: #fff !important; }
.digit-pay-btn-whatsapp:hover { background: #1DA851; color: #fff !important; }

.digit-pay-btn-link {
	background: none; border: none; padding: 0;
	font: inherit; font-size: 13px;
	color: var(--dp-emerald);
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Summary card ---------- */

.digit-pay-summary {
	background: var(--dp-green);
	border-color: var(--dp-green);
	color: var(--dp-paper);
}

.digit-pay-summary .digit-pay-eyebrow { background: rgba(52, 211, 153, 0.2); color: var(--dp-mint); }

.digit-pay-package-name { margin: 0 0 12px; font-size: 20px; font-weight: 700; color: #fff; }

.digit-pay-includes {
	list-style: none;
	margin: 0 0 16px;
	padding: 0 0 16px;
	border-bottom: 1px solid rgba(244, 243, 238, 0.18);
	font-size: 14px;
}

.digit-pay-includes li { padding: 3px 0 3px 0; padding-right: 24px; position: relative; }
.digit-pay-includes li::before {
	content: "✓";
	position: absolute;
	right: 0;
	color: var(--dp-mint);
	font-weight: 700;
}

.digit-pay-line {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	padding: 4px 0;
	color: rgba(244, 243, 238, 0.9);
}

.digit-pay-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 12px;
	padding-top: 14px;
	border-top: 1px solid rgba(244, 243, 238, 0.18);
	font-size: 16px;
}

.digit-pay-total strong { font-size: 26px; color: var(--dp-mint); font-weight: 700; }

.digit-pay-summary .digit-pay-muted { color: rgba(244, 243, 238, 0.6); }
.digit-pay-yearly { margin: 10px 0 0; }

/* ---------- Moyasar box ---------- */

.digit-pay-moyasar-box .mysr-form { margin-top: 8px; }
.digit-pay-order-ref { font-family: "Space Mono", monospace; direction: ltr; text-align: right; }
.digit-pay-secure-note { margin-top: 14px; }

/* ---------- Errors ---------- */

.digit-pay-error {
	background: #FDECEA;
	border: 1px solid #E74C3C;
	color: #92271B;
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: 14px;
	font-weight: 600;
}

/* ---------- Result pages (success / failed) ---------- */

.digit-pay-result { max-width: 560px; margin: 24px auto; text-align: center; padding: 36px 28px; }
.digit-pay-result h2 { margin: 0 0 12px; color: var(--dp-green); font-size: 24px; }

.digit-pay-result-icon {
	width: 64px; height: 64px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: rgba(52, 211, 153, 0.18);
	color: var(--dp-emerald);
	font-size: 32px;
	font-weight: 700;
	line-height: 64px;
}

.digit-pay-result-icon-failed { background: #FDECEA; color: #C0392B; }

.digit-pay-result-lines { text-align: right; margin: 18px 0; padding: 14px 18px; background: var(--dp-paper); border-radius: 10px; }
.digit-pay-result .digit-pay-line { color: var(--dp-ink); }
.digit-pay-next { font-weight: 600; color: var(--dp-emerald); }

.digit-pay-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-top: 20px;
}

.digit-pay-plan-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- v1.2: modes ---------- */

.digit-pay-grid-single { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; }

.digit-pay-paybar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	background: var(--dp-green);
	border-color: var(--dp-green);
	color: var(--dp-paper);
	max-width: 640px;
	margin: 0 auto 20px;
	padding: 16px 22px;
}

.digit-pay-paybar-name { display: flex; flex-direction: column; gap: 2px; }
.digit-pay-paybar-name strong { color: #fff; font-size: 17px; }
.digit-pay-paybar .digit-pay-eyebrow { background: rgba(52, 211, 153, 0.2); color: var(--dp-mint); margin-bottom: 2px; }
.digit-pay-paybar-total { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.digit-pay-paybar-total strong { font-size: 24px; color: var(--dp-mint); }

.digit-pay-mode-compact .digit-pay-summary .digit-pay-yearly { display: none; }

.digit-pay-sep { border: 0; border-top: 1px dashed var(--dp-line); margin: 22px 0 18px; }

/* ---------- FINAL v2.0: green package summary ---------- */

.digit-pay-summary--green {
	background: linear-gradient(160deg, var(--dp-green) 0%, #06392C 100%);
	border-color: var(--dp-green);
	color: var(--dp-paper);
}
.digit-pay-summary--green .digit-pay-eyebrow { background: rgba(52, 211, 153, 0.18); color: var(--dp-mint); }
.digit-pay-summary--green .digit-pay-package-name { color: #fff; }
.digit-pay-summary--green .digit-pay-includes li { color: rgba(244, 243, 238, 0.94); }
.digit-pay-summary--green .digit-pay-includes li::before { color: var(--dp-mint); }
.digit-pay-summary--green .digit-pay-includes li.dp-zatca-extra { color: var(--dp-mint); font-weight: 500; }
.digit-pay-summary--green .digit-pay-lines,
.digit-pay-summary--green .digit-pay-line { border-color: rgba(244, 243, 238, 0.18); color: rgba(244, 243, 238, 0.92); }
.digit-pay-summary--green .digit-pay-total { border-color: rgba(52, 211, 153, 0.5); color: #fff; }
.digit-pay-summary--green .digit-pay-total strong { color: var(--dp-mint); }
.digit-pay-summary--green .digit-pay-yearly { color: rgba(244, 243, 238, 0.65); font-size: 12.5px; margin: 10px 0 0; }


/* ---------- v2.2: preview-parity polish + human verification ---------- */

.digit-pay-wrapper { max-width: 1120px; margin-left: auto; margin-right: auto; }
.digit-pay-wrapper,
.digit-pay-wrapper input,
.digit-pay-wrapper select,
.digit-pay-wrapper textarea,
.digit-pay-wrapper button { font-family: 'IBM Plex Sans Arabic', -apple-system, sans-serif; }
.digit-pay-wrapper .digit-pay-card { border-radius: 14px; padding: 18px; }
.digit-pay-wrapper .digit-pay-field label { font-size: 12.5px; font-weight: 600; }
.digit-pay-wrapper .digit-pay-field input,
.digit-pay-wrapper .digit-pay-field select,
.digit-pay-wrapper .digit-pay-field textarea { background: #FBFAF7; border-radius: 9px; padding: 9px 11px; font-size: 13px; }
.digit-pay-wrapper .digit-pay-includes { columns: 2; column-gap: 14px; }
.digit-pay-wrapper .digit-pay-includes li { font-size: 12.5px; padding: 3px 0; break-inside: avoid; }
.digit-pay-wrapper .digit-pay-btn-primary { padding: 13px; font-size: 15px; border-radius: 10px; }
.digit-pay-captcha { margin: 14px 0 4px; display: flex; }
@media (max-width: 560px) { .digit-pay-wrapper .digit-pay-includes { columns: 1; } }

/* ---------- v2.2.1: screenshot-driven fixes ---------- */

/* BUG: display:flex on price lines was overriding the [hidden] attribute,
   so the "ZATCA 0 SAR" line showed before the checkbox was ticked. */
.digit-pay-wrapper [hidden] { display: none !important; }

/* Checkmarks inline next to the text (theme text-align/positioning proof). */
.digit-pay-wrapper .digit-pay-includes li {
	position: static;
	padding-right: 0;
	text-align: right;
	display: block;
}
.digit-pay-wrapper .digit-pay-includes li::before {
	content: "✓ ";
	position: static;
	margin-left: 6px;
	right: auto;
}

/* Arabic pill: no mono font / letter-spacing (was rendering spaced-out). */
.digit-pay-wrapper .digit-pay-eyebrow {
	font-family: 'IBM Plex Sans Arabic', sans-serif;
	letter-spacing: 0;
	font-weight: 700;
}

/* Checkboxes glued to their labels even if the theme floats/spreads inputs. */
.digit-pay-wrapper .digit-pay-check { text-align: right; }
.digit-pay-wrapper .digit-pay-check label {
	display: inline-flex;
	justify-content: flex-start;
	width: auto;
	float: none;
}
.digit-pay-wrapper .digit-pay-check input[type="checkbox"] {
	float: none;
	position: static;
	margin: 3px 0 0;
}

/* Keep the pay button centered against text-align overrides above/theme. */
.digit-pay-wrapper .digit-pay-btn-primary { text-align: center; }
