/* ==========================================================
   VitaVox — Primeiro Acesso por convite (identidade ferrugem)
   Mesmos nomes de classe do original. Sem azul/petróleo/roxo.
   ========================================================== */
:root {
    --bg: #f6f1ea;
    --card: #ffffff;
    --text: #2a211b;
    --ink: #241a13;
    --muted: rgba(42, 33, 27, 0.62);
    --line: rgba(120, 86, 52, 0.14);
    --line-strong: rgba(120, 86, 52, 0.22);
    --primary: #b85327;
    --primary-2: #9c3d14;
    --primary-soft: #f4e2d4;
    --rust-soft: #d9824f;
    --pastel-1: #fce4d2;
    --pastel-2: #f4c79c;
    --danger: #b23a2e;
    --danger-soft: #f7e2de;
    --success: #4f7a4a;
    --success-soft: #e9f3e6;
    --warning: #8a5a12;
    --warning-soft: #fbeed2;
    --surface-2: #fbf5ee;
    --surface-3: #f6efe6;
    --shadow: 0 30px 70px rgba(80, 40, 15, 0.16);
    --radius: 26px;
}

[data-theme="dark"] {
    --bg: #0d0d0d;
    --card: #161310;
    --text: #ece7e1;
    --ink: #f1ece6;
    --muted: rgba(236, 231, 225, 0.60);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.18);
    --primary: #df8a55;
    --primary-2: #e8a072;
    --primary-soft: #2a1c13;
    --rust-soft: #e8a072;
    --pastel-1: #2a211b;
    --pastel-2: #241d18;
    --danger: #e0796b;
    --danger-soft: #2a1512;
    --success: #8bb586;
    --success-soft: #16241a;
    --warning: #e3b774;
    --warning-soft: #2a2113;
    --surface-2: #1c1712;
    --surface-3: #201a15;
    --shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(184, 83, 39, .12), transparent 34%),
        linear-gradient(180deg, #f8f3ec 0%, var(--bg) 100%);
    color: var(--text);
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* toggle de tema no canto */
.theme-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--primary);
    display: grid;
    place-items: center;
}
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-shell {
    width: min(1160px, 100%);
    min-height: 720px;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ---------- PAINEL DE MARCA (ferrugem) ---------- */
.brand-panel {
    position: relative;
    overflow: hidden;
    padding: 42px;
    background:
        radial-gradient(120% 90% at 12% 8%, rgba(255,255,255,.16), transparent 46%),
        linear-gradient(150deg, #b85327 0%, #9c3d14 62%, #7d2f0d 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(125deg, rgba(255,255,255,.06) 0 1px, transparent 1px 26px);
    pointer-events: none;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    right: -70px;
    bottom: -70px;
    background: rgba(255, 255, 255, 0.08);
}

.brand-logo {
    position: relative;
    z-index: 1;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-weight: 900;
}

.brand-logo span {
    font-size: 22px;
    letter-spacing: 0.5px;
}

.brand-copy {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.brand-copy h1 {
    font-size: clamp(30px, 3.4vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: 480px;
    margin-bottom: 18px;
    font-weight: 900;
}

.brand-copy p {
    max-width: 440px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    line-height: 1.7;
}

.brand-card {
    position: relative;
    z-index: 1;
    padding: 18px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.20);
}

.brand-card strong {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
}

.brand-card span {
    display: block;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.80);
}

/* ---------- PAINEL DO FORMULÁRIO ---------- */
.form-panel {
    padding: 42px;
    overflow-y: auto;
    background: var(--card);
}

.form-head {
    margin-bottom: 20px;
}

.form-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-2);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.form-head h2 {
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--ink);
}

.form-head p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.alert {
    margin: 18px 0;
    padding: 13px 15px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.alert.ok {
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid rgba(79, 122, 74, 0.28);
}

.alert.err {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(178, 58, 46, 0.28);
}

.alert.warn {
    color: var(--warning);
    background: var(--warning-soft);
    border: 1px solid rgba(138, 90, 18, 0.28);
}

.invite-box {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-2);
    margin-bottom: 18px;
}

.invite-box label {
    display: block;
    font-size: 11px;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.invite-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.invite-row input {
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    padding: 0 14px;
    outline: none;
    color: var(--text);
    background: var(--card);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.invite-row input:focus {
    border-color: var(--rust-soft);
    box-shadow: 0 0 0 4px rgba(184, 83, 39, 0.12);
}

.invite-row button {
    height: 44px;
    border: none;
    border-radius: 13px;
    padding: 0 18px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.invite-row button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.invite-box small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.form-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    background: var(--card);
    transition: opacity .2s ease, filter .2s ease;
}

.form-card.is-disabled {
    opacity: .48;
    filter: grayscale(.2);
    pointer-events: none;
}

.section-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title--second {
    padding-top: 22px;
    margin-top: 22px;
    border-top: 1px solid var(--line);
}

.section-title span {
    width: 30px;
    height: 30px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.section-title h3 {
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 3px;
    color: var(--ink);
}

.section-title p {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: 1fr 1.2fr .7fr;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.field input,
.field select {
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    padding: 0 13px;
    background: var(--card);
    color: var(--text);
    outline: none;
    font-size: 14px;
}

.field input:focus,
.field select:focus {
    border-color: var(--rust-soft);
    box-shadow: 0 0 0 4px rgba(184, 83, 39, 0.12);
}

.field input[readonly] {
    background: var(--surface-3);
    color: var(--muted);
    cursor: not-allowed;
}

.password-hint {
    margin-top: -4px;
    font-size: 12px;
    color: var(--muted);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.link-login {
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
}
.link-login:hover { text-decoration: underline; }

.form-actions button {
    height: 46px;
    border: none;
    border-radius: 14px;
    padding: 0 22px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

.form-actions button:hover,
.invite-row button:hover {
    background: var(--primary-2);
}

.form-actions button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 960px) {
    .auth-page { padding: 18px; }
    .auth-shell { grid-template-columns: 1fr; }
    .brand-panel { min-height: 300px; }
    .form-panel { padding: 28px; }
}

@media (max-width: 680px) {
    .grid.two,
    .grid.three { grid-template-columns: 1fr; }
    .invite-row { grid-template-columns: 1fr; }
    .invite-row button,
    .form-actions button { width: 100%; }
    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
    .link-login { text-align: center; }
    .brand-panel,
    .form-panel { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================
   SENHA DE ACESSO — força da senha e confirmação
========================================================== */

.password-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.password-field {
    gap: 8px;
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    width: 100%;
    height: 52px;
    padding-left: 46px;
    padding-right: 46px;
    border-radius: 14px;
}

.password-input input:focus {
    border-color: var(--rust-soft);
    box-shadow: 0 0 0 4px rgba(184, 83, 39, 0.12);
}

.password-icon,
.password-toggle {
    position: absolute;
    z-index: 1;
    display: grid;
    place-items: center;
    color: var(--primary);
}

.password-icon {
    left: 15px;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.password-toggle {
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
}

.password-toggle:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.password-icon svg,
.password-toggle svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-strength {
    display: grid;
    gap: 9px;
    margin-top: 2px;
}

.password-strength-bar {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: var(--line-strong);
    overflow: hidden;
}

.password-strength-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--danger);
    transition: width .18s ease, background .18s ease;
}

.password-strength-bar span.is-medium {
    background: var(--warning);
}

.password-strength-bar span.is-strong {
    background: var(--success);
}

.password-strength p {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.password-rules {
    display: grid;
    gap: 8px;
    list-style: none;
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.password-rules li span {
    width: 18px;
    height: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex: 0 0 18px;
    color: var(--muted);
    background: var(--card);
}

.password-rules li span::before {
    content: "✓";
    font-size: 11px;
    line-height: 1;
}

.password-rules li.is-ok {
    color: var(--text);
}

.password-rules li.is-ok span {
    border-color: rgba(79, 122, 74, 0.32);
    background: var(--success-soft);
    color: var(--success);
}

.password-match {
    display: block;
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

.password-match.ok {
    color: var(--success);
}

@media (max-width: 680px) {
    .password-input input {
        height: 50px;
    }
}
