﻿/* ==========================================================================
   Regularize sua OAB — Login
   Design system dedicado da tela de acesso (autocontido).
   ========================================================================== */

:root {
    --brand: #04c6ac;
    --brand-600: #06b39c;
    --brand-700: #027d6c;
    --ink: #0a3d52;
    --ink-2: #0a4a68;

    --text: #1f2a37;
    --muted: #6b7280;
    --muted-2: #727a86;
    --line: #e6e9ee;
    --line-strong: #d3d8e0;
    --surface: #ffffff;
    --field-bg: #ffffff;

    --danger: #dc2626;

    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --r-pill: 999px;

    --ring: 0 0 0 3px rgba(4, 198, 172, 0.28);
    --shadow-card: 0 24px 60px -24px rgba(10, 61, 82, 0.35), 0 2px 8px rgba(10, 61, 82, 0.06);
    --shadow-btn: 0 8px 18px -8px rgba(4, 198, 172, 0.7);

    --dur: 180ms;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

.auth-body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(1100px 620px at 18% -8%, rgba(4, 198, 172, 0.14), transparent 60%),
        radial-gradient(1000px 640px at 108% 112%, rgba(10, 74, 104, 0.12), transparent 55%),
        #f4f7f8;
}

/* ---------- Shell ---------- */

.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* ---------- Brand pane ---------- */

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 44px 40px;
    color: #eafcf8;
    background:
        radial-gradient(520px 340px at 82% 8%, rgba(255, 255, 255, 0.16), transparent 60%),
        linear-gradient(158deg, var(--brand) 0%, #0a8f83 52%, var(--ink-2) 100%);
    overflow: hidden;
}

.auth-brand::after {
    /* selo decorativo discreto */
    content: "";
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.auth-brand__eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 7px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--r-pill);
    backdrop-filter: blur(2px);
}

.auth-brand__eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b8ffef;
    box-shadow: 0 0 0 3px rgba(184, 255, 239, 0.28);
}

.auth-brand__title {
    margin: 22px 0 10px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.auth-brand__sub {
    margin: 0;
    max-width: 34ch;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(234, 252, 248, 0.86);
}

.auth-brand__art {
    width: 78%;
    max-width: 300px;
    margin: 26px auto 22px;
    filter: drop-shadow(0 18px 26px rgba(3, 40, 54, 0.28));
}

.auth-brand__trust {
    list-style: none;
    margin: auto 0 0;
    padding: 0;
    display: grid;
    gap: 11px;
}

.auth-brand__trust li {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.94);
}

.auth-brand__trust li svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    padding: 3px;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

.auth-brand__news {
    margin-top: 22px;
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    align-self: flex-start;
    padding-bottom: 1px;
    transition: border-color var(--dur) var(--ease);
}

.auth-brand__news:hover { border-color: #ffffff; }

/* ---------- Form pane ---------- */

.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 44px 36px;
}

.auth-head { margin-bottom: 22px; }

.auth-logo {
    margin-bottom: 22px;
    display: flex;
    justify-content: flex-start;
}

.auth-logo img {
    height: 46px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
}

.auth-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.auth-sub {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--muted);
}

.auth-steps { display: block; }

.auth-row { margin-bottom: 12px; }

.auth-alt {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13.5px;
}

.auth-alt a,
.auth-back a {
    color: var(--brand-700);
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: color var(--dur) var(--ease);
}

.auth-alt a:hover,
.auth-back a:hover { color: var(--ink); text-decoration: underline; }

.auth-alt a:focus-visible,
.auth-back a:focus-visible,
.auth-news-mobile:focus-visible,
.auth-brand__news:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 6px;
}

/* Utilitário: visível apenas para leitores de tela */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-back {
    margin: 16px 0 0;
    text-align: center;
    font-size: 13.5px;
}

.auth-back a { color: var(--muted); font-weight: 500; }

.auth-foot {
    margin: 26px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--muted-2);
    text-align: center;
}

/* ---------- Aviso de canais oficiais (verificação) ---------- */

.auth-verify {
    margin: 22px 0 0;
    padding: 14px 16px;
    background: rgba(4, 198, 172, 0.06);
    border: 1px solid rgba(4, 198, 172, 0.22);
    border-radius: var(--r);
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.auth-verify__lead { margin: 0 0 10px; }

.auth-verify__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.auth-verify__list li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
}

.auth-verify__list svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: var(--brand);
}

.auth-verify__list strong { color: var(--ink); font-weight: 700; }
.auth-verify__list a { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.auth-verify__list a:hover { border-bottom-style: solid; }
.auth-verify__list a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* Botão de WhatsApp (CTA clicável) */
.wa-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 11px 16px;
    color: #ffffff;
    background: #25d366;
    border-radius: var(--r-pill);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 8px 18px -10px rgba(37, 211, 102, 0.9);
    transition: background-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.wa-btn:hover { background: #1eb457; }
.wa-btn:active { transform: translateY(1px); }
.wa-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.45); }

.wa-btn__icon { width: 22px; height: 22px; flex: 0 0 auto; }
.wa-btn__text { flex: 1; line-height: 1.25; }
.wa-btn__text small { display: block; font-weight: 600; opacity: 0.9; font-size: 12px; }
.wa-btn__chevron { width: 16px; height: 16px; flex: 0 0 auto; opacity: 0.9; }

/* ---------- Buttons ---------- */

.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: auto;
    min-height: 46px;
    padding: 11px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease),
                border-color var(--dur) var(--ease),
                color var(--dur) var(--ease),
                box-shadow var(--dur) var(--ease),
                transform var(--dur) var(--ease);
}

.btn--block { width: 100%; }

.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }

.btn[disabled],
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--primary {
    color: #ffffff;
    background: var(--brand);
    box-shadow: var(--shadow-btn);
}

.btn--primary:hover { background: var(--brand-700); }

.btn--outline {
    color: var(--ink-2);
    background: #ffffff;
    border-color: var(--line-strong);
}

.btn--outline:hover { border-color: var(--ink-2); background: #f7fbfb; }

.btn--brand-outline {
    color: var(--brand-700);
    background: #ffffff;
    border-color: rgba(4, 198, 172, 0.55);
}

.btn--brand-outline:hover { background: rgba(4, 198, 172, 0.08); border-color: var(--brand); }

.btn__icon { width: 18px; height: 18px; flex: 0 0 auto; }
.btn__logo { height: 20px; width: auto; }
.btn small { font-weight: 500; opacity: 0.85; font-size: 12.5px; }

/* ---------- Divider ---------- */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

/* ---------- Fields ---------- */

.field { margin-bottom: 14px; }

.field__label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.field__hint {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--field-bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.input::placeholder { color: var(--muted-2); }
.input:hover { border-color: #b9c1cc; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

.field-row { display: flex; gap: 10px; }
.field-ddd { width: 84px; flex: 0 0 auto; text-align: center; }

/* ---------- Steps (painéis animados via JS) ---------- */

.step { display: block; }

.step__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.step__lead {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.step__lead strong { color: var(--text); }

.step-card {
    padding: 16px;
    background: #f6faf9;
    border: 1px solid #dcefeb;
    border-radius: var(--r);
    margin-bottom: 14px;
    text-align: center;
}

.step-card__label { font-size: 13px; color: var(--muted); }
.step-card__value { display: block; margin-top: 3px; font-weight: 700; color: var(--ink); }

/* ---------- KBA (opções renderizadas pelo JS: label.kba-option) ---------- */

.kba-group { margin-bottom: 18px; }

.kba-group__label {
    display: block;
    margin-bottom: 9px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
}

.kba-options { display: grid; gap: 8px; }

.kba-option {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.kba-option:hover { border-color: var(--brand); background: #f6fdfb; }

.kba-option__radio {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.kba-option__radio:checked {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 4px var(--brand);
}

.kba-option:has(.kba-option__radio:checked) {
    border-color: var(--brand);
    background: rgba(4, 198, 172, 0.07);
    box-shadow: var(--ring);
}

.kba-option:focus-within { box-shadow: var(--ring); border-color: var(--brand); }

/* ---------- Canal (segmented: E-mail / SMS) ---------- */

.seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    margin-bottom: 14px;
    background: #eef2f4;
    border-radius: var(--r);
}

.seg__opt {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 10px;
    cursor: pointer;
    transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.seg__opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.seg__opt:has(input:checked) {
    color: var(--ink);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(10, 61, 82, 0.12);
}

.seg__opt:has(input:focus-visible) { box-shadow: var(--ring); }

/* ---------- Consentimento ---------- */

.consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 16px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    cursor: pointer;
}

.consent input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 1px;
    border: 1.5px solid var(--line-strong);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.consent input:checked {
    background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E") center/13px no-repeat;
    border-color: var(--brand);
}

.consent input:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- OTP / token ---------- */

.otp { margin: 6px 0 18px; display: flex; justify-content: center; }

.otp__input {
    width: 240px;
    max-width: 100%;
    padding: 15px 18px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 16px;
    text-indent: 16px;
    text-transform: uppercase;
    color: var(--ink);
    background: #f8fafb;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.otp__input::placeholder { color: #cbd3db; font-weight: 600; }
.otp__input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); background: #fff; }

/* ---------- Responsivo ---------- */

/* Link da notícia oficial: no desktop vive no brand pane; no mobile aparece no formulário. */
.auth-news-mobile { display: none; }

@media (max-width: 860px) {
    .auth { padding: 20px 16px; }
    .auth-card { grid-template-columns: 1fr; max-width: 460px; }
    .auth-brand { display: none; }
    .auth-main { padding: 34px 26px 30px; }
    .auth-logo { justify-content: center; }
    .auth-head { text-align: center; }

    .auth-news-mobile {
        display: block;
        margin: 16px 0 0;
        text-align: center;
        font-size: 13.5px;
        font-weight: 600;
        color: var(--brand-700);
        text-decoration: none;
    }
    .auth-news-mobile:hover { text-decoration: underline; }
}

@media (max-width: 420px) {
    .auth-main { padding: 28px 20px 26px; }
    .otp__input { letter-spacing: 12px; text-indent: 12px; }
}

/* ---------- Acessibilidade ---------- */

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------- Botão de alternância de tema (claro/escuro) ---------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background-color 0.18s, box-shadow 0.18s;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--brand); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.theme-toggle svg { width: 18px; height: 18px; }

.theme-toggle--float { position: fixed; top: 16px; right: 16px; z-index: 60; }

.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle__sun { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }

/* ---------- Tema escuro (padrão segue o sistema; alternável pelo usuário) ---------- */

:root[data-theme="dark"] {
    --text: #e6edee;
    --muted: #9fb0b6;
    --muted-2: #8ea0a7;
    --line: #26333a;
    --line-strong: #33454e;
    --ink: #eaf7f4;
    --ink-2: #bfeae2;
    --surface: #111b1f;
    --field-bg: #0e181c;
    --ring: 0 0 0 3px rgba(4, 198, 172, 0.4);
    --shadow-card: 0 24px 60px -24px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .auth-body {
    background:
        radial-gradient(1100px 620px at 18% -8%, rgba(4, 198, 172, 0.10), transparent 60%),
        radial-gradient(1000px 640px at 108% 112%, rgba(10, 74, 104, 0.16), transparent 55%),
        #0a1215;
}

:root[data-theme="dark"] .btn--outline { background: var(--surface); color: var(--ink-2); }
:root[data-theme="dark"] .btn--outline:hover { background: #16242a; }
:root[data-theme="dark"] .btn--brand-outline { background: var(--surface); color: #2fe0c9; border-color: rgba(4, 198, 172, 0.5); }
:root[data-theme="dark"] .btn--brand-outline:hover { background: rgba(4, 198, 172, 0.12); }

:root[data-theme="dark"] .input { background: var(--field-bg); }
:root[data-theme="dark"] .input:hover { border-color: #3f515a; }

:root[data-theme="dark"] .step-card { background: rgba(4, 198, 172, 0.06); border-color: rgba(4, 198, 172, 0.22); }

:root[data-theme="dark"] .kba-option { background: var(--surface); }
:root[data-theme="dark"] .kba-option:hover { background: #16242a; }

:root[data-theme="dark"] .seg { background: #0e181c; }
:root[data-theme="dark"] .seg__opt:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }

:root[data-theme="dark"] .consent input:not(:checked) { background: var(--field-bg); }

:root[data-theme="dark"] .otp__input { background: #0e181c; }
:root[data-theme="dark"] .otp__input:focus { background: var(--surface); }
:root[data-theme="dark"] .otp__input::placeholder { color: #3a4a52; }
:root[data-theme="dark"] .auth-news-mobile { color: #2fe0c9; }
