/* ══════════════════════════════════════════════════════════════
   Portal GSZ Admin — Login CSS v2.3 (MOBILE-FIRST)
   v2.3 — marca no topo do formulário, distribuição vertical do showcase
          e painel mais largo em monitor grande (menos vazio).
   
   Reescrito a partir do v2.1. Nenhuma classe foi removida — o HTML
   continua idêntico. O que mudou:
     · Base agora é o CELULAR; o split-screen entra a partir de 900px
     · Inputs 16px (impede o zoom automático do iOS ao focar)
     · 100dvh + safe-area-inset (barra do navegador e notch)
     · Alvos de toque de 44px+ (botão de senha e CTA)
     · Partículas e backdrop-filter só no desktop (bateria/frame rate)
     · Blocos responsivos unificados — acabou a briga 820/480 × 900/560
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-blue:     #1e3a8a;
    --primary-light:    #3b82f6;
    --primary-lighter:  #60a5fa;
    --aia-teal:         #14b8a6;
    --aia-teal-dark:    #0f766e;
    --aia-green:        #4ade80;
    --gray-50:          #f8fafc;
    --gray-100:         #f1f5f9;
    --gray-200:         #e2e8f0;
    --gray-300:         #cbd5e1;
    --gray-400:         #94a3b8;
    --gray-500:         #64748b;
    --gray-600:         #475569;
    --gray-700:         #334155;
    --gray-800:         #1e293b;
    --gray-900:         #0f172a;
    --error-red:        #ef4444;
    --error-dark:       #b91c1c;
    --success-green:    #10b981;
    --white:            #ffffff;

    --radius-sm:        10px;
    --radius-md:        12px;
    --radius-lg:        18px;
    --radius-full:      9999px;

    --shadow-sm:        0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:        0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg:        0 16px 40px rgba(0,0,0,0.18);
    --shadow-focus:     0 0 0 3px rgba(20,184,166,0.18);

    --transition:       0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-fast:  0.2s ease;
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT — MOBILE: uma coluna, formulário primeiro
   ══════════════════════════════════════════════════════════════ */
.login-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ══════════════════════════════════════════════════════════════
   AUTH PANEL — no celular vem primeiro e ocupa a dobra inteira
   ══════════════════════════════════════════════════════════════ */
.auth-panel {
    order: 1;
    background: var(--white);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    padding: calc(26px + env(safe-area-inset-top)) 20px 28px;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--primary-blue) 0%,
        var(--primary-light) 50%,
        var(--aia-teal) 100%);
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.auth-brand-logo {
    height: 30px;
    width: auto;
    flex-shrink: 0;
}
.auth-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.auth-brand-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}
.auth-brand-sub {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.auth-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--success-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.auth-security-badge .secure-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--success-green);
    animation: pulse-secure 2s ease-in-out infinite;
}
@keyframes pulse-secure {
    0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}

.auth-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.auth-header { margin-bottom: 24px; }

.auth-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.6px;
    line-height: 1.15;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
    line-height: 1.45;
}

/* ── Formulário ── */
.login-form { display: flex; flex-direction: column; }

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

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.label-icon {
    width: 14px; height: 14px;
    color: var(--aia-teal);
    flex-shrink: 0;
}

/* 16px é obrigatório: abaixo disso o iOS dá zoom ao focar o campo. */
.form-input {
    width: 100%;
    padding: 15px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-800);
    background: var(--gray-50);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast),
                background var(--transition-fast),
                box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}
.form-input::placeholder { color: var(--gray-400); font-weight: 400; }
.form-input:hover:not(:focus) {
    border-color: var(--gray-300);
    background: var(--white);
}
.form-input:focus {
    border-color: var(--aia-teal);
    background: var(--white);
    box-shadow: var(--shadow-focus);
}
.form-input.input-error {
    border-color: var(--error-red);
    background: rgba(239,68,68,0.03);
}
.form-input.input-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--gray-400);
    font-weight: 500;
}

.password-wrapper { position: relative; }
.password-wrapper .form-input { padding-right: 52px; }

/* Alvo de toque de 44px — o mínimo confortável no celular. */
.toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    border-radius: 8px;
    color: var(--gray-400);
    transition: background var(--transition-fast), color var(--transition-fast);
    line-height: 1;
}
.toggle-password:hover { background: var(--gray-100); color: var(--gray-600); }
.toggle-password:active { background: var(--gray-200); }

/* ── Botão login ── */
.login-button {
    width: 100%;
    min-height: 52px;
    margin-top: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--aia-teal) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(20,184,166,0.3);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.login-button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.login-button:active:not(:disabled) {
    transform: scale(0.985);
    box-shadow: 0 4px 12px rgba(20,184,166,0.2);
}
.login-button:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    box-shadow: none; transform: none;
}
.login-button:disabled::after { display: none; }

.loading-spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-message {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(239,68,68,0.07);
    border: 1.5px solid rgba(239,68,68,0.35);
    border-left: 4px solid var(--error-red);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--error-dark);
    animation: slideDown 0.25s ease;
}
.error-message::before { content: '⚠ '; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Rodapé do painel ── */
.auth-footer {
    padding-top: 20px;
    margin-top: 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-trust-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: var(--gray-500);
    font-weight: 600;
}
.trust-item svg {
    width: 12px; height: 12px;
    color: var(--success-green);
    flex-shrink: 0;
}

.auth-version-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.auth-company {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-version {
    font-size: 10.5px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--aia-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════════════════════════════
   SHOWCASE — no celular é a marca enxuta, abaixo do formulário
   ══════════════════════════════════════════════════════════════ */
.showcase {
    order: 2;
    position: relative;
    overflow: hidden;
    color: var(--white);
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    background:
        linear-gradient(135deg,
            var(--primary-blue)  0%,
            #1d4ed8             45%,
            var(--aia-teal-dark) 100%);
    display: flex;
    flex-direction: column;
}

.showcase::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(74,222,128,0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 80%, rgba(59,130,246,0.14) 0%, transparent 55%);
    pointer-events: none;
}

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

/* Partículas animadas: desktop apenas (no celular só gastam bateria). */
.bg-particles { display: none; }

.showcase-topbar {
    display: flex;
    justify-content: flex-start;
}

.admin-pill-light {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(20,184,166,0.18);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(20,184,166,0.4);
}
.admin-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--aia-green);
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(74,222,128,0.7);
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.8); }
}

.showcase-hero { margin: 18px 0 20px; }

.support-logos {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-full);
    margin-bottom: 18px;
}
.support-logos img {
    height: 20px;
    width: auto;
    opacity: 0.9;
}
.support-logos .divider {
    width: 1px; height: 16px;
    background: rgba(255,255,255,0.25);
}
.support-logos .label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.hero-master {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.4px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #a5f3fc 60%, #5eead4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub-headline {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    line-height: 1.3;
    letter-spacing: -0.3px;
}

/* Descrição longa e bento de features: só quando há espaço (tablet+). */
.hero-description { display: none; }
.features-grid { display: none; }

.feature-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: background var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast);
    cursor: default;
}

.feature-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(20,184,166,0.25), rgba(59,130,246,0.18));
    border: 1px solid rgba(20,184,166,0.3);
    border-radius: 9px;
    margin-bottom: 10px;
    color: var(--white);
}
.feature-icon svg { width: 18px; height: 18px; }

.feature-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3px;
    letter-spacing: -0.2px;
}
.feature-desc {
    font-size: 11.5px;
    line-height: 1.4;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

.showcase-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.showcase-footer .aia-credit strong {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   ≥ 600px — celular grande / tablet retrato
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
    .auth-panel { padding: calc(32px + env(safe-area-inset-top)) 40px 32px; }
    .auth-brand-logo { height: 34px; }
    .auth-brand-name { font-size: 15px; }
    .auth-title { font-size: 28px; }
    .showcase   { padding: 34px 40px calc(32px + env(safe-area-inset-bottom)); }
    .hero-master { font-size: 52px; letter-spacing: -1.8px; }
    .hero-sub-headline { font-size: 19px; }

    .hero-description {
        display: block;
        font-size: 14.5px;
        line-height: 1.6;
        color: rgba(255,255,255,0.8);
        font-weight: 500;
        max-width: 620px;
        margin-top: 12px;
    }
    .hero-description strong { color: var(--aia-green); font-weight: 700; }

    .features-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 24px 0 22px;
    }

    .showcase-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: wrap;
        font-size: 12px;
    }
    .auth-trust-row { justify-content: space-between; }
}

/* ══════════════════════════════════════════════════════════════
   ≥ 900px — split screen (showcase à esquerda, form à direita)
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
    body { overflow: hidden; }

    .login-shell {
        display: grid;
        grid-template-columns: 1fr 400px;
        height: 100vh;
        height: 100dvh;
    }

    .auth-panel {
        order: 2;
        min-height: 0;
        height: 100%;
        padding: 32px 40px;
        justify-content: space-between;
        box-shadow: -20px 0 60px rgba(0,0,0,0.08);
        overflow-y: auto;
    }

    .showcase {
        order: 1;
        height: 100%;
        padding: 40px 44px 32px;
        overflow: hidden;
    }
    .showcase-topbar { justify-content: flex-end; }
    /* hero e features formam um bloco só, centrado verticalmente:
       acaba o buraco entre a descrição e os cards. */
    .showcase-hero   { margin: auto 0 30px; max-width: 760px; }

    .bg-particles {
        display: block;
        position: absolute; inset: 0;
        pointer-events: none;
        overflow: hidden;
    }
    .bg-particles span {
        position: absolute;
        border-radius: 50%;
        background: rgba(255,255,255,0.04);
        animation: float linear infinite;
    }
    .bg-particles span:nth-child(1) { width:180px; height:180px; top:-50px;  left:8%;   animation-duration:20s; }
    .bg-particles span:nth-child(2) { width:90px;  height:90px;  top:18%;   right:12%; animation-duration:14s; animation-delay:-4s; }
    .bg-particles span:nth-child(3) { width:130px; height:130px; bottom:10%; left:6%;   animation-duration:22s; animation-delay:-8s; }
    .bg-particles span:nth-child(4) { width:70px;  height:70px;  bottom:32%; right:8%;  animation-duration:12s; animation-delay:-2s; }
    .bg-particles span:nth-child(5) { width:240px; height:240px; top:45%;   left:40%;  animation-duration:28s; animation-delay:-10s; opacity:0.4; }
    .bg-particles span:nth-child(6) { width:50px;  height:50px;  top:65%;   right:35%; animation-duration:10s; animation-delay:-5s; }

    @keyframes float {
        0%   { transform: translateY(0) rotate(0deg); }
        50%  { transform: translateY(-30px) rotate(180deg); }
        100% { transform: translateY(0) rotate(360deg); }
    }

    .support-logos {
        gap: 14px;
        padding: 8px 16px;
        margin-bottom: 22px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .support-logos img { height: 22px; }
    .support-logos .label { font-size: 10.5px; }

    .hero-master { font-size: 64px; letter-spacing: -2px; margin-bottom: 14px; }
    .hero-sub-headline { font-size: 20px; margin-bottom: 16px; }
    .hero-description { font-size: 15px; margin-top: 0; }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        max-width: 860px;
        margin: 0 0 auto;
    }
    .feature-card { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
    .feature-card:hover {
        background: rgba(255,255,255,0.10);
        border-color: rgba(20,184,166,0.4);
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    }

    .showcase-footer { padding-top: 18px; }

    .login-button:hover:not(:disabled)::after { transform: translateX(100%); }
    .login-button:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px rgba(20,184,166,0.4);
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--aia-green) 100%);
    }
    .form-input:focus { transform: translateY(-1px); }
}

/* ══════════════════════════════════════════════════════════════
   ≥ 1280px — folga extra em monitor grande
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
    .login-shell { grid-template-columns: 1fr 460px; }
    .auth-panel  { padding: 36px 52px; }
    .showcase    { padding: 44px 56px 36px; }
    .hero-master { font-size: 72px; letter-spacing: -2.2px; }
    .hero-sub-headline { font-size: 22px; }
    .features-grid { max-width: 980px; }
}

/* O formulário não precisa de mais que isso: em monitor muito alto,
   limita a coluna central e mantém a leitura confortável. */
@media (min-width: 900px) and (min-height: 900px) {
    .auth-content { flex: 0 1 auto; margin: auto 0; }
}

/* ══════════════════════════════════════════════════════════════
   Telas baixas (celular deitado / tablet paisagem)
   ══════════════════════════════════════════════════════════════ */
@media (max-height: 620px) and (min-width: 900px) {
    body { overflow: auto; }
    .login-shell { height: auto; min-height: 100vh; }
    .auth-panel  { height: auto; }
    .showcase    { height: auto; }
    .showcase-hero { margin: 24px 0 20px; }
    .hero-master { font-size: 46px; }
}

/* ══════════════════════════════════════════════════════════════
   Acessibilidade
   ══════════════════════════════════════════════════════════════ */
.form-input:focus-visible,
.login-button:focus-visible,
.toggle-password:focus-visible {
    outline: 2px solid var(--aia-teal);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
