/* ============================================================
   InfinityCharge — site.css
   Auth layout inside marketing shell (header + footer).
   Adaptado do InfinityID → Emerald Light.
   Variáveis: critical.css (:root)
   Fontes: Plus Jakarta Sans (body) + Bricolage Grotesque (headings)
   Deferido via Optimizer::css() no layouts/main.php
   ============================================================ */

/* ============================================================
   AUTH MAIN — wrapper entre header e footer
   ============================================================ */

.auth-main {
    padding-top: 72px; /* altura do header fixo */
}

/* ============================================================
   AUTH LAYOUT — CSS Grid
   Desktop: 2 colunas (identity/brand à esquerda, form à direita)
   Mobile:  3 linhas  (identity → form → brand)

   Gradiente contínuo: background no .login-page cobre só a
   metade esquerda. Identity, brand e spacers são transparentes.
   ============================================================ */

.login-page {
    display:grid;
    grid-template-columns:1fr 1fr;
    grid-template-rows:1fr auto auto 1fr;
    grid-template-areas:
        ".        form"
        "identity form"
        "brand    form"
        ".        form";
    width:100%;
    min-height:calc(100vh - 72px);
    /* Coluna esquerda uniforme — blobs fornecem variação orgânica */
    background: var(--bg-primary);
}

/* Spacer rows: gradiente vertical suaviza entrada e saída */
.login-page::before, .login-page::after {
    content:'';
    min-height: 80px;
}
.login-page::before {
    grid-column:1; grid-row:1;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
}
.login-page::after {
    grid-column:1; grid-row:4;
    background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-primary));
}

/* --- Identity: logo + nome --- */
.login-identity {
    grid-area:identity;
    display:flex; align-items:flex-end; justify-content:center;
    padding:0 3rem 1.5rem;
    background: var(--bg-secondary);
}

/* --- Brand: headline, subtitle, features, blobs --- */
.login-brand {
    grid-area:brand;
    display:flex; flex-direction:column; justify-content:flex-start;
    align-items:center; padding:0 3rem 0; position:relative;
    background: var(--bg-secondary);
}
.brand-blobs { position:absolute; inset:-120px 0; pointer-events:none; }
.blob {
    position:absolute; border-radius:50%; filter:blur(120px);
    opacity:0.05; animation:blobFloat 14s ease-in-out infinite;
}
.blob:nth-child(1) { width:500px; height:500px; background:var(--accent); top:-120px; left:-120px; }
.blob:nth-child(2) { width:400px; height:400px; background:var(--accent-secondary); bottom:-100px; right:-100px; animation-delay:-5s; }
.blob:nth-child(3) { width:300px; height:300px; background:#34d399; top:50%; left:50%; transform:translate(-50%,-50%); animation-delay:-9s; }
@keyframes blobFloat {
    0%,100% { transform:translate(0,0) scale(1); }
    33% { transform:translate(30px,-25px) scale(1.06); }
    66% { transform:translate(-20px,15px) scale(0.94); }
}

.brand-content { position:relative; z-index:2; text-align:center; max-width:480px; }
.brand-logo { display:flex; align-items:center; gap:12px; justify-content:center; }
.logo-mark {
    width:52px; height:52px; background:var(--gradient-accent); border-radius:16px;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 8px 32px var(--accent-glow-strong);
}
.logo-mark::after { content:'∞'; font-size:1.8rem; color:#fff; font-weight:800; }
.logo-text {
    font-family:'Bricolage Grotesque',sans-serif; font-weight:800;
    font-size:1.8rem; color:var(--text-primary);
}
.logo-text em { font-style:normal; color:var(--accent); }

.brand-headline {
    font-size:clamp(1.6rem,3vw,2.4rem); font-weight:800;
    line-height:1.15; margin-bottom:1rem; color:var(--text-primary);
}
.brand-headline .accent {
    color:var(--accent); position:relative; display:inline-block;
}
.brand-headline .accent::after {
    content:''; position:absolute; bottom:2px; left:0; right:0;
    height:6px; background:var(--accent); opacity:0.15; border-radius:3px;
}
.brand-sub { font-size:0.95rem; color:var(--text-secondary); line-height:1.7; margin-bottom:3rem; }

.brand-features {
    display:flex; flex-direction:column; gap:0.85rem; text-align:left;
    background:var(--bg-card); border:1px solid var(--border-subtle);
    border-radius:20px; padding:1.75rem; box-shadow:var(--card-shadow);
}
.brand-feature {
    display:flex; align-items:center; gap:0.75rem;
    font-size:0.88rem; color:var(--text-secondary); line-height:1.5;
}
.brand-feature-icon {
    width:36px; height:36px; border-radius:10px;
    background:var(--accent-glow); border:1px solid rgba(5,150,105,0.12);
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; font-size:1rem;
}

/* --- Form panel --- */
.login-form-panel {
    grid-area:form; display:flex; flex-direction:column;
    justify-content:center; align-items:center; padding:3rem;
    position:relative; background:var(--bg-primary);
}
.form-container {
    width:100%; max-width:420px;
    animation:formSlideIn 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes formSlideIn {
    from { opacity:0; transform:translateY(20px); }
    to { opacity:1; transform:translateY(0); }
}

.form-header { margin-bottom:2rem; }
.form-header h1 { font-size:1.75rem; font-weight:800; margin-bottom:0.4rem; color:var(--text-primary); }
.form-header p { font-size:0.88rem; color:var(--text-secondary); }

/* Auth tabs */
.auth-tabs {
    display:flex; gap:4px; background:var(--bg-secondary);
    border:1px solid var(--border-subtle); border-radius:14px;
    padding:4px; margin-bottom:2rem;
}
.auth-tab {
    flex:1; padding:0.6rem 1rem; border-radius:11px;
    font-size:0.85rem; font-weight:600; text-align:center;
    cursor:pointer; transition:all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    color:var(--text-muted); border:none; background:transparent;
    font-family:inherit;
}
.auth-tab.active {
    background:var(--accent); color:#fff;
    box-shadow:0 4px 12px var(--accent-glow-strong);
}
.auth-tab:not(.active):hover { color:var(--text-secondary); background:var(--bg-card-hover); }

/* Social login */
.social-login { display:flex; gap:0.6rem; margin-bottom:1.5rem; }
.social-btn {
    flex:1; display:flex; align-items:center; justify-content:center;
    gap:0.5rem; padding:0.7rem; border-radius:12px;
    border:1px solid var(--border-subtle); background:var(--bg-card);
    cursor:pointer; font-family:inherit;
    font-size:0.8rem; font-weight:600; color:var(--text-secondary);
    transition:all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.social-btn:hover {
    border-color:var(--accent); color:var(--accent);
    background:var(--accent-glow); transform:translateY(-2px);
}
.social-btn svg { width:18px; height:18px; }

/* Divider */
.divider { display:flex; align-items:center; gap:1rem; margin-bottom:1.5rem; }
.divider::before, .divider::after { content:''; flex:1; height:1px; background:var(--border-subtle); }
.divider span { font-size:0.72rem; color:var(--text-muted); white-space:nowrap; }

/* Form panels */
.form-panel { display:none; }
.form-panel.active { display:block; animation:formSlideIn 0.4s cubic-bezier(0.34,1.56,0.64,1); }

/* Form footer */
.form-footer { text-align:center; margin-top:1.5rem; }
.form-footer p { font-size:0.8rem; color:var(--text-muted); }
.form-footer a { color:var(--accent); font-weight:600; }
.form-footer a:hover { text-decoration:underline; }

/* Password strength */
.password-strength { display:flex; gap:4px; margin-top:0.5rem; }
.strength-bar { flex:1; height:4px; border-radius:2px; background:var(--bg-secondary); transition:all 0.3s; }
.strength-bar.active { background:var(--accent); }
.strength-bar.warn { background:#f59e0b; }
.strength-bar.danger { background:#f43f5e; }
.strength-text { font-size:0.68rem; color:var(--text-muted); margin-top:0.3rem; }

/* Terms */
.terms-text { font-size:0.72rem; color:var(--text-muted); line-height:1.6; margin-top:1rem; text-align:center; }
.terms-text a { color:var(--accent); }
.terms-text a:hover { text-decoration:underline; }

/* ============================================================
   FORM COMPONENTS
   ============================================================ */

.field { margin-bottom:1rem; }
.field-label { display:flex; justify-content:space-between; align-items:center; margin-bottom:0.4rem; }
.field-label label { font-size:0.8rem; font-weight:600; color:var(--text-secondary); }
.field-label a { font-size:0.75rem; color:var(--accent); font-weight:500; transition:opacity 0.2s; }
.field-label a:hover { opacity:0.8; }
.field-input {
    width:100%; padding:0.75rem 1rem; border-radius:12px;
    border:1.5px solid var(--border-subtle); background:var(--bg-card);
    font-size:0.88rem; color:var(--text-primary); font-family:inherit;
    transition:all 0.25s; outline:none; box-sizing:border-box;
}
.field-input::placeholder { color:var(--text-muted); }
.field-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); background:var(--bg-card); }
.field-input:hover:not(:focus) { border-color:var(--border); }
.field-input[readonly] { background:var(--bg-secondary); color:var(--text-muted); cursor:not-allowed; }

.field-hint { font-size:0.72rem; color:var(--text-muted); margin-top:0.3rem; }
.field-error { display:block; font-size:0.75rem; color:#ef4444; margin-top:0.3rem; }
.field-input.has-error { border-color:#ef4444; }
.field-input.has-error:focus { box-shadow:0 0 0 3px rgba(239,68,68,0.1); }

.field-checkbox { display:flex; align-items:center; gap:0.6rem; margin:0.25rem 0; }
.field-checkbox input[type="checkbox"] { width:18px; height:18px; accent-color:var(--accent); border-radius:6px; cursor:pointer; }
.field-checkbox label { font-size:0.8rem; color:var(--text-secondary); cursor:pointer; margin-bottom:0; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-submit {
    width:100%; padding:0.85rem; border-radius:14px; border:none;
    background:var(--accent); color:#fff; font-family:inherit;
    font-size:0.9rem; font-weight:700; cursor:pointer;
    transition:all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    margin-top:0.5rem; box-shadow:0 4px 16px var(--accent-glow-strong);
}
.btn-submit:hover {
    background:var(--accent-hover);
    transform:translateY(-2px) scale(1.01);
    box-shadow:0 6px 24px var(--accent-glow-strong);
}
.btn-submit:active { transform:translateY(0) scale(0.99); }

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background:transparent; border:1.5px solid var(--border-subtle);
    color:var(--text-primary); padding:0.7rem 1.25rem; border-radius:12px;
    font-family:inherit; font-size:0.85rem; font-weight:600;
    cursor:pointer; transition:all 0.25s; display:inline-flex;
    align-items:center; justify-content:center; gap:0.5rem;
}
.btn-outline:hover { background:var(--bg-card-hover); border-color:var(--border); }

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */

.alert {
    position:relative; display:flex; align-items:flex-start; gap:0.6rem;
    padding:0.85rem 2.5rem 0.85rem 1rem; border-radius:12px;
    font-size:0.84rem; margin-bottom:1rem; line-height:1.5;
    border-left:4px solid transparent;
    transition:opacity 0.4s ease;
}
.alert-close {
    position:absolute; top:0.6rem; right:0.6rem;
    background:none; border:none; cursor:pointer;
    font-size:1.1rem; line-height:1; padding:0.15rem 0.3rem;
    border-radius:6px; opacity:0.5; transition:all 0.2s; color:inherit;
}
.alert-close:hover { opacity:1; background:rgba(0,0,0,0.08); }
.alert-error {
    background:#fef2f2; color:#991b1b;
    border-left-color:#ef4444; border-top:1px solid #fecaca;
    border-right:1px solid #fecaca; border-bottom:1px solid #fecaca;
}
.alert-success {
    background:#f0fdf4; color:#166534;
    border-left-color:#16a34a; border-top:1px solid #bbf7d0;
    border-right:1px solid #bbf7d0; border-bottom:1px solid #bbf7d0;
}
.alert-warning {
    background:#fffbeb; color:#92400e;
    border-left-color:#d97706; border-top:1px solid #fde68a;
    border-right:1px solid #fde68a; border-bottom:1px solid #fde68a;
}
.alert-info {
    background:#f0fdf4; color:#065f46;
    border-left-color:var(--accent); border-top:1px solid #a7f3d0;
    border-right:1px solid #a7f3d0; border-bottom:1px solid #a7f3d0;
}

/* ============================================================
   OTP / 2FA INPUT
   ============================================================ */

.otp-group { display:flex; gap:0.5rem; justify-content:center; margin:1.5rem 0; }
.otp-input {
    width:48px; height:56px; text-align:center; font-size:1.4rem;
    font-weight:700; border:1.5px solid var(--border-subtle); border-radius:12px;
    background:var(--bg-card); color:var(--text-primary); outline:none;
    font-family:'JetBrains Mono',monospace;
    transition:all 0.25s; -moz-appearance:textfield;
}
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.otp-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); }
.otp-input:not(:placeholder-shown) { border-color:var(--accent); }

/* ============================================================
   RECOVERY CODES
   ============================================================ */

.recovery-codes {
    display:grid; grid-template-columns:1fr 1fr;
    gap:0.5rem; margin:1rem 0; padding:1.25rem;
    background:var(--bg-secondary); border-radius:12px;
    border:1px solid var(--border-subtle);
}
.recovery-code {
    font-family:'JetBrains Mono',monospace; font-size:0.88rem;
    font-weight:600; color:var(--text-primary); padding:0.3rem 0;
    text-align:center; letter-spacing:0.05em;
}

/* ============================================================
   HELPERS
   ============================================================ */

.text-center { text-align:center; }
.text-muted { color:var(--text-muted); }
.text-sm { font-size:0.82rem; }
.text-xs { font-size:0.72rem; }
.link { color:var(--accent); text-decoration:none; font-size:0.82rem; font-weight:500; }
.link:hover { text-decoration:underline; }
.mt-1 { margin-top:0.75rem; }
.mt-2 { margin-top:1.5rem; }
.mb-1 { margin-bottom:0.75rem; }
.mb-2 { margin-bottom:1.5rem; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.auth-container { flex:1; display:flex; align-items:center; justify-content:center; padding:2rem; }

/* ============================================================
   RESPONSIVE — AUTH
   ============================================================ */

@media(max-width:960px) {
    .login-page {
        grid-template-columns:1fr;
        grid-template-rows:auto 1fr auto;
        grid-template-areas:
            "identity"
            "form"
            "brand";
        background:var(--bg-primary);
        min-height:auto;
    }
    .login-page::before, .login-page::after { display:none; }
    .login-identity {
        border-right:none; border-bottom:1px solid var(--border-subtle);
        padding:1.25rem; align-items:center;
        background:var(--bg-secondary);
    }
    .login-identity .logo-mark { width:40px; height:40px; border-radius:12px; }
    .login-identity .logo-mark::after { font-size:1.4rem; }
    .login-identity .logo-text { font-size:1.4rem; }
    .login-brand {
        border-right:none; border-top:1px solid var(--border-subtle);
        padding:2rem; min-height:auto;
        background:var(--bg-secondary);
        overflow:hidden;
    }
    .brand-blobs { inset:0; }
    .brand-headline { font-size:1.5rem; }
    .brand-features { display:none; }
    .brand-sub { margin-bottom:1.5rem; }
    .login-form-panel { padding:2rem; justify-content:flex-start; padding-top:2rem; }
}
@media(max-width:500px) {
    .social-login { flex-direction:column; }
    .otp-group { gap:0.35rem; }
    .otp-input { width:42px; height:50px; font-size:1.2rem; }
    .recovery-codes { grid-template-columns:1fr; }
}

/* ============================================================
   ERROR PAGE — Tela única centralizada
   ============================================================ */

.error-page {
    display:flex; flex-direction:column; align-items:center;
    justify-content:center; min-height:60vh;
    padding:2rem; text-align:center;
}
.error-page .brand-logo { margin-bottom:2.5rem; }
.error-emoji { font-size:4rem; line-height:1; margin-bottom:1.5rem; }
.error-code {
    font-size:5rem; font-weight:800; line-height:1;
    color:var(--accent); margin-bottom:0.5rem;
}
.error-title {
    font-size:1.5rem; font-weight:700;
    color:var(--text-primary); margin:0 0 0.75rem;
}
.error-description {
    font-size:1rem; color:var(--text-secondary);
    margin:0 0 2rem; max-width:400px;
}
.error-actions { display:flex; gap:0.75rem; justify-content:center; flex-wrap:wrap; }