/**
 * Account/auth page styling — FT-card aesthetic.
 * Loaded only on pages containing a segf_* auth shortcode (see
 * maybe_enqueue_accounts_assets() in module-engagement-accounts.php).
 *
 * Adjust the custom properties below to match the brand palette already
 * defined in the theme; these are placeholders in the FT's register.
 */

/**
 * Colour values below match the site's actual palette (warm-ivory canvas,
 * near-black surfaces, publication blue for CTAs/interaction, status red
 * for alerts). If these are already declared as CSS custom properties at
 * :root sitewide via the Customiser, swap the hex values here for
 * var(--brand-blue) etc. instead of duplicating them — kept as literals
 * for now since that wasn't confirmed.
 */
.segf-auth-card {
	--segf-ink: #1a1a1a;         /* --surface-dark */
	--segf-text: #222222;        /* --contrast / body text */
	--segf-accent: #3a67c9;      /* --base-off-blue — Subscribe CTA, active states */
	--segf-error: #c62828;       /* --status-red */
	--segf-success: #1e6b3c;     /* distinct from --editorial-green; semantic only, not a taxonomy colour */
	--segf-border: #dcded5;      /* --border-grey */

	max-width: 30rem;
	margin: 2rem auto;
	padding: 2rem;
	background: #ffffff;         /* --surface-white, elevated card on ivory canvas */
	border: 1px solid var(--segf-border);
	color: var(--segf-text);
}

.segf-auth-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: var(--segf-ink);
}

.cf-turnstile {
	margin-bottom: 1.25rem;
}

.segf-auth-subtitle {
	margin: 0 0 1.5rem;
	color: #555;
}

.segf-form .segf-field-group {
	margin-bottom: 1.25rem;
}

.segf-form label {
	display: block;
	font-weight: 600;
	font-size: 0.875rem;
	margin-bottom: 0.375rem;
}

.segf-form input[type="text"],
.segf-form input[type="email"],
.segf-form input[type="password"],
.segf-form input[type="number"],
.segf-form select {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--segf-border);
	background: #fff;
	font-size: 1rem;
	border-radius: 2px;
	box-sizing: border-box;
}

.segf-form input:focus,
.segf-form select:focus {
	outline: 2px solid var(--segf-accent);
	outline-offset: 1px;
}

.segf-checkbox-group label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400;
	font-size: 0.9rem;
}

.segf-checkbox-group input[type="checkbox"] {
	margin-top: 0.2rem;
}

/* Toggle switches for preference opt-ins (digest, offers) — the FT reference
   uses pill switches here and a plain checkbox for legal consent, so this
   is intentionally a separate style from .segf-checkbox-group above. */
.segf-toggle-row {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	cursor: pointer;
}

.segf-toggle-switch {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 2.25rem;
	height: 1.25rem;
	margin-top: 0.125rem;
}

.segf-toggle-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.segf-toggle-track {
	position: absolute;
	inset: 0;
	background: #ccc;
	border-radius: 999px;
	transition: background 0.15s ease;
}

.segf-toggle-track::before {
	content: "";
	position: absolute;
	left: 0.125rem;
	top: 0.125rem;
	width: 1rem;
	height: 1rem;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.segf-toggle-switch input:checked + .segf-toggle-track {
	background: var(--segf-accent, #3a67c9);
}

.segf-toggle-switch input:checked + .segf-toggle-track::before {
	transform: translateX(1rem);
}

.segf-toggle-switch input:focus-visible + .segf-toggle-track {
	outline: 2px solid var(--segf-accent, #3a67c9);
	outline-offset: 2px;
}

.segf-toggle-text {
	font-size: 0.9rem;
	line-height: 1.4;
}

.segf-field-hint {
	margin: 0.25rem 0 0;
	font-size: 0.8rem;
	color: #666;
}

.segf-submit-btn {
	width: 100%;
	padding: 0.75rem 1rem;
	background: var(--segf-accent);
	color: #fff;
	border: none;
	border-radius: 2px;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
}

.segf-submit-btn:hover {
	filter: brightness(0.92);
}

.segf-link-btn {
	background: none;
	border: none;
	padding: 0;
	color: var(--segf-accent);
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.875rem;
}

.segf-auth-links {
	margin: 1rem 0 0;
	font-size: 0.9rem;
	text-align: center;
}

.segf-auth-links a {
	color: var(--segf-accent);
}

.segf-form-error {
	background: #fbeae8;
	border: 1px solid var(--segf-error);
	color: var(--segf-error);
	padding: 0.75rem 1rem;
	font-size: 0.9rem;
	margin-bottom: 1.25rem;
}

.segf-form-success {
	background: #e8f3ec;
	border: 1px solid var(--segf-success);
	color: var(--segf-success);
	padding: 0.75rem 1rem;
	font-size: 0.9rem;
	margin-bottom: 1.25rem;
}

/* Honeypot: visually hidden, but not display:none (some bots skip those) */
.segf-hp-wrap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.segf-subscribe-link {
	display: inline-block;
	background: #3a67c9; /* --base-off-blue, per its existing "Subscribe CTA" role */
	color: #fff;
	padding: 0.5rem 1rem;
	border-radius: 2px;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.9rem;
}

.segf-logout-link {
	font-size: 0.875rem;
}