/* =====================================================================
   Telas de acesso (login, cadastro, recuperação, ativação)
   Depende de style.css (tokens, botões, formulários, alertas)
   ===================================================================== */
body.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background: var(--surface);
}

.auth-aside {
    position: relative;
    overflow: hidden;
    background: var(--gradient);
    color: #fff;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-aside::before,
.auth-aside::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}

.auth-aside::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-aside::after  { width: 380px; height: 380px; left: -140px; bottom: -140px; }

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 16px;
}

.auth-brand .brand-mark {
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
    backdrop-filter: blur(6px);
}

.auth-pitch {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.auth-pitch h2 {
    color: #fff;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.auth-pitch p {
    font-size: 16px;
    opacity: .9;
    margin-bottom: 28px;
}

.auth-features {
    list-style: none;
    display: grid;
    gap: 12px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.auth-features .i {
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
}

.auth-aside small {
    position: relative;
    z-index: 1;
    opacity: .75;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--surface);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    animation: modalIn .4s var(--ease);
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-weight: 700;
}

.auth-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--primary-50);
    color: var(--primary);
    margin-bottom: 20px;
}

.auth-card h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-card .subtitle {
    color: var(--text-2);
    margin-bottom: 26px;
}

.auth-card .form-control { height: 46px; }

.auth-card .btn-block {
    width: 100%;
    height: 46px;
    font-size: 15px;
}

.auth-card .btn-block + .btn-block { margin-top: 10px; }

.auth-row {
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 18px;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.auth-link:hover { text-decoration: underline; }

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-2);
    font-size: 14px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-3);
    font-size: 12px;
    margin: 22px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Campo com ícone */
.input-icon {
    position: relative;
}

.input-icon > .i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.input-icon .form-control { padding-left: 42px; }

.toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--text-3);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 8px;
    border-radius: 8px;
}

.toggle-pass:hover { color: var(--text); background: var(--surface-2); }

/* Código de 6 dígitos */
.code-input {
    text-align: center;
    font-size: 26px !important;
    font-weight: 700;
    letter-spacing: 12px;
    height: 58px !important;
    font-variant-numeric: tabular-nums;
}

/* Passos (recuperação de senha) */
.step { display: none; }
.step.active { display: block; animation: fadeIn .25s ease; }

.step-indicator {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
}

.step-dot {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    transition: background .3s;
}

.step-dot.active { background: var(--primary); }

/* Requisitos e força da senha */
.password-requirements {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-2);
}

.password-requirements strong { display: block; margin-bottom: 6px; color: var(--text); }

.password-requirements ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-requirements li::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
    transition: all .2s;
}

.password-requirements li.requirement-met { color: var(--success); }

.password-requirements li.requirement-met::before {
    border-color: var(--success);
    background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
}

.password-strength {
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width .3s, background .3s;
}

.strength-weak   { width: 33%; background: var(--danger); }
.strength-medium { width: 66%; background: var(--warning); }
.strength-strong { width: 100%; background: var(--success); }

/* Spinner pequeno dentro de botões */
.btn .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, .35);
    border-top-color: #fff;
    margin: 0 0 0 8px;
    display: inline-block;
    vertical-align: middle;
}

.alert { line-height: 1.45; }

/* Modal de ativação (login) */
.activation-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.activation-modal.show { display: flex; animation: fadeIn .2s ease; }

.activation-box {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 32px 28px;
    animation: modalIn .3s var(--ease);
}

.activation-box h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.activation-box p { color: var(--text-2); margin-bottom: 20px; }

/* Responsivo */
@media (max-width: 960px) {
    body.auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-mobile-brand { display: flex; }
    .auth-main { align-items: flex-start; padding-top: 48px; }
}

/* Botão de tema nas telas de acesso */
.auth-theme {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top));
    right: 16px;
    z-index: 20;
}

@media (max-width: 960px) {
    .auth-main { padding-top: calc(48px + env(safe-area-inset-top)); }
    .auth-card .form-control { font-size: 16px; }
}
