/* Sign-in, forgot and reset password (layouts/auth.php). Uses tokens.css only.
   A centred two-part card on the navy wave scene: a teal brand side with pastel feature tiles,
   and a white form side that opens with a coloured icon tile per page. */

.auth-page {
	margin: 0;
	background: var(--navy-900);
	color: var(--color-text-body);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
}

/* ---- Background scene: drifting voice waves (decorative) ---- */
.auth-scene {
	position: fixed;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	background:
		radial-gradient(circle at 12% 8%, var(--glow-teal), transparent 42%),
		radial-gradient(circle at 92% 96%, var(--glow-teal), transparent 46%),
		var(--navy-900);
}

/* Waves: each SVG is 200% wide and slides by half, so the loop is seamless. */
.auth-waves {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 320px;
	transform: translateY(-50%);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
	        mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.auth-wave {
	position: absolute;
	inset: 0 auto 0 0;
	width: 200%;
	height: 100%;
	overflow: visible;
}
.auth-wave path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.auth-wave--1 path { stroke: var(--teal-300); stroke-width: 2;   opacity: .45; }
.auth-wave--2 path { stroke: var(--white);    stroke-width: 1.5; opacity: .14; }
.auth-wave--3 path { stroke: var(--teal-500); stroke-width: 1.5; opacity: .35; }

@media (prefers-reduced-motion: no-preference) {
	.auth-wave--1 { animation: auth-drift 22s linear infinite; }
	.auth-wave--2 { animation: auth-drift 14s linear infinite reverse; }
	.auth-wave--3 { animation: auth-drift 34s linear infinite; }
	.auth-waves   { animation: auth-breathe 9s ease-in-out infinite alternate; }
}
@keyframes auth-drift   { to { transform: translateX(-50%); } }
@keyframes auth-breathe { from { transform: translateY(-50%) scaleY(.7); } to { transform: translateY(-50%) scaleY(1.05); } }

/* ---- Page + card ---- */
.auth {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-4);
	min-height: 100vh;
	min-height: 100dvh;
	padding: var(--space-6) var(--space-4);
}

.auth__card {
	display: grid;
	grid-template-columns: minmax(0, 400px) minmax(0, 460px);
	width: 100%;
	max-width: 860px;
	overflow: hidden;
	border-radius: var(--radius-xl);
	background: var(--color-surface);
	box-shadow: var(--shadow-lg);
}

/* ---- Brand side: the teal card from the dashboard ---- */
.auth__intro {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: var(--space-8);
	background: var(--teal-700);
	color: var(--white);
}
.auth__brand {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	font-family: var(--font-display);
	font-size: var(--fs-h5);
	font-weight: var(--fw-medium);
	letter-spacing: var(--ls-title);
	color: var(--color-text);
}
.auth__brand:hover { color: var(--color-text); text-decoration: none; }
.auth__brand--light, .auth__brand--light:hover { color: var(--white); }
.auth__brand:focus-visible { outline: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-focus); }
.auth__mark { display: block; flex: none; width: 40px; height: 40px; line-height: 0; }
.auth__mark .logo-mark { width: 100%; height: 100%; }
.auth__brand--light .auth__mark { border-radius: var(--radius-sm); box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.auth__logo-img { display: block; width: 40px; height: 40px; object-fit: contain; border-radius: var(--radius-sm); background: var(--white); }

/* Small static waveform in the corner, echoing the logo. */
.auth__intro-wave {
	position: absolute;
	top: var(--space-8);
	right: var(--space-8);
	display: flex;
	align-items: center;
	gap: 4px;
	height: 40px;
}
.auth__intro-wave i { display: block; width: 4px; border-radius: 4px; background: var(--yellow-400); opacity: .9; }
.auth__intro-wave i:nth-child(1), .auth__intro-wave i:nth-child(7) { height: 10px; }
.auth__intro-wave i:nth-child(2), .auth__intro-wave i:nth-child(6) { height: 20px; }
.auth__intro-wave i:nth-child(3), .auth__intro-wave i:nth-child(5) { height: 30px; }
.auth__intro-wave i:nth-child(4) { height: 40px; }

.auth__intro-title {
	margin: var(--space-8) 0 var(--space-5);
	max-width: 16ch;
	font-family: var(--font-display);
	font-size: 1.75rem;
	font-weight: var(--fw-semibold);
	line-height: 1.15;
	letter-spacing: var(--ls-heading);
	color: var(--white);
}

.auth__perks { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.auth__perk {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: 10px var(--space-3);
	border-radius: var(--radius-md);
	color: var(--navy-900);
}
.auth__perk--sky      { background: var(--sky-100); }
.auth__perk--peach    { background: var(--coral-100); }
.auth__perk--cream    { background: var(--yellow-100); }
.auth__perk--lavender { background: var(--lavender-100); }
.auth__perk-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: var(--radius-sm);
	background: var(--white);
	color: var(--navy-900);
}
.auth__perk-icon .ni { width: 20px; height: 20px; }
.auth__perk strong { display: block; font-size: var(--fs-sm); font-weight: var(--fw-bold); line-height: 1.3; }
.auth__perk small { display: block; font-size: var(--fs-xs); line-height: 1.35; color: var(--gray-600); }

/* Two-tone icons (same as the app: helpers/icon_helper.php) */
.ni { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ni .ni-a { stroke: none; fill: var(--ni-accent, var(--yellow-400)); }
.ni--yellow   { --ni-accent: var(--yellow-400); }
.ni--coral    { --ni-accent: var(--coral-400); }
.ni--teal     { --ni-accent: var(--teal-300); }
.ni--sky      { --ni-accent: var(--sky-400); }
.ni--lavender { --ni-accent: var(--lavender-400); }

/* ---- Form side ---- */
.auth__panel { display: flex; flex-direction: column; justify-content: center; padding: var(--space-10); }
.auth__brand--compact { display: none; margin-bottom: var(--space-6); }

.auth__icon {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin-bottom: var(--space-4);
	border-radius: var(--radius-md);
	color: var(--navy-900);
}
.auth__icon .ni { width: 26px; height: 26px; }
.auth__icon--mint     { background: var(--teal-100); }
.auth__icon--sky      { background: var(--sky-100); }
.auth__icon--lavender { background: var(--lavender-100); }

.auth__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--fs-h2);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-heading);
	letter-spacing: var(--ls-heading);
	color: var(--color-text);
}
.auth__subtitle { margin: var(--space-2) 0 var(--space-6); max-width: 40ch; color: var(--color-text-body); }

/* ---- Fields ---- */
.auth-field { margin-bottom: var(--space-4); }
.auth-field label {
	display: block;
	margin: 0 0 var(--space-2) var(--space-1);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-tight);
	color: var(--color-text);
}
.auth-field__control { position: relative; }

.auth-input {
	display: block;
	width: 100%;
	height: var(--input-height);
	padding: 0 var(--space-5);
	border: var(--btn-border-width) solid var(--gray-300);
	border-radius: var(--radius-pill);
	background: var(--color-bg);
	color: var(--color-text);
	font: inherit;
	transition: border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out), background-color var(--duration) var(--ease-out);
}
.auth-input:hover { border-color: var(--gray-400); }
.auth-input:focus {
	outline: none;
	border-color: var(--color-primary);
	background: var(--color-surface);
	box-shadow: var(--shadow-focus);
}
.auth-field__control .auth-input { padding-right: 56px; }

.auth-reveal {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-circle);
	background: transparent;
	color: var(--color-text-body);
	cursor: pointer;
}
.auth-reveal:hover { background: var(--gray-100); color: var(--color-text); }
.auth-reveal:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---- Actions ---- */
.auth__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-4);
	margin-top: var(--space-6);
}
.auth-btn {
	width: 100%;
	height: var(--btn-height);
	padding: 0 var(--btn-pad-x);
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--color-primary);
	color: var(--white);
	font-family: var(--font-body);
	font-size: var(--fs-sm);
	font-weight: var(--fw-bold);
	cursor: pointer;
	transition: background-color var(--duration) var(--ease-out);
}
.auth-btn:hover { background: var(--color-primary-hover); }
.auth-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.auth__link {
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	color: var(--color-primary-text);
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-thickness: 1.5px;
}
.auth__link:hover { color: var(--color-text); }
.auth__link:focus-visible { outline: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-focus); }

.auth__footer { margin: 0; font-size: var(--fs-sm); color: var(--color-text-inverse-muted); }

/* ---- Alerts (flash messages + validation) in token colours ---- */
.auth__card .alert {
	margin-bottom: var(--space-5);
	padding: var(--space-3) var(--space-5);
	border: 0;
	border-radius: var(--radius-lg);
	font-size: var(--fs-sm);
	line-height: 1.5;
}
.auth__card .alert p { margin: 0; }
.auth__card .alert-danger  { background: var(--color-danger-soft);  color: var(--color-danger-text); }
.auth__card .alert-success { background: var(--color-success-soft); color: var(--color-success-text); }
.auth__card .alert-info    { background: var(--color-info-soft);    color: var(--color-info-text); }
.auth__card .alert a { color: inherit; font-weight: var(--fw-bold); text-decoration: underline; word-break: break-all; }
.auth__card .alert .close { color: inherit; opacity: .6; text-shadow: none; padding: var(--space-3) var(--space-4); }

/* ---- Narrow screens: form only, brand above it ---- */
@media (max-width: 860px) {
	.auth__card { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
	.auth__intro { display: none; }
	.auth__brand--compact { display: flex; }
}
@media (max-width: 600px) {
	.auth { justify-content: flex-start; padding-top: var(--space-6); }
	.auth-waves { top: 84%; }
	.auth__panel { padding: var(--space-8) var(--space-6); }
	.auth__card { border-radius: var(--radius-lg); }
	.auth__title { font-size: var(--fs-h3); line-height: var(--lh-title); }
}

/* ---- Short windows (most laptops): compact so the page never scrolls ---- */
@media (max-height: 760px) {
	.auth__intro { padding: var(--space-6); }
	.auth__intro-wave { top: var(--space-6); right: var(--space-6); }
	.auth__intro-title { margin: var(--space-6) 0 var(--space-4); font-size: 1.5rem; }
	.auth__perk { padding: 8px var(--space-3); }
	.auth__panel { padding: var(--space-8); }
	.auth__icon { width: 44px; height: 44px; margin-bottom: var(--space-3); }
	.auth__title { font-size: var(--fs-h3); line-height: var(--lh-title); }
	.auth__subtitle { margin-bottom: var(--space-5); }
	.auth-field { margin-bottom: var(--space-3); }
	.auth-field label { margin-bottom: 6px; }
	.auth-input { height: 46px; }
	.auth__actions { margin-top: var(--space-5); }
	.auth-btn { height: 48px; }
	.auth__footer { display: none; }
}
@media (max-height: 760px) and (max-width: 600px) {
	.auth__panel { padding: var(--space-6); }
	.auth__icon { display: none; }
	.auth__brand--compact { margin-bottom: var(--space-4); }
}
