/* ============================================================
   Tela de login — layout split-screen com prévia do dashboard.
   Paleta própria (azul-marinho), independente do tema laranja
   do restante da plataforma: esta é a "porta de entrada" e usa
   um momento de identidade dedicado.
   ============================================================ */

.auth-shell {
    --auth-bg-base: oklch(0.15 0.035 259);
    --auth-bg-right: oklch(0.185 0.05 259);
    --auth-accent: oklch(0.55 0.19 259);
    --auth-accent-hover: oklch(0.60 0.185 259);
    --auth-accent-active: oklch(0.47 0.19 259);
    --auth-card-bg: oklch(0.235 0.05 259);
    --auth-card-bg-alt: oklch(0.285 0.055 259);
    --auth-card-border: oklch(1 0 0 / 8%);
    --auth-text-primary: oklch(0.97 0.008 259);
    --auth-text-secondary: oklch(0.74 0.03 259);
    --auth-text-muted: oklch(0.56 0.03 259);
    --auth-input-bg: oklch(0.99 0.003 259);
    --auth-input-text: oklch(0.24 0.02 259);
    --auth-shadow: oklch(0.04 0.02 259 / 55%);

    display: flex;
    min-height: 100vh;
    background: var(--auth-bg-base);
    color: var(--auth-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Painel esquerdo: prévia ilustrativa do painel ---------- */
.auth-illustration {
    flex: 1.1;
    position: relative;
    padding: 64px 48px;
    display: flex;
    align-items: center;
    background:
        radial-gradient(720px 480px at 15% 12%, oklch(0.24 0.06 259 / 65%), transparent 60%),
        var(--auth-bg-base);
    overflow: hidden;
}

.preview-grid {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    grid-auto-rows: min-content;
    gap: 14px;
}

.pv-card {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 16px 32px -22px var(--auth-shadow);
}

.pv-card.alt { background: var(--auth-card-bg-alt); }
.pv-hero { grid-column: 1; grid-row: 1; }
.pv-secondary { grid-column: 2; grid-row: 1; }
.pv-donut { grid-column: 1; grid-row: 2 / span 2; display: flex; flex-direction: column; }
.pv-tertiary { grid-column: 2; grid-row: 2; }
.pv-quaternary { grid-column: 2; grid-row: 3; }
.pv-footer-a { grid-column: 1; grid-row: 4; }
.pv-footer-b { grid-column: 2; grid-row: 4; }

.pv-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--auth-text-muted);
    margin-bottom: 10px;
}

.pv-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--auth-text-primary);
}

.pv-skeleton {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        oklch(1 0 0 / 8%) 25%,
        oklch(1 0 0 / 16%) 37%,
        oklch(1 0 0 / 8%) 63%
    );
    background-size: 400% 100%;
    animation: pv-shimmer 2.6s ease-in-out infinite;
}

.pv-footer-a .pv-skeleton, .pv-footer-b .pv-skeleton { width: 70%; }

@keyframes pv-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .pv-skeleton { animation: none; }
}

/* ---------- Donut de despesas por categoria (decorativo) ---------- */
.pv-donut-chart {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    margin: 4px auto 14px;
    background: conic-gradient(
        oklch(0.62 0.17 259) 0deg 126deg,
        oklch(0.5 0.14 250) 126deg 216deg,
        oklch(0.74 0.15 220) 216deg 284deg,
        oklch(0.7 0.14 90) 284deg 332deg,
        oklch(0.55 0.02 259) 332deg 360deg
    );
    -webkit-mask: radial-gradient(circle, transparent 38%, #000 39%);
    mask: radial-gradient(circle, transparent 38%, #000 39%);
}

.pv-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 11px;
    color: var(--auth-text-secondary);
}

.pv-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pv-dot.d1 { background: oklch(0.62 0.17 259); }
.pv-dot.d2 { background: oklch(0.5 0.14 250); }
.pv-dot.d3 { background: oklch(0.74 0.15 220); }
.pv-dot.d4 { background: oklch(0.7 0.14 90); }
.pv-dot.d5 { background: oklch(0.55 0.02 259); }

/* ---------- Painel direito: formulário ---------- */
.auth-form-panel {
    flex: 1;
    min-width: 0;
    background: var(--auth-bg-right);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

.auth-form-inner {
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    display: flex;
    align-items: center;
    margin-bottom: 48px;
}

.auth-logo {
    height: 30px;
    width: auto;
    max-width: 100%;
}

.auth-heading {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--auth-text-primary);
}

.auth-subtitle {
    font-size: 14.5px;
    color: var(--auth-text-secondary);
    margin: 0 0 32px;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-field .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-field input {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 999px;
    padding: 0 20px;
    background: var(--auth-input-bg);
    color: var(--auth-input-text);
    font-size: 14.5px;
    font-family: inherit;
    transition: box-shadow 180ms ease-out;
}

.auth-field input::placeholder { color: oklch(0.6 0.02 259); }

.auth-field input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px oklch(0.55 0.19 259 / 45%);
}

.auth-field-password { position: relative; }

.auth-toggle-password {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: oklch(0.5 0.02 259);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease-out, color 150ms ease-out;
}

.auth-toggle-password:hover { background: oklch(0.9 0.01 259); color: oklch(0.35 0.02 259); }

.auth-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 999px;
    background: var(--auth-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: background 150ms ease-out, transform 150ms ease-out;
}

.auth-submit:hover { background: var(--auth-accent-hover); }
.auth-submit:active { background: var(--auth-accent-active); transform: scale(0.99); }

.auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px oklch(0.7 0.12 259 / 50%);
}

.auth-hint {
    text-align: center;
    font-size: 13px;
    color: var(--auth-text-secondary);
    margin: 24px 0 0;
}

.auth-alert {
    background: oklch(0.32 0.11 25 / 55%);
    border: 1px solid oklch(0.5 0.15 25 / 45%);
    color: oklch(0.92 0.05 20);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    margin-bottom: 20px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
    .auth-illustration { display: none; }
    .auth-form-panel { background: var(--auth-bg-base); }
}

@media (max-width: 420px) {
    .auth-form-panel { padding: 40px 20px; }
    .auth-heading { font-size: 24px; }
    .auth-logo { height: 26px; }
    .auth-brand { margin-bottom: 36px; }
}