/* Telas públicas de autenticação: login (login/access_2) e cadastro de empresa (login/cadastro).
   Paleta do ERP (Metronic): primary #3699FF, dark #181C32. Ver docs/frontend/CADASTRO-EMPRESA.md */
:root {
	--auth-primary: #3699FF;
	--auth-primary-hover: #187DE4;
	--auth-primary-light: #E1F0FF;
	--auth-dark: #181C32;
	--auth-dark-2: #1E1E2D;
	--auth-text: #3F4254;
	--auth-muted: #7E8299;
	--auth-border: #E4E6EF;
	--auth-bg: #F3F6F9;
	--auth-success: #1BC5BD;
	--auth-success-light: #C9F7F5;
	--auth-danger: #F64E60;
	--auth-danger-light: #FFE2E5;
	--auth-warning: #FFA800;
	--auth-warning-light: #FFF4DE;
	--auth-radius: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.auth-body {
	margin: 0;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	color: var(--auth-text);
	background: var(--auth-bg);
	-webkit-font-smoothing: antialiased;
}

a { color: var(--auth-primary); }
a:hover { color: var(--auth-primary-hover); text-decoration: none; }

/* ---------- Estrutura ---------- */
.auth-shell {
	display: flex;
	min-height: 100vh;
}

.auth-aside {
	position: relative;
	flex: 0 0 40%;
	max-width: 520px;
	padding: 48px 48px 32px;
	color: #fff;
	background: linear-gradient(160deg, var(--auth-dark) 0%, var(--auth-dark-2) 60%, #1B2B4B 100%);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.auth-aside::before,
.auth-aside::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(54, 153, 255, .35) 0%, rgba(54, 153, 255, 0) 70%);
	pointer-events: none;
}
.auth-aside::before { width: 420px; height: 420px; top: -140px; right: -160px; }
.auth-aside::after { width: 360px; height: 360px; bottom: -160px; left: -140px; opacity: .6; }

.auth-aside > * { position: relative; z-index: 1; }

.auth-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: .2px;
	color: #fff;
}
.auth-brand img { max-height: 44px; max-width: 180px; }
.auth-brand-mark {
	width: 40px; height: 40px;
	border-radius: 10px;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--auth-primary);
	font-size: 18px;
}

.auth-hero { margin-top: 56px; }
.auth-hero h1 {
	font-size: 28px;
	line-height: 1.3;
	font-weight: 700;
	margin: 0 0 12px;
	color: #fff;
}
.auth-hero p { color: rgba(255, 255, 255, .7); font-size: 15px; margin: 0 0 28px; }

.auth-benefits { list-style: none; padding: 0; margin: 0; }
.auth-benefits li {
	display: flex; align-items: flex-start; gap: 12px;
	margin-bottom: 14px;
	color: rgba(255, 255, 255, .88);
}
.auth-benefits i {
	flex: 0 0 22px; height: 22px;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 11px;
	color: #fff;
	background: rgba(54, 153, 255, .9);
	margin-top: 1px;
}

.auth-plan-summary {
	margin-top: 32px;
	padding: 18px 20px;
	border-radius: var(--auth-radius);
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .12);
	backdrop-filter: blur(4px);
	transition: opacity .25s ease;
}
.auth-plan-summary small { text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, .55); font-size: 11px; }
.auth-plan-summary .plan-name { font-size: 18px; font-weight: 600; margin: 2px 0 0; }
.auth-plan-summary .plan-price { font-size: 26px; font-weight: 700; color: #fff; }
.auth-plan-summary .plan-price span { font-size: 13px; font-weight: 400; color: rgba(255, 255, 255, .6); }
.auth-plan-summary .plan-trial { color: #7EC2FF; font-size: 13px; margin-top: 4px; }

.auth-aside-footer {
	margin-top: auto;
	padding-top: 32px;
	font-size: 13px;
	color: rgba(255, 255, 255, .55);
}
.auth-aside-footer a { color: rgba(255, 255, 255, .85); }
.auth-aside-footer a:hover { color: #fff; }

.auth-main {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
}

.auth-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 40px;
}
.auth-topbar .auth-switch { font-size: 13px; color: var(--auth-muted); }
.auth-topbar .auth-switch a { font-weight: 600; margin-left: 4px; }

.auth-locales { display: flex; gap: 8px; }
.auth-locales a { display: inline-flex; opacity: .7; transition: opacity .15s; }
.auth-locales a.active, .auth-locales a:hover { opacity: 1; }
.auth-locales svg { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

.auth-content {
	flex: 1 1 auto;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	padding: 8px 40px 40px;
}
.auth-content.narrow { max-width: 440px; display: flex; flex-direction: column; justify-content: center; }

.auth-title { font-size: 24px; font-weight: 700; color: var(--auth-dark); margin: 0 0 4px; }
.auth-subtitle { color: var(--auth-muted); margin: 0 0 28px; }

/* ---------- Stepper ---------- */
.auth-stepper {
	display: flex;
	align-items: center;
	margin: 8px 0 32px;
	padding: 0;
	list-style: none;
}
.auth-stepper li {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 0;
	color: var(--auth-muted);
	font-weight: 500;
	white-space: nowrap;
}
.auth-stepper li:last-child { flex: 0 0 auto; }
.auth-stepper li::after {
	content: "";
	flex: 1 1 auto;
	height: 2px;
	margin: 0 12px;
	background: var(--auth-border);
	border-radius: 2px;
	transition: background .3s;
}
.auth-stepper li:last-child::after { display: none; }
.auth-stepper .step-num {
	flex: 0 0 34px; height: 34px;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 600;
	background: var(--auth-bg);
	color: var(--auth-muted);
	transition: all .25s;
}
.auth-stepper li.active { color: var(--auth-dark); }
.auth-stepper li.active .step-num { background: var(--auth-primary); color: #fff; box-shadow: 0 6px 16px rgba(54, 153, 255, .35); }
.auth-stepper li.done .step-num { background: var(--auth-primary-light); color: var(--auth-primary); }
.auth-stepper li.done::after { background: var(--auth-primary); }
.auth-stepper li.done { cursor: pointer; }

/* ---------- Passos ---------- */
.auth-step { display: none; animation: authFade .3s ease; }
.auth-step.active { display: block; }
@keyframes authFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Planos ---------- */
.plan-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
}
.plan-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 22px 20px 18px;
	border: 2px solid var(--auth-border);
	border-radius: var(--auth-radius);
	background: #fff;
	cursor: pointer;
	transition: border-color .2s, box-shadow .2s, transform .2s;
}
.plan-card:hover { border-color: #B5D8FF; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(24, 28, 50, .06); }
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card.selected { border-color: var(--auth-primary); box-shadow: 0 10px 28px rgba(54, 153, 255, .18); }
.plan-card .plan-check {
	position: absolute; top: 16px; right: 16px;
	width: 22px; height: 22px;
	border-radius: 50%;
	border: 2px solid var(--auth-border);
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 10px; color: transparent;
	transition: all .2s;
}
.plan-card.selected .plan-check { background: var(--auth-primary); border-color: var(--auth-primary); color: #fff; }
.plan-card .plan-badge {
	position: absolute; top: -11px; left: 18px;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: 11px; font-weight: 600;
	color: #fff; background: var(--auth-primary);
}
.plan-card h3 { font-size: 17px; font-weight: 600; color: var(--auth-dark); margin: 0 28px 10px 0; }
.plan-card .price { font-size: 28px; font-weight: 700; color: var(--auth-dark); line-height: 1.1; }
.plan-card .price small { font-size: 13px; font-weight: 400; color: var(--auth-muted); }
.plan-card .trial { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; color: #0BB7AF; background: var(--auth-success-light); }
.plan-card .plan-desc {
	margin-top: 14px;
	font-size: 13px;
	color: var(--auth-muted);
	max-height: 96px;
	overflow: hidden;
	position: relative;
	transition: max-height .3s ease;
}
.plan-card .plan-desc::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px;
	background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.plan-card .plan-desc.open { max-height: 1200px; }
.plan-card .plan-desc.open::after { display: none; }
.plan-card .plan-desc ul { padding-left: 18px; margin: 0; }
.plan-card .plan-desc p { margin: 0 0 6px; }
.plan-card .plan-more { margin-top: 8px; font-size: 12px; font-weight: 500; background: none; border: 0; padding: 0; color: var(--auth-primary); cursor: pointer; align-self: flex-start; }

/* ---------- Formulário ---------- */
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { font-weight: 500; color: var(--auth-dark); margin-bottom: 6px; font-size: 13px; }
.auth-input {
	position: relative;
}
.auth-input > i.lead {
	position: absolute; left: 14px; top: 50%;
	transform: translateY(-50%);
	color: #B5B5C3;
	pointer-events: none;
	transition: color .15s;
}
.auth-form .form-control {
	height: 48px;
	border-radius: 10px;
	border: 1px solid var(--auth-border);
	background: #fff;
	font-size: 14px;
	color: var(--auth-dark);
	transition: border-color .15s, box-shadow .15s;
}
.auth-input > i.lead ~ .form-control { padding-left: 42px; }
.auth-form .form-control:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 3px rgba(54, 153, 255, .15); }
.auth-input:focus-within > i.lead { color: var(--auth-primary); }
.auth-form .form-control.is-invalid { border-color: var(--auth-danger); background-image: none; }
.auth-form .form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(246, 78, 96, .15); }
.auth-form .form-control.is-valid { border-color: var(--auth-success); background-image: none; }
.auth-form .invalid-feedback { font-size: 12px; color: var(--auth-danger); }
.auth-form .form-text { font-size: 12px; color: var(--auth-muted); }

.auth-input .input-action {
	position: absolute; right: 6px; top: 50%;
	transform: translateY(-50%);
	height: 36px; min-width: 36px;
	padding: 0 10px;
	border: 0; border-radius: 8px;
	background: transparent;
	color: var(--auth-muted);
	cursor: pointer;
}
.auth-input .input-action:hover { background: var(--auth-bg); color: var(--auth-primary); }
.auth-input .input-action ~ .form-control,
.auth-input .form-control.has-action { padding-right: 48px; }

.auth-segmented {
	display: inline-flex;
	padding: 4px;
	margin-bottom: 20px;
	border-radius: 10px;
	background: var(--auth-bg);
}
.auth-segmented label { margin: 0; }
.auth-segmented input { display: none; }
.auth-segmented span {
	display: inline-block;
	padding: 8px 18px;
	border-radius: 8px;
	font-weight: 500;
	color: var(--auth-muted);
	cursor: pointer;
	transition: all .2s;
}
.auth-segmented input:checked + span { background: #fff; color: var(--auth-primary); box-shadow: 0 2px 8px rgba(24, 28, 50, .08); }

.auth-hint {
	display: none;
	align-items: center;
	gap: 8px;
	margin: -6px 0 18px;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
}
.auth-hint.show { display: flex; }
.auth-hint.info { color: var(--auth-primary-hover); background: var(--auth-primary-light); }
.auth-hint.success { color: #0BA59E; background: var(--auth-success-light); }
.auth-hint.warning { color: #B37500; background: var(--auth-warning-light); }
.auth-hint.danger { color: #D2364A; background: var(--auth-danger-light); }
.auth-hint a { font-weight: 600; margin-left: auto; white-space: nowrap; }

.field-status { font-size: 12px; margin-top: 6px; display: none; }
.field-status.show { display: block; }
.field-status.ok { color: var(--auth-success); }
.field-status.bad { color: var(--auth-danger); }
.field-status.wait { color: var(--auth-muted); }

.strength { display: flex; gap: 4px; margin-top: 8px; }
.strength span { flex: 1; height: 4px; border-radius: 4px; background: var(--auth-border); transition: background .2s; }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--auth-danger); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--auth-warning); }
.strength[data-level="3"] span:nth-child(-n+3) { background: #8BC34A; }
.strength[data-level="4"] span { background: var(--auth-success); }
.strength-label { font-size: 12px; color: var(--auth-muted); margin-top: 4px; min-height: 18px; }

.auth-summary {
	padding: 16px 18px;
	margin-bottom: 20px;
	border-radius: var(--auth-radius);
	background: var(--auth-bg);
	font-size: 13px;
}
.auth-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 8px 0 0; }
.auth-summary dt { font-weight: 400; color: var(--auth-muted); }
.auth-summary dd { margin: 0; color: var(--auth-dark); font-weight: 500; word-break: break-word; }
.auth-summary .summary-title { font-weight: 600; color: var(--auth-dark); }

/* ---------- Seções do formulário ---------- */
.auth-section-title {
	display: flex; align-items: center; gap: 8px;
	margin: 8px 0 4px;
	padding-top: 18px;
	border-top: 1px dashed var(--auth-border);
	font-size: 15px; font-weight: 600;
	color: var(--auth-dark);
}
.auth-section-title i { color: var(--auth-primary); }
.auth-form select.form-control { padding-top: 0; padding-bottom: 0; cursor: pointer; }

/* ---------- Botões ---------- */
.auth-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 28px;
}
.btn-auth {
	height: 48px;
	padding: 0 26px;
	border-radius: 10px;
	font-weight: 600;
	font-size: 14px;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	transition: all .15s;
}
.btn-auth-primary { color: #fff; background: var(--auth-primary); border: 1px solid var(--auth-primary); }
.btn-auth-primary:hover, .btn-auth-primary:focus { color: #fff; background: var(--auth-primary-hover); border-color: var(--auth-primary-hover); box-shadow: 0 8px 20px rgba(54, 153, 255, .3); }
.btn-auth-primary:disabled { opacity: .65; box-shadow: none; cursor: not-allowed; }
.btn-auth-light { color: var(--auth-text); background: var(--auth-bg); border: 1px solid var(--auth-bg); }
.btn-auth-light:hover { color: var(--auth-dark); background: #EBEDF3; }
.btn-auth-outline { color: var(--auth-primary); background: #fff; border: 1px solid #B5D8FF; }
.btn-auth-outline:hover { color: #fff; background: var(--auth-primary); border-color: var(--auth-primary); }
.btn-auth.btn-block { width: 100%; }

.spinner-inline {
	width: 16px; height: 16px;
	border: 2px solid rgba(255, 255, 255, .5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: authSpin .7s linear infinite;
	display: none;
}
.is-loading .spinner-inline { display: inline-block; }
.is-loading .btn-icon { display: none; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-alert {
	display: flex; gap: 10px;
	padding: 12px 16px;
	margin-bottom: 20px;
	border-radius: 10px;
	font-size: 13px;
}
.auth-alert.danger { color: #D2364A; background: var(--auth-danger-light); }
.auth-alert.success { color: #0BA59E; background: var(--auth-success-light); }
.auth-alert ul { margin: 4px 0 0; padding-left: 18px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--auth-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--auth-border); }

.auth-check { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: 400 !important; color: var(--auth-text) !important; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--auth-primary); }

.auth-forgot { display: none; margin-top: 20px; padding: 20px; border-radius: var(--auth-radius); background: var(--auth-bg); }
.auth-forgot.show { display: block; animation: authFade .3s ease; }

.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Responsivo ---------- */
@media (max-width: 991.98px) {
	.auth-shell { flex-direction: column; }
	.auth-aside { flex: 0 0 auto; max-width: none; padding: 24px; }
	.auth-hero { margin-top: 20px; }
	.auth-hero h1 { font-size: 20px; }
	.auth-hero p { margin-bottom: 0; font-size: 14px; }
	.auth-benefits, .auth-aside-footer { display: none; }
	.auth-plan-summary { margin-top: 16px; padding: 12px 16px; }
	.auth-plan-summary .plan-price { font-size: 20px; }
	.auth-topbar { padding: 16px 20px; }
	.auth-content { padding: 4px 20px 32px; }
}

@media (max-width: 575.98px) {
	.auth-stepper .step-label { display: none; }
	.auth-stepper li.active .step-label { display: inline; }
	.auth-actions { flex-direction: column-reverse; }
	.auth-actions .btn-auth { width: 100%; }
	.auth-title { font-size: 20px; }
}
