/* EST Team Licensing — pre-checkout modal
   Retheme by overriding the variables below to match EST brand colors. */
:root {
	--est-primary: #6d28d9;
	--est-primary-hover: #5b21b6;
	--est-primary-soft: #f3effe;
	--est-ink: #111827;
	--est-muted: #6b7280;
	--est-border: #e5e7eb;
	--est-surface: #ffffff;
	--est-radius: 16px;
	--est-shadow: 0 20px 60px rgba(17, 24, 39, 0.18);
}

.est-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
}
.est-modal.is-open { display: flex; }

.est-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
	backdrop-filter: blur(2px);
}

.est-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	background: var(--est-surface);
	border-radius: var(--est-radius);
	box-shadow: var(--est-shadow);
	padding: clamp(22px, 4vw, 32px);
	color: var(--est-ink);
	font-family: inherit;
	animation: est-pop 0.18s ease-out;
}
@keyframes est-pop {
	from { transform: translateY(8px) scale(0.98); opacity: 0; }
	to   { transform: translateY(0) scale(1); opacity: 1; }
}

.est-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	border: 0;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	color: var(--est-muted);
	cursor: pointer;
}
.est-modal__close:hover { color: var(--est-ink); }

.est-modal__title {
	margin: 0 0 4px;
	font-size: clamp(1.25rem, 2.4vw, 1.5rem);
	font-weight: 700;
}
.est-modal__sub {
	margin: 0 0 18px;
	color: var(--est-muted);
	font-size: 0.95rem;
}

/* Plan card (confirm step) */
.est-plan-card {
	border: 1px solid var(--est-border);
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 20px;
	background: var(--est-primary-soft);
}
.est-plan-card__name { font-size: 1.15rem; font-weight: 700; }
.est-plan-card__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 6px;
	color: var(--est-muted);
	font-size: 0.92rem;
}
.est-plan-card__price strong { color: var(--est-ink); }

/* Counter: small learners box + small annual-total box, side by side.
   De-emphasised on purpose so the buyer isn't watching a big total climb. */
.est-count-row {
	display: flex;
	gap: 12px;
	align-items: flex-end;
	margin: 8px 0 12px;
}
.est-count-field { flex: 1; min-width: 0; }
.est-count-field__label {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--est-muted);
	margin-bottom: 4px;
}
.est-count-field__input {
	width: 100%;
	border: 1px solid var(--est-border);
	border-radius: 10px;
	text-align: center;
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--est-ink);
	padding: 12px 8px;
	-moz-appearance: textfield;
}
.est-count-field__input:focus { outline: 2px solid var(--est-primary-soft); border-color: var(--est-primary); }
.est-count-field__input::-webkit-outer-spin-button,
.est-count-field__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.est-count-field--price .est-count-field__price {
	border: 1px solid var(--est-border);
	border-radius: 10px;
	background: #f9fafb;
	text-align: center;
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--est-ink);
	padding: 13px 8px;
}

.est-counter__hint {
	text-align: center;
	color: var(--est-muted);
	font-size: 0.85rem;
	margin: 2px 0 4px;
}
.est-counter__hint strong { color: var(--est-ink); }

.est-error {
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 0.88rem;
	margin: 10px 0 0;
}

/* Buttons */
.est-actions { display: flex; gap: 10px; margin-top: 18px; }
.est-actions .est-btn--ghost { flex: 0 0 auto; }
.est-actions .est-btn--primary { flex: 1; }

.est-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	border: 0;
	border-radius: 10px;
	padding: 14px 20px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
}
.est-btn--primary { background: var(--est-primary); color: #fff; }
.est-btn--primary:hover { background: var(--est-primary-hover); }
.est-btn--primary:disabled { opacity: 0.7; cursor: wait; }
.est-btn--ghost {
	width: auto;
	background: transparent;
	color: var(--est-muted);
	border: 1px solid var(--est-border);
}
.est-btn--ghost:hover { color: var(--est-ink); }

.est-btn__spinner {
	width: 16px; height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: est-spin 0.7s linear infinite;
}
@keyframes est-spin { to { transform: rotate(360deg); } }

/* Cart page locked quantity */
.est-locked-qty {
	display: inline-block;
	min-width: 2.5em;
	text-align: center;
	font-weight: 600;
}

/* ============================================================
   v2.2 — stepper counter, link nav, details+summary step
   ============================================================ */

/* Stepper counter */
.est-counter {
	display: grid;
	grid-template-columns: 56px 1fr 56px;
	align-items: stretch;
	border: 1px solid var(--est-border);
	border-radius: 12px;
	overflow: hidden;
	margin: 14px 0 12px;
}
.est-counter__btn {
	border: 0; background: #f9fafb; font-size: 1.5rem; line-height: 1;
	color: var(--est-ink); cursor: pointer; transition: background 0.15s;
}
.est-counter__btn:hover { background: #f0f1f3; }
.est-counter__input {
	border: 0; border-left: 1px solid var(--est-border); border-right: 1px solid var(--est-border);
	text-align: center; font-size: 1.7rem; font-weight: 700; color: var(--est-ink);
	-moz-appearance: textfield; width: 100%; padding: 14px 0;
}
.est-counter__input::-webkit-outer-spin-button,
.est-counter__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.est-counter__hint, .est-counter__unit { text-align: center; color: var(--est-muted); font-size: 0.9rem; margin: 2px 0; }
.est-counter__unit strong { color: var(--est-ink); }

/* Link-style navigation */
.est-nav-links { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.est-nav-links--center { justify-content: center; }
.est-navlink { color: var(--est-primary); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: 0.98rem; }
.est-navlink:hover { color: var(--est-primary-hover); }

/* Details step (contact + order summary) */
.est-details { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 16px; text-align: left; }
.est-dfield { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; font-weight: 600; color: #374151; }
.est-dfield input {
	font: inherit; font-weight: 400; padding: 11px 13px; border: 1px solid var(--est-border);
	border-radius: 10px; background: #fff; color: var(--est-ink);
}
.est-dfield input:focus { outline: 2px solid var(--est-primary-soft); border-color: var(--est-primary); }

.est-summary { border: 1px solid var(--est-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; text-align: left; }
.est-summary__title { font-weight: 700; margin-bottom: 8px; }
.est-summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; color: var(--est-muted); padding: 5px 0; }
.est-summary__row span:last-child { color: var(--est-ink); font-weight: 600; text-align: right; }
.est-summary__row--total { border-top: 1px solid var(--est-border); margin-top: 4px; padding-top: 10px; }
.est-summary__row--total span { font-size: 1.05rem; font-weight: 800; color: var(--est-primary); }

.est-btn--pay { width: 100%; }

/* v2.2.2 — nav links were rendering white-on-white (theme override) */
#est-modal .est-navlink,
#est-modal .est-navlink:link,
#est-modal .est-navlink:visited { color: var(--est-primary) !important; text-decoration: underline !important; }
#est-modal .est-navlink:hover { color: var(--est-primary-hover) !important; }
