:root {
	color-scheme: light;
	--bg: #f4f4f4;
	--panel: #f4f4f4;
	--text: #00C1CA;
	--muted: #ffffff;
	--accent: #00C1CA;
	--accent-strong: #00C1CA;
	--danger: #f43f5e;
	--border: rgba(15, 23, 42, 0.08);
	--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: 'Roboto', 'Segoe UI', sans-serif;
	background-image: var(--bg);
	color: var(--text);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.auth-shell {
	width: min(1100px, 100%);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 24px;
}

.auth-panel,
.auth-preview {
	background: var(--panel);
	border-radius: 28px;
	padding: 48px;
	box-shadow: var(--shadow);
}

.auth-preview {
	background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.12), transparent 60%), var(--panel);
	display: flex;
	align-items: center;
	justify-content: center;
}

.glass {
	border-radius: 24px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(15, 23, 42, 0.75);
	color: white;
	padding: 32px;
	max-width: 320px;
	text-align: left;
	line-height: 1.5;
}

.glass h2 {
	margin-top: 0;
	font-size: 1.75rem;
}

header {
	margin-bottom: 32px;
}

.eyebrow {
	font-size: 0.7rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 12px;
}

.powered-by {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.powered-by .powered-by-logo {
	height: 18px;
	width: auto;
	display: block;
}

h1 {
	margin: 0;
	font-size: clamp(2rem, 4vw, 2.75rem);
}

.subtitle {
	margin-bottom: 0;
	color: var(--muted);
	margin-top: 12px;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 0.95rem;
	color: var(--muted);
}

.field input,
.field select {
	width: 100%;
	border-radius: 0.5rem;
	background-color: #205E65;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	line-height: 1.25rem;
	color: var(--muted);
}

.field input::placeholder,
.field select::placeholder {
	color: rgba(255, 255, 255, 0.4);
}

.field input:focus,
.field select:focus {
	outline: none;
	background-color: #397075;
	border-color: transparent;
}

.primary {
	border: none;
	border-radius: 18px;
	padding: 14px 18px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	color: white;
	background: linear-gradient(120deg, var(--accent), var(--accent-strong));
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

.ghost {
	border: 1px solid var(--accent-strong);
	border-radius: 18px;
	padding: 12px 18px;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	color: var(--accent-strong);
	background: transparent;
	transition: background 0.2s ease, transform 0.2s ease;
}

.ghost:hover:not(:disabled) {
	transform: translateY(-1px);
	background: rgba(56, 189, 248, 0.08);
}

.ghost:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.muted {
	color: var(--muted);
	margin: 0;
}

.muted a {
	color: var(--accent-strong);
	text-decoration: none;
	font-weight: 500;
}

.auth-legal-links {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 24px;
	font-size: 0.85rem;
}

.auth-legal-links a {
	color: rgba(255, 255, 255, 0.88);
	text-decoration: none;
}

.auth-legal-links a:hover {
	color: var(--accent-strong);
}

.form-feedback {
	border-radius: 16px;
	padding: 14px 16px;
	font-size: 0.95rem;
	line-height: 1.4;
}

.form-feedback.error {
	background: rgba(244, 63, 94, 0.12);
	color: var(--danger);
}

.form-feedback.success {
	background: rgba(16, 185, 129, 0.12);
	color: #059669;
}

.divider {
	border: none;
	border-top: 1px dashed rgba(15, 23, 42, 0.15);
	margin: 32px 0;
}

.small {
	font-size: 0.85rem;
}

@media (max-width: 768px) {
	body {
		padding: 16px;
	}

	.auth-panel,
	.auth-preview {
		padding: 32px 24px;
		border-radius: 24px;
	}

	.glass {
		width: 100%;
	}

	.mfa-secret-actions {
		flex-direction: column;
	}

	.mfa-copy-button {
		width: 100%;
		padding: 14px 16px;
		margin-bottom: 0;
	}
}

body[data-auth-page="login"],
body[data-auth-page="password-reset"],
body[data-auth-page="confirm"],
body[data-auth-page="first-access"],
body[data-auth-page="mfa-totp-enroll"],
body[data-auth-page="mfa-totp-challenge"],
body[data-auth-page="legal"] {
	background: var(--bg);
	background-image: none;
	color: var(--muted);
	font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body[data-auth-page="legal"] {
	align-items: flex-start;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
}

body[data-auth-page="login"] .login-card-wrapper,
body[data-auth-page="password-reset"] .login-card-wrapper,
body[data-auth-page="confirm"] .login-card-wrapper,
body[data-auth-page="first-access"] .login-card-wrapper,
body[data-auth-page="mfa-totp-enroll"] .login-card-wrapper,
body[data-auth-page="mfa-totp-challenge"] .login-card-wrapper {
	width: min(1100px, 100%);
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 0;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 30px 50px rgba(2, 6, 23, 0.55);
}

body[data-auth-page="login"] .login-left,
body[data-auth-page="login"] .login-right,
body[data-auth-page="password-reset"] .login-left,
body[data-auth-page="password-reset"] .login-right,
body[data-auth-page="confirm"] .login-left,
body[data-auth-page="confirm"] .login-right,
body[data-auth-page="first-access"] .login-left,
body[data-auth-page="first-access"] .login-right,
body[data-auth-page="mfa-totp-enroll"] .login-left,
body[data-auth-page="mfa-totp-enroll"] .login-right,
body[data-auth-page="mfa-totp-challenge"] .login-left,
body[data-auth-page="mfa-totp-challenge"] .login-right {
	flex: 1 1 50%;
	min-width: 0;
}

body[data-auth-page="login"] .login-left,
body[data-auth-page="password-reset"] .login-left,
body[data-auth-page="confirm"] .login-left,
body[data-auth-page="first-access"] .login-left,
body[data-auth-page="mfa-totp-enroll"] .login-left,
body[data-auth-page="mfa-totp-challenge"] .login-left {
	background: #074c53;
	padding: 56px 52px;
}

body[data-auth-page="login"] .login-header,
body[data-auth-page="password-reset"] .login-header,
body[data-auth-page="confirm"] .login-header,
body[data-auth-page="first-access"] .login-header,
body[data-auth-page="mfa-totp-enroll"] .login-header,
body[data-auth-page="mfa-totp-challenge"] .login-header {
	margin-bottom: 32px;
}

body[data-auth-page="login"] .login-left .eyebrow,
body[data-auth-page="password-reset"] .login-left .eyebrow,
body[data-auth-page="confirm"] .login-left .eyebrow,
body[data-auth-page="first-access"] .login-left .eyebrow,
body[data-auth-page="mfa-totp-enroll"] .login-left .eyebrow,
body[data-auth-page="mfa-totp-challenge"] .login-left .eyebrow {
	color: var(--muted);
}

body[data-auth-page="login"] .login-left h1,
body[data-auth-page="password-reset"] .login-left h1,
body[data-auth-page="confirm"] .login-left h1,
body[data-auth-page="first-access"] .login-left h1,
body[data-auth-page="mfa-totp-enroll"] .login-left h1,
body[data-auth-page="mfa-totp-challenge"] .login-left h1 {
	color: var(--muted);
}

body[data-auth-page="login"] .login-left .subtitle,
body[data-auth-page="password-reset"] .login-left .subtitle,
body[data-auth-page="confirm"] .login-left .subtitle,
body[data-auth-page="first-access"] .login-left .subtitle,
body[data-auth-page="mfa-totp-enroll"] .login-left .subtitle,
body[data-auth-page="mfa-totp-challenge"] .login-left .subtitle {
	color: rgba(255, 255, 255, 0.72);
}

body[data-auth-page="login"] .login-left .field,
body[data-auth-page="password-reset"] .login-left .field,
body[data-auth-page="confirm"] .login-left .field,
body[data-auth-page="first-access"] .login-left .field,
body[data-auth-page="mfa-totp-enroll"] .login-left .field,
body[data-auth-page="mfa-totp-challenge"] .login-left .field {
	color: rgba(255, 255, 255, 0.8);
}

body[data-auth-page="login"] .login-left .field input,
body[data-auth-page="login"] .login-left .field select,
body[data-auth-page="password-reset"] .login-left .field input,
body[data-auth-page="password-reset"] .login-left .field select,
body[data-auth-page="confirm"] .login-left .field input,
body[data-auth-page="confirm"] .login-left .field select,
body[data-auth-page="first-access"] .login-left .field input,
body[data-auth-page="first-access"] .login-left .field select,
body[data-auth-page="mfa-totp-enroll"] .login-left .field input,
body[data-auth-page="mfa-totp-enroll"] .login-left .field select,
body[data-auth-page="mfa-totp-challenge"] .login-left .field input,
body[data-auth-page="mfa-totp-challenge"] .login-left .field select {
	border: none;
	border-radius: 14px;
}

body[data-auth-page="login"] .login-left .field input:focus,
body[data-auth-page="login"] .login-left .field select:focus,
body[data-auth-page="password-reset"] .login-left .field input:focus,
body[data-auth-page="password-reset"] .login-left .field select:focus,
body[data-auth-page="confirm"] .login-left .field input:focus,
body[data-auth-page="confirm"] .login-left .field select:focus,
body[data-auth-page="first-access"] .login-left .field input:focus,
body[data-auth-page="first-access"] .login-left .field select:focus,
body[data-auth-page="mfa-totp-enroll"] .login-left .field input:focus,
body[data-auth-page="mfa-totp-enroll"] .login-left .field select:focus,
body[data-auth-page="mfa-totp-challenge"] .login-left .field input:focus,
body[data-auth-page="mfa-totp-challenge"] .login-left .field select:focus {
	outline: 2px solid var(--accent);
}

body[data-auth-page="login"] .login-left .primary,
body[data-auth-page="password-reset"] .login-left .primary,
body[data-auth-page="confirm"] .login-left .primary,
body[data-auth-page="first-access"] .login-left .primary,
body[data-auth-page="mfa-totp-enroll"] .login-left .primary,
body[data-auth-page="mfa-totp-challenge"] .login-left .primary {
	box-shadow: 0 12px 28px rgb(0, 193, 202, 0.28);
}

body[data-auth-page="login"] .login-left .primary:hover,
body[data-auth-page="password-reset"] .login-left .primary:hover,
body[data-auth-page="confirm"] .login-left .primary:hover,
body[data-auth-page="first-access"] .login-left .primary:hover,
body[data-auth-page="mfa-totp-enroll"] .login-left .primary:hover,
body[data-auth-page="mfa-totp-challenge"] .login-left .primary:hover {
	box-shadow: 0 16px 34px rgb(0, 193, 202, 0.38);
}

body[data-auth-page="login"] .login-right,
body[data-auth-page="password-reset"] .login-right,
body[data-auth-page="confirm"] .login-right,
body[data-auth-page="first-access"] .login-right,
body[data-auth-page="mfa-totp-enroll"] .login-right,
body[data-auth-page="mfa-totp-challenge"] .login-right {
	position: relative;
	background-image: url('../../img/fundo-card.png');
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 52px;
}

body[data-auth-page="login"] .login-right::before,
body[data-auth-page="password-reset"] .login-right::before,
body[data-auth-page="confirm"] .login-right::before,
body[data-auth-page="first-access"] .login-right::before,
body[data-auth-page="mfa-totp-enroll"] .login-right::before,
body[data-auth-page="mfa-totp-challenge"] .login-right::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(23, 2, 2, 0.55);
}

body[data-auth-page="login"] .login-hero-content,
body[data-auth-page="password-reset"] .login-hero-content,
body[data-auth-page="confirm"] .login-hero-content,
body[data-auth-page="first-access"] .login-hero-content,
body[data-auth-page="mfa-totp-enroll"] .login-hero-content,
body[data-auth-page="mfa-totp-challenge"] .login-hero-content {
	position: relative;
	z-index: 1;
	color: var(--muted);
	text-align: center;
	max-width: 380px;
}

body[data-auth-page="login"] .login-hero-content h2,
body[data-auth-page="password-reset"] .login-hero-content h2,
body[data-auth-page="confirm"] .login-hero-content h2,
body[data-auth-page="first-access"] .login-hero-content h2,
body[data-auth-page="mfa-totp-enroll"] .login-hero-content h2,
body[data-auth-page="mfa-totp-challenge"] .login-hero-content h2 {
	margin: 0 0 12px;
	font-size: clamp(1.75rem, 3vw, 2.25rem);
}

body[data-auth-page="login"] .login-hero-content p,
body[data-auth-page="password-reset"] .login-hero-content p,
body[data-auth-page="confirm"] .login-hero-content p,
body[data-auth-page="first-access"] .login-hero-content p,
body[data-auth-page="mfa-totp-enroll"] .login-hero-content p,
body[data-auth-page="mfa-totp-challenge"] .login-hero-content p {
	margin: 0;
	color: rgba(255, 255, 255, 0.9);
	line-height: 1.5;
}

.mfa-panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 24px;
}

.mfa-qr-shell {
	background: transparent;
	border: none;
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mfa-qr-placeholder {
	text-align: center;
	color: rgba(255, 255, 255, 0.76);
	line-height: 1.5;
}

.mfa-qr-image {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mfa-qr-image svg,
.mfa-qr-image img {
	max-width: min(100%, 240px);
	height: auto;
	display: block;
	background: white;
	border-radius: 18px;
}

.mfa-secret-block {
	background: transparent;
	border: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 0;
}

.mfa-secret {
	display: block;
	padding: 14px 16px;
	border-radius: 14px;
	background: rgba(2, 6, 23, 0.28);
	color: white;
	overflow-wrap: anywhere;
	font-size: 0.92rem;
	min-width: 0;
	margin-bottom: 0;
}

.mfa-secret-actions {
	display: flex;
	align-items: stretch;
	gap: 12px;
	margin-bottom: 0;
}

.mfa-secret-actions .mfa-secret {
	flex: 1 1 auto;
}

.mfa-copy-button {
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 14px;
	padding: 0 16px;
	min-height: 52px;
	background: rgba(7, 76, 83, 0.82);
	color: #f8fafc;
	font: inherit;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
	margin-bottom: 0;
}

.mfa-copy-button svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	margin-bottom: 0;
}

.mfa-copy-button:hover:not(:disabled),
.mfa-copy-button:focus-visible:not(:disabled) {
	background: rgba(11, 115, 124, 0.96);
	border-color: rgba(255, 255, 255, 0.3);
	transform: translateY(-1px);
}

.mfa-copy-button:focus-visible {
	outline: 2px solid rgba(125, 211, 252, 0.95);
	outline-offset: 2px;
}

.mfa-copy-button:disabled {
	opacity: 0.62;
	cursor: not-allowed;
}

.mfa-support-box {
	margin-top: 12px;
	padding: 16px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mfa-hero-content {
	max-width: 420px;
}

.legal-shell {
	width: min(1180px, 100%);
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
	gap: 24px;
}

.legal-shell--single {
	max-width: 960px;
	grid-template-columns: minmax(0, 1fr);
}

.legal-panel,
.legal-sidebar {
	border-radius: 18px;
	box-shadow: 0 30px 50px rgba(2, 6, 23, 0.28);
	overflow: hidden;
}

.legal-panel {
	background: #074c53;
	padding: 56px 52px;
	color: var(--muted);
	min-width: 0;
}

.legal-panel .login-header {
	margin-bottom: clamp(20px, 3vw, 32px);
}

.legal-panel .login-header h1 {
	margin: 0;
	font-size: clamp(1.9rem, 4.6vw, 3.15rem);
	line-height: 1.02;
	text-wrap: balance;
}

.legal-panel .login-header .subtitle {
	margin-top: 6px;
	max-width: 62ch;
	font-size: clamp(0.98rem, 1.5vw, 1.08rem);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.76);
	text-wrap: pretty;
	overflow-wrap: anywhere;
}

.legal-sidebar {
	background-image: url('../../img/fundo-card.png');
	background-size: cover;
	background-position: center;
	position: relative;
	padding: 32px;
	display: flex;
	align-items: stretch;
}

.legal-sidebar::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(23, 2, 2, 0.68);
}

.legal-sidebar-content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	color: var(--muted);
}

.legal-side-card {
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 18px;
	padding: 20px;
	background: rgba(7, 76, 83, 0.34);
	backdrop-filter: blur(10px);
}

.legal-side-card h2 {
	margin: 0 0 10px;
	font-size: 1.25rem;
	color: var(--muted);
}

.legal-side-card p {
	margin: 0;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.82);
}

.legal-meta {
	margin: 0;
	font-size: clamp(0.72rem, 1.5vw, 0.85rem);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
}

.legal-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 20px;
	flex-wrap: wrap;
	margin: 0 0 28px;
}

.legal-content {
	display: flex;
	flex-direction: column;
	gap: clamp(18px, 2.8vw, 24px);
	line-height: 1.72;
	color: rgba(255, 255, 255, 0.92);
	min-width: 0;
}

.legal-content section {
	display: flex;
	flex-direction: column;
	gap: clamp(10px, 1.8vw, 14px);
	padding-top: clamp(16px, 2.2vw, 20px);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-content h2 {
	margin: 0;
	font-size: clamp(1.02rem, 1.8vw, 1.18rem);
	line-height: 1.3;
	color: var(--muted);
	text-wrap: balance;
}

.legal-content p,
.legal-content ul {
	margin: 0;
	max-width: 68ch;
	font-size: clamp(0.96rem, 1.35vw, 1rem);
	overflow-wrap: anywhere;
	text-wrap: pretty;
}

.legal-content ul {
	padding-left: 1.15rem;
	color: rgba(255, 255, 255, 0.88);
}

.legal-content li + li {
	margin-top: 8px;
}

.legal-links {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 0;
}

.legal-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 10px 14px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--muted);
	text-decoration: none;
	font-weight: 500;
}

.legal-links a:hover {
	color: var(--accent-strong);
}

@media (max-width: 900px) {
	body[data-auth-page="login"] .login-card-wrapper,
	body[data-auth-page="password-reset"] .login-card-wrapper,
	body[data-auth-page="confirm"] .login-card-wrapper,
	body[data-auth-page="first-access"] .login-card-wrapper {
		flex-direction: column;
	}

	body[data-auth-page="login"] .login-left,
	body[data-auth-page="login"] .login-right,
	body[data-auth-page="password-reset"] .login-left,
	body[data-auth-page="password-reset"] .login-right,
	body[data-auth-page="confirm"] .login-left,
	body[data-auth-page="confirm"] .login-right,
	body[data-auth-page="first-access"] .login-left,
	body[data-auth-page="first-access"] .login-right {
		flex-basis: auto;
	}

	.legal-shell {
		grid-template-columns: 1fr;
	}

	.legal-panel,
	.legal-sidebar {
		padding: 32px 24px;
	}

	.legal-content p,
	.legal-content ul {
		max-width: 62ch;
	}
}

@media (max-width: 640px) {
	body[data-auth-page="legal"] {
		padding: 12px;
	}

	.legal-panel {
		padding: 28px 18px;
		border-radius: 16px;
	}

	.legal-toolbar {
		align-items: flex-start;
		margin-bottom: 22px;
	}

	.legal-meta {
		width: 100%;
	}

	.legal-links {
		width: 100%;
		flex-direction: column;
	}

	.legal-links a {
		width: 100%;
	}

	.legal-content {
		gap: 18px;
		line-height: 1.68;
	}

	.legal-content section {
		padding-top: 16px;
	}

	.legal-content p,
	.legal-content ul {
		max-width: 100%;
		font-size: 0.95rem;
	}

	.legal-content ul {
		padding-left: 1rem;
	}
}