/* =============================================================================
   auth.css - Estilos compartilhados das telas públicas de autenticação
   =============================================================================
   
   Páginas que consomem:
     - public/login.php
     - public/cadastro.php
     - public/recuperar-senha.php
     - public/redefinir-senha.php
     - public/verificar-email.php (página de status)
   
   Layout: split-screen 50/50 (mobile: stack vertical).
     - Lado esquerdo: branding com gradiente verde-esmeralda + tagline
     - Lado direito: card branco com formulário (Inter)
   
   Paleta alinhada à landing page (assets/css/landing.css):
     --auth-primary       verde-esmeralda  #0D9F6E
     --auth-primary-deep  verde escuro     #052e1e
     --auth-accent        dourado          #f0b429
   
   Dark mode via [data-theme="dark"] herdando core-theme.css.
============================================================================= */

:root {
    --auth-primary:        #0D9F6E;
    --auth-primary-hover:  #0a8a5d;
    --auth-primary-deep:   #052e1e;
    --auth-accent:         #f0b429;
    --auth-bg:             #fafafa;
    --auth-card-bg:        #ffffff;
    --auth-text:           #111827;
    --auth-text-soft:      #6b7280;
    --auth-text-muted:     #9ca3af;
    --auth-border:         #e5e7eb;
    --auth-border-strong:  #d1d5db;
    --auth-input-bg:       #ffffff;
    --auth-input-focus:    #ecfdf5;
    --auth-error-bg:       #fef2f2;
    --auth-error-border:   #fecaca;
    --auth-error-text:     #991b1b;
    --auth-success-bg:     #ecfdf5;
    --auth-success-border: #a7f3d0;
    --auth-success-text:   #065f46;
    --auth-warning-bg:     #fffbeb;
    --auth-warning-border: #fde68a;
    --auth-warning-text:   #78350f;
    --auth-shadow:         0 4px 12px rgba(0, 0, 0, 0.06);
    --auth-shadow-lg:      0 12px 32px rgba(0, 0, 0, 0.08);
    --auth-radius:         12px;
}

[data-theme="dark"] {
    --auth-bg:             #0a0a0a;
    --auth-card-bg:        #18181b;
    --auth-text:           #f9fafb;
    --auth-text-soft:      #d1d5db;
    --auth-text-muted:     #9ca3af;
    --auth-border:         #27272a;
    --auth-border-strong:  #3f3f46;
    --auth-input-bg:       #1f1f23;
    --auth-input-focus:    #064e3b;
    --auth-error-bg:       rgba(239, 68, 68, 0.1);
    --auth-error-border:   rgba(239, 68, 68, 0.3);
    --auth-error-text:     #fca5a5;
    --auth-success-bg:     rgba(16, 185, 129, 0.1);
    --auth-success-border: rgba(16, 185, 129, 0.3);
    --auth-success-text:   #6ee7b7;
    --auth-warning-bg:     rgba(245, 158, 11, 0.1);
    --auth-warning-border: rgba(245, 158, 11, 0.3);
    --auth-warning-text:   #fcd34d;
}

/* ---------- Reset e base ---------- */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--auth-text);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--auth-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout split-screen ---------- */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-side {
    position: relative;
    background: linear-gradient(135deg, #052e1e 0%, #0D9F6E 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-side::before {
    content: '';
    position: absolute;
    top: -160px;
    right: -160px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 180, 41, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.auth-side__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.auth-side__brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--auth-accent);
    color: var(--auth-primary-deep);
    font-weight: 800;
    font-size: 18px;
}

.auth-side__brand-img {
    height: 40px;
    width: auto;
    max-width: 220px;
    display: block;
}

.auth-side__content { position: relative; z-index: 1; max-width: 440px; }

.auth-side__title {
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.auth-side__sub {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.92;
    margin: 0 0 32px 0;
}

.auth-side__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.auth-side__features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.92);
}

.auth-side__features li::before {
    content: '✓';
    color: var(--auth-accent);
    font-weight: 700;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(240, 180, 41, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.auth-side__footer {
    position: relative;
    z-index: 1;
    font-size: 13px;
    opacity: 0.7;
}
.auth-side__footer a { color: rgba(255, 255, 255, 0.92); }

/* ---------- Painel direito (formulário) ---------- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--auth-bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius);
    padding: 40px 36px;
    box-shadow: var(--auth-shadow-lg);
    border: 1px solid var(--auth-border);
}

.auth-card__title {
    margin: 0 0 6px 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--auth-text);
}

.auth-card__sub {
    margin: 0 0 28px 0;
    color: var(--auth-text-soft);
    font-size: 15px;
    line-height: 1.5;
}

/* ---------- Form fields ---------- */
.auth-form { display: grid; gap: 18px; }

.field { display: grid; gap: 6px; }
.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text);
    letter-spacing: -0.01em;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--auth-border-strong);
    border-radius: 8px;
    background: var(--auth-input-bg);
    color: var(--auth-text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(13, 159, 110, 0.15);
}

.field input[aria-invalid="true"] {
    border-color: var(--auth-error-text);
}

.field__hint {
    font-size: 12px;
    color: var(--auth-text-muted);
    line-height: 1.4;
    margin: 0;
}

.field__error {
    font-size: 13px;
    color: var(--auth-error-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Honeypot — visualmente invisível mas presente para bots */
.field--honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Barra visual de força de senha (informativa) */
.password-strength {
    height: 4px;
    background: var(--auth-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}
.password-strength__bar {
    height: 100%;
    width: 0;
    background: var(--auth-error-text);
    border-radius: 2px;
    transition: width 200ms ease, background 200ms ease;
}
.password-strength--weak   .password-strength__bar { width: 33%; background: #ef4444; }
.password-strength--medium .password-strength__bar { width: 66%; background: #f59e0b; }
.password-strength--strong .password-strength__bar { width: 100%; background: var(--auth-primary); }

.password-strength__label {
    font-size: 12px;
    color: var(--auth-text-muted);
    margin-top: 4px;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--auth-error-text, #b91c1c);
    margin-top: 4px;
}

/* Checkbox aceite */
.field--check {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    display: flex;
}
.field--check input { margin-top: 3px; }
.field--check label {
    font-size: 13px;
    font-weight: 400;
    color: var(--auth-text-soft);
    line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn-primary {
    width: 100%;
    padding: 13px 16px;
    background: var(--auth-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease, transform 80ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover  { background: var(--auth-primary-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
    background: var(--auth-border-strong);
    cursor: not-allowed;
    transform: none;
}
.btn-primary[data-loading="true"] {
    color: transparent;
    pointer-events: none;
    position: relative;
}
.btn-primary[data-loading="true"]::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-secondary {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: var(--auth-text);
    border: 1px solid var(--auth-border-strong);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}
.btn-secondary:hover {
    background: var(--auth-bg);
    border-color: var(--auth-primary);
    text-decoration: none;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}
.alert--error   { background: var(--auth-error-bg);   border-color: var(--auth-error-border);   color: var(--auth-error-text); }
.alert--success { background: var(--auth-success-bg); border-color: var(--auth-success-border); color: var(--auth-success-text); }
.alert--warning { background: var(--auth-warning-bg); border-color: var(--auth-warning-border); color: var(--auth-warning-text); }
.alert__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Links de rodapé do card ---------- */
.auth-card__footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-border);
    text-align: center;
    font-size: 14px;
    color: var(--auth-text-soft);
}
.auth-card__footer a { font-weight: 600; }

/* ---------- Painel "status" para verificar-email/sucesso ---------- */
.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
    background: var(--auth-bg);
}
.auth-status__card {
    max-width: 480px;
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius);
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--auth-shadow-lg);
    border: 1px solid var(--auth-border);
}
.auth-status__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 28px;
}
.auth-status__icon--success { background: var(--auth-success-bg); color: var(--auth-success-text); }
.auth-status__icon--error   { background: var(--auth-error-bg);   color: var(--auth-error-text);   }
.auth-status__icon--info    { background: var(--auth-success-bg); color: var(--auth-primary);      }
.auth-status__title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.auth-status__text {
    margin: 0 0 24px 0;
    color: var(--auth-text-soft);
    font-size: 15px;
    line-height: 1.6;
}
.auth-status__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side {
        padding: 32px 24px;
        min-height: auto;
    }
    .auth-side::before { display: none; }
    .auth-side__title  { font-size: 22px; }
    .auth-side__sub    { font-size: 14px; margin-bottom: 20px; }
    .auth-side__features li { font-size: 14px; }
    .auth-side__footer { display: none; }
    .auth-panel { padding: 32px 16px; }
    .auth-card  { padding: 32px 24px; }
}
