/**
 * UDS Auth — layout premium split-screen (login, cadastro, recuperação)
 * Depende de user-design-system.css (--uds-* tokens)
 */

.uds-auth-body {
	--auth-input-h: 2.625rem;
	--auth-radius: 0.75rem;
	--auth-gap: 0.9375rem;
	--auth-label: 0.8125rem;
	--auth-text: 0.875rem;
	--auth-small: 0.75rem;
	--auth-primary: #4f46e5;
	--auth-primary-2: #7c3aed;

	margin: 0;
	min-height: 100vh;
	font-family: var(--uds-font-sans, 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	font-size: var(--auth-text);
	background: var(--uds-bg, #f1f5f9);
	color: var(--uds-text, #0f172a);
	-webkit-font-smoothing: antialiased;
	position: relative;
	overflow-x: hidden;
}

.dark .uds-auth-body {
	background: var(--uds-bg, #0b1220);
	color: var(--uds-text, #f8fafc);
}

/* ─── Fundo animado ─────────────────────────────────── */
.uds-auth-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

.uds-auth-bg__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(79, 70, 229, 0.05) 1px, transparent 1px);
	background-size: 44px 44px;
	mask-image: radial-gradient(ellipse 85% 75% at 50% 0%, black, transparent);
}

.dark .uds-auth-bg__grid {
	background-image:
		linear-gradient(rgba(99, 102, 241, 0.07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(99, 102, 241, 0.07) 1px, transparent 1px);
}

.uds-auth-bg__orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(90px);
	opacity: 0.5;
	animation: uds-auth-float 18s ease-in-out infinite alternate;
}

.uds-auth-bg__orb--1 {
	width: 420px;
	height: 420px;
	background: #6366f1;
	top: -140px;
	left: -100px;
}

.uds-auth-bg__orb--2 {
	width: 380px;
	height: 380px;
	background: #a855f7;
	bottom: -120px;
	right: -80px;
	animation-delay: -6s;
}

@keyframes uds-auth-float {
	from { transform: translate(0, 0) scale(1); }
	to { transform: translate(24px, 16px) scale(1.06); }
}

.uds-auth-topbar {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 30;
	padding: 1rem 1.25rem;
}

.uds-auth-theme-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.75rem;
	border: 1px solid var(--uds-border, #e2e8f0);
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(10px);
	color: var(--uds-text-muted, #64748b);
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.dark .uds-auth-theme-btn {
	background: rgba(15, 23, 42, 0.65);
	border-color: rgba(148, 163, 184, 0.2);
}

.uds-auth-theme-btn:hover {
	color: var(--auth-primary);
	border-color: rgba(79, 70, 229, 0.35);
	transform: translateY(-1px);
}

.uds-auth-theme-icon--dark { display: none; }
.dark .uds-auth-theme-icon--light { display: none; }
.dark .uds-auth-theme-icon--dark { display: inline; }

/* ─── Shell split ───────────────────────────────────── */
.uds-auth-shell {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: grid;
	grid-template-columns: 1fr;
}

@media (min-width: 960px) {
	.uds-auth-shell {
		grid-template-columns: minmax(320px, 1fr) minmax(380px, 520px);
	}
}

.uds-auth-hero {
	display: none;
	padding: 2.5rem 2.75rem;
	background:
		linear-gradient(145deg, rgba(79, 70, 229, 0.92) 0%, rgba(124, 58, 237, 0.88) 55%, rgba(168, 85, 247, 0.82) 100%);
	color: #fff;
	position: relative;
	overflow: hidden;
}

.uds-auth-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 20% 80%, rgba(255,255,255,0.12), transparent 45%),
		radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08), transparent 40%);
	pointer-events: none;
}

@media (min-width: 960px) {
	.uds-auth-hero {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		min-height: 100vh;
	}
}

.uds-auth-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 28rem;
}

.uds-auth-hero__brand {
	margin-bottom: 2rem;
}

.uds-auth-hero__logo {
	max-height: 48px;
	max-width: 180px;
	object-fit: contain;
	filter: brightness(0) invert(1);
	margin-bottom: 0.75rem;
}

.uds-auth-hero__icon {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.18);
	backdrop-filter: blur(8px);
	font-size: 1.25rem;
	margin-bottom: 0.75rem;
}

.uds-auth-hero__app {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.85;
}

.uds-auth-hero__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: -0.03em;
}

.uds-auth-hero__text {
	margin: 0 0 1.75rem;
	font-size: 0.9375rem;
	line-height: 1.55;
	opacity: 0.9;
}

.uds-auth-hero__features {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
}

.uds-auth-hero__features li {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: 0.875rem;
	line-height: 1.45;
}

.uds-auth-hero__feat-icon {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	border-radius: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.16);
	font-size: 0.8125rem;
}

.uds-auth-hero__copy {
	position: relative;
	z-index: 1;
	margin: 2rem 0 0;
	font-size: 0.75rem;
	opacity: 0.7;
}

.uds-auth-main {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	min-height: 100vh;
}

.uds-auth-card {
	width: 100%;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(16px);
	border: 1px solid rgba(226, 232, 240, 0.9);
	border-radius: 1.25rem;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 20px 50px rgba(15, 23, 42, 0.1);
	padding: 1.625rem 1.5rem 1.25rem;
}

.dark .uds-auth-card {
	background: rgba(17, 24, 39, 0.82);
	border-color: rgba(148, 163, 184, 0.14);
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.25),
		0 20px 50px rgba(0, 0, 0, 0.4);
}

.uds-auth-brand {
	text-align: center;
	margin-bottom: 1.25rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--uds-border, #e2e8f0);
}

.uds-auth-logo--mobile {
	display: block;
}

@media (min-width: 960px) {
	.uds-auth-logo--mobile {
		display: none;
	}
}

.uds-auth-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0 auto 0.625rem;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--auth-primary);
	background: rgba(79, 70, 229, 0.1);
	border: 1px solid rgba(79, 70, 229, 0.18);
}

.uds-auth-logo {
	max-height: 42px;
	max-width: 160px;
	object-fit: contain;
	margin: 0 auto 0.625rem;
	display: block;
}

.uds-auth-brand-icon {
	width: 48px;
	height: 48px;
	margin: 0 auto 0.625rem;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--uds-gradient-primary, linear-gradient(135deg, #4f46e5, #7c3aed));
	color: #fff;
	font-size: 1.125rem;
	box-shadow: 0 6px 20px rgba(79, 70, 229, 0.28);
}

.uds-auth-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.uds-auth-subtitle {
	margin: 0.3rem 0 0;
	font-size: var(--auth-small);
	color: var(--uds-text-muted, #64748b);
	line-height: 1.4;
}

.uds-auth-content {
	display: flex;
	flex-direction: column;
	gap: var(--auth-gap);
}

.uds-auth-form {
	display: flex;
	flex-direction: column;
	gap: var(--auth-gap);
}

/* ─── Campos ─────────────────────────────────────────── */
.uds-auth-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.uds-auth-field label {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	font-size: var(--auth-label);
	font-weight: 600;
	color: var(--uds-text-muted, #64748b);
	line-height: 1.3;
}

.uds-auth-field label i {
	font-size: 0.75rem;
	color: var(--uds-primary-500, #6366f1);
	width: 0.875rem;
	text-align: center;
	flex-shrink: 0;
}

.uds-auth-body .uds-input {
	width: 100%;
	min-height: var(--auth-input-h);
	height: var(--auth-input-h);
	padding: 0 0.875rem;
	font-size: var(--auth-text);
	line-height: 1.25;
	border-radius: var(--auth-radius);
	border-width: 1px;
}

.uds-auth-input-wrap {
	position: relative;
}

.uds-auth-input-wrap .uds-input {
	padding-right: 2.375rem;
}

.uds-auth-toggle-pw {
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	min-width: 2rem;
	min-height: 2rem;
	border: 0;
	border-radius: 0.375rem;
	background: transparent;
	color: var(--uds-text-muted, #94a3b8);
	cursor: pointer;
	font-size: 0.8125rem;
	transition: color 0.15s, background 0.15s;
}

.uds-auth-toggle-pw:hover {
	color: var(--uds-primary-600, #4f46e5);
	background: rgba(99, 102, 241, 0.08);
}

/* ─── Botões (escopo auth) ───────────────────────────── */
.uds-auth-body .uds-btn {
	min-height: var(--auth-input-h);
	height: var(--auth-input-h);
	padding: 0 1rem;
	font-size: var(--auth-text);
	font-weight: 700;
	border-radius: var(--auth-radius);
	gap: 0.4rem;
	box-shadow: none;
}

.uds-auth-body .uds-btn--primary {
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}

.uds-auth-body .uds-btn--primary:hover {
	filter: brightness(1.04);
	transform: translateY(-1px);
}

.uds-auth-body .uds-btn--sm {
	min-height: 2.125rem;
	height: 2.125rem;
	padding: 0 0.75rem;
	font-size: var(--auth-small);
}

.uds-auth-btn-block {
	width: 100%;
	justify-content: center;
}

.uds-auth-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	font-size: var(--auth-small);
	margin-top: -0.125rem;
}

.uds-auth-check {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	cursor: pointer;
	color: var(--uds-text-muted, #64748b);
	user-select: none;
}

.uds-auth-check input[type="checkbox"] {
	width: 0.9375rem;
	height: 0.9375rem;
	margin: 0;
	accent-color: var(--uds-primary-600, #4f46e5);
	cursor: pointer;
	flex-shrink: 0;
}

.uds-auth-link {
	color: var(--uds-primary-600, #4f46e5);
	text-decoration: none;
	font-weight: 600;
	font-size: inherit;
}

.uds-auth-link:hover {
	text-decoration: underline;
}

/* ─── Social / Google ───────────────────────────────── */
.uds-auth-social {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.uds-auth-google-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	width: 100%;
	min-height: var(--auth-input-h);
	padding: 0 1rem;
	border-radius: var(--auth-radius);
	border: 1px solid var(--uds-border, #e2e8f0);
	background: var(--uds-surface, #fff);
	color: var(--uds-text, #0f172a);
	font-size: var(--auth-text);
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dark .uds-auth-google-btn {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(148, 163, 184, 0.2);
	color: var(--uds-text, #f8fafc);
}

.uds-auth-google-btn:hover {
	border-color: rgba(66, 133, 244, 0.45);
	box-shadow: 0 4px 16px rgba(66, 133, 244, 0.12);
	transform: translateY(-1px);
	text-decoration: none;
}

.uds-auth-google-icon {
	width: 1.125rem;
	height: 1.125rem;
	flex-shrink: 0;
}

.uds-auth-divider {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--uds-text-muted, #94a3b8);
	font-size: var(--auth-small);
	margin: 0.25rem 0;
}

.uds-auth-divider::before,
.uds-auth-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--uds-border, #e2e8f0);
}

.uds-auth-foot {
	margin-top: 1rem;
	padding-top: 0.875rem;
	border-top: 1px solid var(--uds-border, #e2e8f0);
	text-align: center;
}

.uds-auth-foot-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: var(--auth-small);
	color: var(--uds-text-muted, #64748b);
	text-decoration: none;
	transition: color 0.15s;
}

.uds-auth-foot-link:hover {
	color: var(--uds-primary-600, #4f46e5);
}

.uds-auth-tg {
	border-color: rgba(0, 136, 204, 0.35) !important;
	color: #0088cc !important;
	background: rgba(0, 136, 204, 0.06) !important;
}

.uds-auth-tg:hover {
	background: rgba(0, 136, 204, 0.12) !important;
}

.uds-auth-hint {
	font-size: var(--auth-small);
	color: var(--uds-text-muted, #94a3b8);
	text-align: center;
	margin: -0.25rem 0 0;
	line-height: 1.35;
}

.uds-auth-center-text {
	text-align: center;
	font-size: var(--auth-small);
	color: var(--uds-text-muted, #64748b);
	margin: 0;
	line-height: 1.4;
}

.uds-auth-extras {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.75rem;
	border-radius: var(--auth-radius);
	background: var(--uds-surface-2, #f8fafc);
	border: 1px solid var(--uds-border, #e2e8f0);
}

.dark .uds-auth-extras {
	background: rgba(255, 255, 255, 0.03);
}

.uds-auth-extras__title {
	margin: 0;
	font-size: var(--auth-small);
	font-weight: 700;
	color: var(--uds-text-muted, #64748b);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* ─── Alerts no auth ─────────────────────────────────── */
.uds-auth-body .uds-alert {
	margin-bottom: 0;
	padding: 0.625rem 0.75rem;
	font-size: var(--auth-small);
	line-height: 1.4;
	border-radius: var(--auth-radius);
}

.uds-auth-body .uds-alert i {
	font-size: 0.875rem;
	flex-shrink: 0;
}

.hidden {
	display: none !important;
}

.uds-auth-required {
	color: var(--uds-danger, #ef4444);
	font-weight: 700;
}

.uds-auth-optional {
	font-weight: 500;
	color: var(--uds-text-muted, #94a3b8);
	font-size: var(--auth-small);
}

.uds-auth-grid-2 {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--auth-gap);
}

@media (min-width: 520px) {
	.uds-auth-grid-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.uds-auth-section {
	padding-top: 0.75rem;
	margin-top: 0.125rem;
	border-top: 1px solid var(--uds-border, #e2e8f0);
}

.uds-auth-input-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: stretch;
}

.uds-auth-input-row .uds-input {
	flex: 1;
	min-width: 7.5rem;
}

.uds-auth-input-row .uds-btn {
	flex-shrink: 0;
	white-space: nowrap;
}

.uds-auth-callout {
	margin-top: 0.5rem;
	padding: 0.625rem 0.75rem;
	border-radius: var(--auth-radius);
	font-size: var(--auth-small);
	line-height: 1.45;
	color: var(--uds-text-muted, #64748b);
	background: var(--uds-info-bg, #eff6ff);
	border: 1px solid rgba(59, 130, 246, 0.18);
}

.uds-auth-callout i {
	color: var(--uds-info, #3b82f6);
	margin-right: 0.25rem;
}

.uds-auth-callout a {
	color: var(--uds-primary-600, #4f46e5);
	font-weight: 600;
	text-decoration: none;
}

.uds-auth-callout a:hover {
	text-decoration: underline;
}

.uds-auth-strength {
	display: flex;
	gap: 3px;
	margin-top: 0.25rem;
}

.uds-auth-strength span {
	flex: 1;
	height: 3px;
	border-radius: 999px;
	background: var(--uds-border, #e2e8f0);
	transition: background 0.2s;
}

.uds-auth-strength span.is-weak { background: #f87171; }
.uds-auth-strength span.is-fair { background: #fbbf24; }
.uds-auth-strength span.is-good { background: #34d399; }
.uds-auth-strength span.is-strong { background: #22c55e; }

.uds-auth-strength-text {
	margin: 0.25rem 0 0;
	font-size: var(--auth-small);
	color: var(--uds-text-muted, #94a3b8);
}

.uds-auth-strength-text.is-weak { color: #dc2626; }
.uds-auth-strength-text.is-fair { color: #d97706; }
.uds-auth-strength-text.is-good { color: #059669; }
.uds-auth-strength-text.is-strong { color: #16a34a; }

.uds-auth-match-ok {
	margin-top: 0.25rem;
	font-size: var(--auth-small);
	color: var(--uds-success, #10b981);
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.uds-auth-field-error {
	margin-top: 0.25rem;
	font-size: var(--auth-small);
	color: var(--uds-danger, #ef4444);
	display: flex;
	align-items: flex-start;
	gap: 0.3rem;
	line-height: 1.35;
}

@media (min-width: 480px) {
	.uds-auth-card {
		padding: 1.75rem 1.625rem 1.25rem;
	}

	.uds-auth-title {
		font-size: 1.3125rem;
	}
}

@media (max-width: 380px) {
	.uds-auth-page {
		padding: 0.875rem;
	}

	.uds-auth-card {
		padding: 1.25rem 1.125rem 1rem;
	}
}
