/*
 * Telas de entrada (login, esqueci minha senha, cadastro), todas as familias, 2026-10-24. Duas colunas no desktop (formulario + painel da
 * marca), so o formulario no celular. Claro/escuro conforme o sistema da pessoa (prefers-color-scheme); cor de destaque por familia
 * (html[data-family]). Decisoes em src/main/prompt/Layout geral - benchmark e decisões.md.
 */
:root {
	--auth-bg: #f6f7fb;
	--auth-surface: #ffffff;
	--auth-text: #111827;
	--auth-muted: #5b6474;
	--auth-border: #d9dee7;
	--auth-input-bg: #ffffff;
	--auth-accent: #2f6fe4;
	--auth-accent-text: #ffffff;
	--auth-danger: #c62828;
	--auth-danger-bg: #fdecec;
	--auth-info-bg: #eaf2ff;
	--auth-focus: color-mix(in srgb, var(--auth-accent) 35%, transparent);
	--auth-panel-ink: #0f172a;
}
html[data-family="3"] { --auth-accent: #d6336c; }
html[data-family="6"] { --auth-accent: #6d3fd9; }
html[data-family="7"] { --auth-accent: #3341b0; }
html[data-family="8"] { --auth-accent: #0b7fb3; }
@media (prefers-color-scheme: dark) {
	:root {
		--auth-bg: #0d1117;
		--auth-surface: #151b23;
		--auth-text: #e6edf3;
		--auth-muted: #9aa5b1;
		--auth-border: #2d3540;
		--auth-input-bg: #0d1117;
		--auth-danger: #ff8a80;
		--auth-danger-bg: #3a1717;
		--auth-info-bg: #13233d;
		--auth-panel-ink: #05080f;
	}
	html[data-family="7"] { --auth-accent: #8d99ff; --auth-accent-text: #0d1117; }
	html[data-family="6"] { --auth-accent: #a98bff; --auth-accent-text: #110d1c; }
}

*, *::before, *::after {
	box-sizing: border-box;
}
html, body {
	margin: 0;
	min-height: 100%;
}
body.auth {
	background: var(--auth-bg);
	color: var(--auth-text);
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* ---------- casca: formulario + painel da marca ---------- */
.auth-shell {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	min-height: 100vh;
	min-height: 100dvh;
}
@media (min-width: 992px) {
	.auth-shell {
		grid-template-columns: minmax(440px, 1fr) minmax(0, 1.05fr);
	}
}
.auth-main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 32px 20px calc(32px + env(safe-area-inset-bottom, 0px));
}
.auth-card {
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
}
.auth-logo {
	display: block;
	max-width: 180px;
	max-height: 56px;
	margin: 0 0 28px;
	object-fit: contain;
	object-position: left center;
}
.auth-title {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.auth-subtitle {
	margin: 0 0 24px;
	color: var(--auth-muted);
}
.auth-foot {
	margin-top: 28px;
	color: var(--auth-muted);
	font-size: 13px;
}
.auth-foot p {
	margin: 6px 0;
}

/* painel da marca (so no desktop) */
.auth-aside {
	display: none;
}
@media (min-width: 992px) {
	.auth-aside {
		position: relative;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		padding: 56px;
		overflow: hidden;
		color: #fff;
		background:
			radial-gradient(1200px 600px at 110% -10%, color-mix(in srgb, var(--auth-accent) 85%, transparent) 0, transparent 60%),
			radial-gradient(900px 500px at -20% 120%, color-mix(in srgb, var(--auth-accent) 55%, transparent) 0, transparent 55%),
			var(--auth-panel-ink);
	}
	.auth-aside::before {
		content: "";
		position: absolute;
		inset: 0;
		background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
		background-size: 22px 22px;
		mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 70%);
	}
}
.auth-aside__brand {
	position: relative;
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.85;
}
.auth-aside__tagline {
	position: relative;
	max-width: 520px;
	margin: 0 0 24px;
	font-size: clamp(28px, 2.6vw, 40px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
}
.auth-aside__list {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
}
.auth-aside__list li {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	opacity: 0.92;
}
.auth-aside__list i {
	color: color-mix(in srgb, var(--auth-accent) 40%, #ffffff);
}

/* ---------- formulario ---------- */
.auth-form {
	display: grid;
	gap: 16px;
}
.auth-field {
	display: grid;
	gap: 6px;
}
.auth-field label,
.auth-label {
	font-size: 14px;
	font-weight: 600;
}
.auth-field__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}
.auth-input-wrap {
	position: relative;
}
.auth-input {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--auth-border);
	border-radius: 10px;
	background: var(--auth-input-bg);
	color: var(--auth-text);
	font: inherit;
	font-size: 16px; /* evita o zoom do iPhone */
	transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
	outline: 0;
	border-color: var(--auth-accent);
	box-shadow: 0 0 0 4px var(--auth-focus);
}
.auth-input-wrap .auth-input {
	padding-right: 48px;
}
.auth-reveal {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--auth-muted);
	cursor: pointer;
}
.auth-reveal:hover {
	color: var(--auth-text);
}
.auth-reveal:focus-visible,
.auth-link:focus-visible,
.auth-check input:focus-visible {
	outline: 2px solid var(--auth-accent);
	outline-offset: 2px;
}
.auth-hint {
	color: var(--auth-muted);
	font-size: 13px;
}
.auth-capslock {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #b26a00;
	font-size: 13px;
}
.auth-capslock[hidden] {
	display: none;
}
@media (prefers-color-scheme: dark) {
	.auth-capslock {
		color: #f0b45a;
	}
}
.auth-check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	cursor: pointer;
}
.auth-check input {
	width: 18px;
	height: 18px;
	accent-color: var(--auth-accent);
}
.auth-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 48px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s, background-color 0.15s;
}
.auth-btn--primary {
	background: var(--auth-accent);
	color: var(--auth-accent-text);
}
.auth-btn--primary:hover {
	filter: brightness(1.07);
}
.auth-btn--secondary {
	border-color: var(--auth-border);
	background: var(--auth-surface);
	color: var(--auth-text);
}
.auth-btn--secondary:hover {
	background: color-mix(in srgb, var(--auth-text) 5%, var(--auth-surface));
}
.auth-btn:disabled {
	opacity: 0.7;
	cursor: progress;
}
.auth-btn:focus-visible {
	outline: 3px solid var(--auth-focus);
	outline-offset: 2px;
}
.auth-link {
	color: var(--auth-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}
.auth-link:hover {
	text-decoration: underline;
}
.auth-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--auth-muted);
	font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--auth-border);
}
.auth-alert {
	display: flex;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.45;
}
.auth-alert--error {
	background: var(--auth-danger-bg);
	color: var(--auth-danger);
}
.auth-alert--info {
	background: var(--auth-info-bg);
	color: var(--auth-text);
}
.auth-alert i {
	margin-top: 2px;
}
.auth-alt {
	text-align: center;
	color: var(--auth-muted);
	font-size: 14px;
}
.auth-panel[hidden],
.auth-alert[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
