/*
 * Chiggle Academy — sign-in modal.
 *
 * Reference: mockup/chiggle_academy_mockup.html `.signin-overlay` / `.signin-modal`.
 *
 * Phase 3a state: visual only. OAuth wiring (Nextend Social Login) lands at
 * Phase 8 — when configured, the .ca-social-buttons block is replaced with
 * [nextend_social_login] shortcode output (styled by overrides at the
 * bottom of this file).
 */

/* Overlay */
.ca-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(13, 31, 75, 0.55);
	backdrop-filter: blur(4px);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.2s ease;
}
.ca-modal-overlay[data-open="true"] {
	opacity: 1;
}
.ca-modal-overlay[hidden] {
	display: none;
}

/* Card */
.ca-modal {
	background: white;
	border-radius: var(--radius-lg);
	padding: 44px 38px 32px;
	width: 100%;
	max-width: 440px;
	/* Deeper, layered shadow for genuine card-on-page elevation rather
	 * than the previous flat --shadow-xl token. Two layers: a soft
	 * long-distance navy tint + a tighter under-shadow for crispness. */
	box-shadow:
		0 24px 60px -12px rgba(18, 43, 105, 0.28),
		0 8px 16px -4px rgba(18, 43, 105, 0.10);
	text-align: center;
	position: relative;
	max-height: 90vh;
	overflow-y: auto;
	border-top: 4px solid var(--gold);
}

.ca-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: var(--gray-100);
	color: var(--charcoal);
	font-size: 0.9rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s;
}
.ca-modal-close:hover {
	background: var(--gray-200);
}

.ca-modal-logo {
	width: 56px;
	height: 56px;
	margin: 0 auto 18px;
	display: block;
}

.ca-modal-title {
	/* Brand Kit §04 Type Scale: Display / H1 surfaces = Nunito (--font-heading).
	 * This title is the focal heading of the entire modal viewport — the
	 * Display tier per §04, not a sub-section or card title. Matches the
	 * site-wide pattern set by `.entry-title` in global.css (which carries
	 * the same brand comment). Slip-through from v0.11.38's brand audit;
	 * the auth modal wasn't on that pass's surface list. Corrected here. */
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: clamp(1.5rem, 4vw, 1.95rem);
	color: var(--navy);
	margin: 0 0 14px;
	letter-spacing: -0.02em;
	line-height: 1.15;
}
/* Brand-stamp underline beneath the title — same gold as the top accent
 * stripe; classic premium pattern; gives the title a clear visual anchor
 * point instead of floating on whitespace. */
.ca-modal-title::after {
	content: '';
	display: block;
	width: 44px;
	height: 3px;
	background: var(--gold);
	border-radius: 2px;
	margin: 14px auto 0;
}

.ca-modal-subtitle {
	font-size: 0.92rem;
	color: var(--gray-500);
	margin: 0 0 30px;
	line-height: 1.5;
}

/* Social buttons (v0.9.97 — Nextend Social Login Free) */
.ca-social-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}
.ca-social-btn {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border: 1.5px solid var(--gray-200);
	border-radius: 12px;
	background: white;
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--charcoal);
	cursor: pointer;
	text-decoration: none !important;
	letter-spacing: -0.005em;
	/* Visible resting elevation — the previous 1-2 px shadow was too
	 * subtle. Now reads as a real, tactile, clickable element at rest
	 * and lifts noticeably on hover. The visual gap vs. the disabled
	 * SOON state below is unmistakable. */
	box-shadow:
		0 2px 4px rgba(18, 43, 105, 0.08),
		0 1px 2px rgba(18, 43, 105, 0.04);
	transition:
		border-color 0.18s ease,
		background-color 0.18s ease,
		transform 0.14s ease,
		box-shadow 0.18s ease;
	will-change: transform;
}
.ca-social-btn:hover {
	border-color: var(--navy);
	background: white;
	transform: translateY(-2px);
	box-shadow:
		0 10px 24px -8px rgba(18, 43, 105, 0.22),
		0 4px 8px -2px rgba(18, 43, 105, 0.10);
}
.ca-social-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(18, 43, 105, 0.06);
}
.ca-social-btn:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
	border-color: var(--navy);
}
.ca-social-btn svg {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}
.ca-social-btn-label {
	flex: 1;
	text-align: left;
}

/* Coming-soon disabled state — distinctly different style language
 * from the enabled buttons: no border, flat warm-grey block, dimmer
 * text + icons. The disabled buttons should read as "definitely
 * unavailable" at a glance, not as another flavour of clickable.
 * Same footprint preserved so the modal doesn't reflow when providers
 * get enabled in Nextend admin. */
.ca-social-btn-disabled,
.ca-social-btn-disabled:hover {
	cursor: not-allowed;
	opacity: 0.5;
	border: 1.5px solid transparent;
	background: rgba(18, 43, 105, 0.04);
	transform: none;
	box-shadow: none;
	color: var(--gray-500);
}
.ca-social-btn-disabled svg {
	filter: grayscale(100%);
	opacity: 0.55;
}
.ca-social-btn-soon {
	margin-left: auto;
	padding: 4px 9px;
	border-radius: 99px;
	font-size: 0.62rem;
	font-weight: 700;
	color: white;
	background: var(--gray-400);
	text-transform: uppercase;
	letter-spacing: 0.09em;
	line-height: 1.4;
	flex-shrink: 0;
}

/* Divider — softer, more breathing space; the "or" is a quiet beat
 * between two equal CTA columns, not a section header. */
.ca-auth-divider {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 22px 0 18px;
	color: var(--gray-400);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}
.ca-auth-divider::before,
.ca-auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
}

/* Form */
.ca-auth-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.ca-auth-input {
	padding: 15px 18px;
	border: 1.5px solid var(--gray-200);
	border-radius: 10px;
	font-family: var(--font-body);
	font-size: 0.98rem;
	color: var(--charcoal);
	background: white;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ca-auth-input::placeholder {
	color: var(--gray-400);
}
.ca-auth-input:focus {
	outline: 0;
	border-color: var(--navy);
	/* Soft navy focus ring — same shape as wp-login.css's input focus
	 * so the field response feels consistent between the modal and the
	 * native WP screens learners hit during password reset. */
	box-shadow: 0 0 0 3px rgba(18, 43, 105, 0.12);
}

/* Remember-me + inline Forgot password row (v0.11.53).
 *
 * Sits between the password field and the Sign In button. Two
 * affordances on one row: "Remember me" checkbox on the left,
 * "Forgot password?" link on the right. Pattern used by every major
 * SaaS login form (Notion, Linear, Stripe Dashboard) — keeps the
 * primary path (enter credentials → click button) on a clean vertical
 * axis while the two secondary affordances tuck into the negative
 * space below the inputs. */
.ca-auth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 4px 2px 6px;
	font-size: 0.82rem;
}
.ca-auth-remember {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--gray-500);
	cursor: pointer;
	user-select: none;
}
.ca-auth-remember input[type="checkbox"] {
	width: 15px;
	height: 15px;
	accent-color: var(--navy);
	cursor: pointer;
	margin: 0;
}
.ca-auth-forgot-inline {
	color: var(--gray-500);
	font-weight: 500;
	text-decoration: none;
	transition: color 0.15s ease;
}
.ca-auth-forgot-inline:hover,
.ca-auth-forgot-inline:focus-visible {
	color: var(--gold);
	text-decoration: underline;
}
.ca-auth-forgot-inline:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Inline auth-error message (v0.11.53). Shown when the AJAX login
 * endpoint returns a failure. Coral-tinted pill with the brand error
 * pair (--error-pale background, --error-dark AA-passing text from
 * variables.css). Hidden by default; the JS removes [hidden] when an
 * error needs surfacing. The role="alert" + aria-live="polite" on the
 * markup ensures screen readers announce it on appearance. */
.ca-auth-error {
	margin: 4px 0 -2px;
	padding: 10px 14px;
	background: var(--error-pale);
	color: var(--error-dark);
	border: 1px solid rgba(138, 39, 39, 0.18);
	border-radius: var(--radius-sm);
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.45;
	text-align: left;
}
.ca-auth-error[hidden] {
	display: none;
}

/* Submit button busy-state — keeps the user oriented while the AJAX
 * round-trip is in flight. The disabled property handles the click-
 * blocking; we just visually dim + show a not-allowed cursor. */
.ca-auth-form .ca-btn[aria-busy="true"] {
	opacity: 0.65;
	cursor: progress;
}

.ca-modal-footer {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--gray-100);
	font-size: 0.82rem;
	color: var(--gray-500);
	text-align: center;
}
.ca-modal-footer a {
	color: var(--gold);
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease;
}
.ca-modal-footer a:hover,
.ca-modal-footer a:focus-visible {
	text-decoration: underline;
	color: var(--gold-dark);
}

/* When body is locked while modal is open */
body.ca-modal-open {
	overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────
 * Mobile — tighten card padding so the upsized desktop spacing
 * (44/38/32) doesn't eat content width on small phones. At 360 px
 * viewport the previous 38 px horizontal padding left only ~244 px
 * of content room; we drop to 28 px below 480 px to recover ~20 px.
 * The brand stripe + gold underline + clamp()-scaled title all
 * still work without further tuning.
 * ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.ca-modal {
		padding: 36px 28px 28px;
		border-radius: var(--radius-md);
	}
	.ca-modal-logo {
		width: 48px;
		height: 48px;
		margin-bottom: 14px;
	}
	.ca-modal-subtitle {
		margin-bottom: 24px;
	}
}

/* ─────────────────────────────────────────────────────────────
 * Nextend Social Login overrides (activated at Phase 8 when the
 * plugin renders its real buttons inside our modal).
 * ───────────────────────────────────────────────────────────── */
.ca-social-buttons .nsl-container-buttons {
	gap: 10px;
}
.ca-social-buttons .nsl-button {
	border-radius: 10px !important;
	padding: 11px 18px !important;
	border: 1.5px solid var(--gray-200) !important;
	font-family: var(--font-body) !important;
}
