/**
 * Ash & Ice Core — Authentication UI (AIC-009 UX polish, 2026-07-07)
 *
 * Styles the native login / register / lost-password / reset-password
 * views ([ash_ice_login], [ash_ice_register]) and the guest view of
 * [ash_ice_account], which now renders the same login experience.
 * Presentation only — see AuthModule for the underlying logic.
 *
 * Colors are CSS custom properties so a theme can override them
 * (e.g. in a child theme stylesheet loaded after this one) without
 * editing plugin files.
 */

:root {
	--ash-ice-auth-surface: #ffffff;
	--ash-ice-auth-text: #1b1f23;
	--ash-ice-auth-muted: #6b7280;
	--ash-ice-auth-border: #e5e7eb;
	--ash-ice-auth-accent: #14181c;
	--ash-ice-auth-accent-text: #ffffff;
	--ash-ice-auth-error: #d63638;
	--ash-ice-auth-success: #00a32a;
	--ash-ice-auth-radius: 14px;
}

/**
 * Standard visually-hidden pattern (off-screen but not clipped by
 * negative positioning) — used for the registration honeypot field.
 * The previous `position:absolute; left:-9999px;` approach expanded
 * the page's horizontal scroll region on mobile, since an absolutely
 * positioned element pushed far into negative space still counts
 * toward the document's scrollable width unless clipped (staging bug,
 * 2026-07-07).
 */
.ash-ice-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.ash-ice-auth-card {
	/**
	 * Root cause of the mobile horizontal-overflow bug (staging,
	 * 2026-07-07 — the earlier `overflow-x: hidden` only hid the
	 * symptom): a block element's `width` percentage is computed
	 * against the containing block's content width, and does NOT
	 * subtract the element's own horizontal margins the way `auto`
	 * width does. Combining `width: 100%` with the non-zero left/right
	 * margins the mobile media query below sets made this element
	 * render 32px (2 × 16px) wider than its container on every screen
	 * narrower than the container itself. Deliberately no `width`
	 * property at all — the default block-level `width: auto` fills
	 * available space minus margins correctly at any viewport, while
	 * `max-width` still caps it on desktop.
	 */
	box-sizing: border-box;
	max-width: 420px;
	margin: 48px auto;
	padding: 40px 36px;
	background: var(--ash-ice-auth-surface);
	color: var(--ash-ice-auth-text);
	border: 1px solid var(--ash-ice-auth-border);
	border-radius: var(--ash-ice-auth-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.08);
	font-size: 15px;
	line-height: 1.5;
}

.ash-ice-auth-card *,
.ash-ice-auth-card *::before,
.ash-ice-auth-card *::after {
	box-sizing: border-box;
}

.ash-ice-auth-brand {
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ash-ice-auth-muted);
	margin: 0 0 28px;
}

.ash-ice-auth-card p {
	margin: 0 0 16px;
}

.ash-ice-auth-card label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--ash-ice-auth-text);
}

.ash-ice-auth-card label input[type="checkbox"] {
	width: auto;
	display: inline;
	margin: 0 6px 0 0;
}

.ash-ice-auth-card .input,
.ash-ice-auth-card input[type="text"],
.ash-ice-auth-card input[type="email"],
.ash-ice-auth-card input[type="password"] {
	display: block;
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	line-height: 1.4;
	border: 1px solid var(--ash-ice-auth-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ash-ice-auth-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ash-ice-auth-card .input:focus,
.ash-ice-auth-card input:focus {
	outline: none;
	border-color: var(--ash-ice-auth-accent);
	box-shadow: 0 0 0 3px rgba(20, 24, 28, 0.08);
}

.ash-ice-auth-card .button,
.ash-ice-auth-card button[type="submit"] {
	display: inline-block;
	width: 100%;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	border-radius: 10px;
	border: 1px solid var(--ash-ice-auth-accent);
	background: var(--ash-ice-auth-accent);
	color: var(--ash-ice-auth-accent-text);
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.05s ease;
}

.ash-ice-auth-card .button:hover,
.ash-ice-auth-card button[type="submit"]:hover {
	opacity: 0.88;
	color: var(--ash-ice-auth-accent-text);
}

.ash-ice-auth-card .button:active,
.ash-ice-auth-card button[type="submit"]:active {
	transform: translateY(1px);
}

.ash-ice-auth-card a {
	color: var(--ash-ice-auth-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ash-ice-auth-card a:hover {
	color: var(--ash-ice-auth-accent);
}

/* Not scoped to .ash-ice-auth-card — these also appear standalone (the
 * already-authenticated fallback notice, and [ash_ice_account]'s own
 * password-change messages on the authenticated dashboard view). */
.ash-ice-auth-error,
.ash-ice-auth-success,
.ash-ice-auth-notice {
	display: block;
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 14px;
	margin: 0 0 16px;
}

.ash-ice-auth-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: var(--ash-ice-auth-error) !important;
}

.ash-ice-auth-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: var(--ash-ice-auth-success);
}

.ash-ice-auth-notice {
	background: #f3f4f6;
	border: 1px solid var(--ash-ice-auth-border);
	color: var(--ash-ice-auth-text);
}

/* Each auth "view" already has its own inner wrapper div — remove the
 * double margins that would otherwise stack with the card padding. */
.ash-ice-auth-card .ash-ice-login-form,
.ash-ice-auth-card .ash-ice-lostpassword,
.ash-ice-auth-card .ash-ice-resetpass,
.ash-ice-auth-card .ash-ice-resetpass-invalid,
.ash-ice-auth-card .ash-ice-register {
	margin: 0;
}

.ash-ice-auth-card .ash-ice-login-form > p:last-child,
.ash-ice-auth-card .ash-ice-register > p:last-child {
	margin-bottom: 0;
	text-align: center;
	font-size: 14px;
	color: var(--ash-ice-auth-muted);
}

@media (max-width: 480px) {
	.ash-ice-auth-card {
		margin: 24px 16px;
		padding: 28px 22px;
		border-radius: 12px;
	}
}

/**
 * Member Dashboard (AIC-006, 2026-07-07)
 *
 * The authenticated view of [ash_ice_account]. Reuses the same
 * --ash-ice-auth-* custom properties as the login/register card above
 * so the guest → authenticated journey feels like one visual system.
 */

.ash-ice-dashboard {
	max-width: 960px;
	margin: 32px auto;
	padding: 0 16px;
	color: var(--ash-ice-auth-text);
	font-size: 15px;
	line-height: 1.5;
	overflow-x: hidden;
}

.ash-ice-dashboard-book-next {
	margin: 0 0 20px;
}

.ash-ice-dashboard-book-next .button {
	display: block;
	width: 100%;
	padding: 14px 18px;
	font-size: 15px;
	border-radius: 999px;
}

/**
 * Single-column, top-to-bottom flow (Product Owner direction,
 * 2026-07-07): Membership -> Booking Summary -> Billing -> Wellness
 * -> Account, in that literal order. Previously a 2-column grid.
 */
.ash-ice-dashboard-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

.ash-ice-dashboard-card {
	box-sizing: border-box;
	background: var(--ash-ice-auth-surface);
	border: 1px solid var(--ash-ice-auth-border);
	border-radius: var(--ash-ice-auth-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
	padding: 28px;
	overflow-x: hidden;
}

.ash-ice-dashboard-next-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ash-ice-dashboard-next-actions .button {
	width: auto;
}

.ash-ice-dashboard-card * {
	box-sizing: border-box;
}

.ash-ice-dashboard-card h3 {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 700;
}

.ash-ice-dashboard-card h4 {
	margin: 24px 0 12px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ash-ice-auth-muted);
}

.ash-ice-dashboard-card p {
	margin: 0 0 12px;
}

.ash-ice-dashboard-facts {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 16px;
}

.ash-ice-dashboard-facts > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--ash-ice-auth-border);
}

.ash-ice-dashboard-facts > div:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.ash-ice-dashboard-facts dt {
	color: var(--ash-ice-auth-muted);
	font-size: 13px;
}

.ash-ice-dashboard-facts dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
}

.ash-ice-dashboard-card .button,
.ash-ice-dashboard-card button[type="submit"] {
	display: inline-block;
	width: auto;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	border-radius: 10px;
	border: 1px solid var(--ash-ice-auth-accent);
	background: var(--ash-ice-auth-accent);
	color: var(--ash-ice-auth-accent-text);
	cursor: pointer;
	text-decoration: none;
}

.ash-ice-dashboard-card .button:hover,
.ash-ice-dashboard-card button[type="submit"]:hover {
	opacity: 0.88;
	color: var(--ash-ice-auth-accent-text);
}

.ash-ice-dashboard-card .input,
.ash-ice-dashboard-card input[type="password"] {
	display: block;
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid var(--ash-ice-auth-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ash-ice-auth-text);
}

.ash-ice-dashboard-card .input:focus,
.ash-ice-dashboard-card input:focus {
	outline: none;
	border-color: var(--ash-ice-auth-accent);
	box-shadow: 0 0 0 3px rgba(20, 24, 28, 0.08);
}

.ash-ice-dashboard-card label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
}

.ash-ice-dashboard-next-appointment {
	font-size: 14px;
}

.ash-ice-dashboard-upcoming-count {
	color: var(--ash-ice-auth-muted);
	font-size: 13px;
}

.ash-ice-dashboard-recent-bookings {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	font-size: 13px;
	color: var(--ash-ice-auth-muted);
}

.ash-ice-dashboard-recent-bookings li {
	padding: 6px 0;
	border-bottom: 1px solid var(--ash-ice-auth-border);
}

.ash-ice-dashboard-recent-bookings li:last-child {
	border-bottom: none;
}

.ash-ice-dashboard-status-cancelled {
	color: var(--ash-ice-auth-error);
	font-weight: 600;
}

.ash-ice-dashboard-wellness-intro {
	color: var(--ash-ice-auth-muted);
	font-size: 13px;
}

.ash-ice-dashboard-wellness-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.ash-ice-dashboard-wellness-metric {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 16px 8px;
	border: 1px dashed var(--ash-ice-auth-border);
	border-radius: 10px;
	text-align: center;
}

.ash-ice-dashboard-wellness-value {
	font-size: 20px;
	font-weight: 700;
	color: var(--ash-ice-auth-muted);
}

.ash-ice-dashboard-wellness-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ash-ice-auth-muted);
}

.ash-ice-dashboard .ash-ice-account-password form {
	margin: 0;
}

@media (max-width: 720px) {
	.ash-ice-dashboard-wellness-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/**
 * Explicit, theme-independent rendering (staging bug, 2026-07-07):
 * an earlier `@media (prefers-color-scheme: dark)` override here
 * redefined the design tokens for dark mode, but without also setting
 * `color-scheme`, browsers still auto-dark-style native form control
 * chrome (checkboxes, input backgrounds, scrollbars) against the
 * *page's* dark background — producing black cards, low-contrast
 * text, and inconsistent rendering across browsers/systems. Per
 * Product Owner direction, this plugin now explicitly controls every
 * background, border, input, button, and typography color at all
 * times — `color-scheme: light` tells the browser not to apply its
 * own dark-mode heuristics to native controls inside these cards, so
 * the UI renders identically regardless of system or browser theme.
 */
.ash-ice-auth-card,
.ash-ice-dashboard {
	color-scheme: light;
}

/**
 * Unified Booking Entry chooser (AIC-010, 2026-07-07). Reuses
 * .ash-ice-auth-card for the same card/branding treatment as the
 * login/register views, per Product Owner direction to keep this
 * visually consistent with the authentication pages.
 */

.ash-ice-booking-entry-title {
	margin: 0 0 24px;
	font-size: 20px;
	font-weight: 700;
	text-align: center;
}

.ash-ice-booking-entry-choice {
	text-align: center;
}

.ash-ice-booking-entry-label {
	margin: 0 0 4px;
	font-weight: 600;
	font-size: 16px;
}

.ash-ice-booking-entry-help {
	margin: 0 0 16px;
	color: var(--ash-ice-auth-muted);
	font-size: 14px;
}

.ash-ice-booking-entry-choice .button {
	width: 100%;
	padding: 14px 18px;
	font-size: 16px;
}

.ash-ice-booking-entry-divider {
	height: 1px;
	margin: 28px 0;
	background: var(--ash-ice-auth-border);
}
