/* Telas de conta (criação, confirmações). Mesmo visual do login do Keycloak (keycloak-themes/muven/login).
   Escopado em .auth para não afetar as outras rotas. Tokens iguais aos de landing.css. */

.auth {
	--ink: #2a1a2d;
	--ink-deep: #1c0f1e;
	--ink-soft: #4f4452;
	--muted: #7d7280;
	--line: #e8e3ea;
	--line-strong: #d9cfdb;
	--line-hover: #c4b3c6;
	--bg: #faf8fa;
	--surface: #ffffff;
	--tint: #f4f0f5;
	--brand: #89138a;
	--brand-2: #9c459d;
	--brand-dark: #6a0e6b;
	--brand-light: #e7c3e8;
	--aurora: linear-gradient(135deg, #9c459d 0%, #89138a 55%, #6a0e6b 100%);
	--aurora-light: linear-gradient(110deg, #f3d6f3 0%, #d79ad8 55%, #b866b9 100%);
	--danger: #c8234a;
	--ring: 0 0 0 4px rgba(137, 19, 138, .16);
	--radius: 14px;
	--shadow-card: 0 1px 2px rgba(42, 26, 45, .04), 0 24px 60px -24px rgba(42, 26, 45, .22);
	--font-display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
	--font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--ease: cubic-bezier(.2, .7, .2, 1);

	min-height: 100vh;
	min-height: 100dvh;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}

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

/* ---------- Formulário ---------- */

.auth .auth-form {
	display: grid;
	gap: 20px;
}

.auth .auth-row {
	display: grid;
	gap: 20px;
}

@media (min-width: 480px) {
	.auth .auth-row {
		grid-template-columns: 1fr 1fr;
		gap: 16px;
	}
}

.auth .auth-field {
	display: grid;
	gap: 8px;
}

.auth .auth-label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
}

.auth .auth-label small {
	font-size: 13px;
	font-weight: 500;
	color: var(--muted);
}

.auth .auth-input {
	width: 100%;
	height: 54px;
	margin: 0;
	padding: 0 16px;
	border-radius: var(--radius);
	border: 1.5px solid var(--line-strong);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	font-size: 16px;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.auth .auth-input::placeholder {
	color: #b0a6b2;
}

.auth .auth-input:hover {
	border-color: var(--line-hover);
}

.auth .auth-input:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: var(--ring);
}

.auth .auth-input[aria-invalid="true"] {
	border-color: var(--danger);
	background: #fffafb;
}

.auth .auth-input[aria-invalid="true"]:focus {
	box-shadow: 0 0 0 4px rgba(200, 35, 74, .14);
}

.auth .auth-input:disabled {
	background: var(--bg);
	color: var(--muted);
}

.auth .auth-input:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 40px #fff inset;
	-webkit-text-fill-color: var(--ink);
}

.auth .auth-hint {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 13px;
	color: var(--muted);
}

.auth .auth-hint-error {
	color: var(--danger);
	font-weight: 600;
	animation: auth-fade .25s var(--ease) both;
}

.auth .auth-hint svg {
	width: 14px;
	height: 14px;
	flex: none;
}

/* ---------- Botões ---------- */

.auth .auth-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 54px;
	margin: 0;
	padding: 0 26px;
	border-radius: 999px;
	border: 1.5px solid transparent;
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: transform .2s var(--ease), box-shadow .2s ease, background-position .5s ease, background-color .2s ease, border-color .2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.auth .auth-btn:hover {
	text-decoration: none;
}

.auth .auth-btn-primary,
.auth .auth-btn-primary:visited {
	margin-top: 4px;
	background: linear-gradient(110deg, #6a0e6b 0%, #89138a 35%, #9c459d 65%, #89138a 100%);
	background-size: 220% 100%;
	background-position: 0% 50%;
	color: #fff;
	box-shadow: 0 12px 28px -12px rgba(137, 19, 138, .7);
}

.auth .auth-btn-primary:hover {
	background-position: 60% 50%;
	box-shadow: 0 18px 34px -14px rgba(137, 19, 138, .8);
	transform: translateY(-1px);
	color: #fff;
}

.auth .auth-btn-primary:active {
	background-color: transparent;
	transform: translateY(0) scale(.99);
}

.auth .auth-btn-ghost,
.auth .auth-btn-ghost:visited {
	background: #fff;
	color: var(--ink);
	border-color: var(--line-strong);
}

.auth .auth-btn-ghost:hover {
	border-color: var(--line-hover);
	background: var(--tint);
	color: var(--ink);
}

.auth .auth-btn-arrow {
	width: 18px;
	height: 18px;
	transition: transform .25s var(--ease);
}

.auth .auth-btn-primary:hover .auth-btn-arrow {
	transform: translateX(4px);
}

.auth .auth-spinner {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2.5px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	animation: auth-spin .7s linear infinite;
}

.auth .auth-btn[aria-busy="true"] {
	cursor: progress;
	transform: none;
}

.auth .auth-btn:disabled:not([aria-busy="true"]) {
	opacity: .55;
	cursor: not-allowed;
}

/* ---------- Links e foco ---------- */

.auth a {
	color: var(--brand);
}

.auth .auth-link,
.auth .auth-link:visited {
	color: var(--brand);
	font-weight: 700;
	text-decoration: none;
	border-radius: 4px;
}

.auth .auth-link:hover {
	color: var(--brand-dark);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.auth a:focus-visible,
.auth button:focus-visible {
	outline: 3px solid rgba(137, 19, 138, .45);
	outline-offset: 3px;
}

.auth .auth-footnote {
	margin: 28px 0 0;
	padding-top: 22px;
	border-top: 1px solid var(--line);
	text-align: center;
	font-size: 15px;
	color: var(--ink-soft);
}

/* ---------- Estados de resultado (sucesso, erro, carregando) ---------- */

.auth .auth-result {
	display: grid;
	justify-items: center;
	gap: 12px;
	text-align: center;
	animation: auth-rise .6s var(--ease) both;
}

.auth .auth-result:focus {
	outline: none;
}

.auth .auth-result-icon {
	width: 68px;
	height: 68px;
	display: grid;
	place-items: center;
	border-radius: 22px;
	background: var(--aurora);
	color: #fff;
	box-shadow: 0 16px 30px -14px rgba(137, 19, 138, .75);
}

.auth .auth-result-icon svg {
	width: 32px;
	height: 32px;
}

.auth .auth-result-icon-error {
	background: linear-gradient(135deg, #e24d6f, #b3183d);
	box-shadow: 0 16px 30px -14px rgba(200, 35, 74, .6);
}

.auth .auth-result-icon-loading {
	background: var(--tint);
	box-shadow: none;
	color: var(--brand);
}

.auth .auth-result-icon-loading .auth-spinner {
	width: 30px;
	height: 30px;
	border-width: 3px;
	border-color: rgba(137, 19, 138, .2);
	border-top-color: var(--brand);
}

.auth .auth-result-title {
	margin: 8px 0 0;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(24px, 2.4vw, 30px);
	line-height: 1.1;
	letter-spacing: -.03em;
	color: var(--ink);
	text-wrap: balance;
}

.auth .auth-result-title::after {
	display: none;
}

.auth .auth-result-text {
	margin: 0 0 8px;
	max-width: 40ch;
	color: var(--ink-soft);
	overflow-wrap: anywhere;
	text-wrap: pretty;
}

.auth .auth-result .auth-btn {
	margin-top: 8px;
}

.auth .auth-steps {
	list-style: none;
	margin: 4px 0 8px;
	padding: 16px 18px;
	width: 100%;
	display: grid;
	gap: 12px;
	text-align: left;
	background: var(--tint);
	border-radius: 18px;
	counter-reset: step;
}

.auth .auth-steps li {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	align-items: start;
	font-size: 15px;
	color: var(--ink-soft);
	counter-increment: step;
}

.auth .auth-steps li::before {
	content: counter(step);
	width: 24px;
	height: 24px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--aurora);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.auth .auth-steps strong {
	color: var(--ink);
}

@keyframes auth-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes auth-rise {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

@keyframes auth-fade {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

@media (prefers-reduced-motion: reduce) {

	.auth *,
	.auth *::before,
	.auth *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		animation-delay: 0s !important;
		transition-duration: .001ms !important;
	}
}
