/* ============================================================
   auth.css — Tela de autenticação (login / registro)
   ============================================================ */

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --font:         'Inter', system-ui, -apple-system, sans-serif;

    /* Dark (default para auth) */
    --bg:           #080f1e;
    --card-bg:      rgba(255,255,255,0.04);
    --card-border:  rgba(255,255,255,0.10);
    --text-1:       #f1f5f9;
    --text-2:       #94a3b8;
    --accent:       #3b82f6;
    --accent-glow:  rgba(59,130,246,0.35);
    --accent-hover: #2563eb;
    --input-bg:     rgba(255,255,255,0.06);
    --input-border: rgba(255,255,255,0.12);
    --input-focus:  #3b82f6;
    --error:        #ef4444;
    --success:      #10b981;

    --radius-card:  20px;
    --radius-input: 10px;
    --radius-btn:   10px;
    --transition:   0.2s ease;
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    overflow-x: hidden;
}

/* ── Background orbs ─────────────────────────────────────── */
.auth-bg {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    overflow: hidden;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: orb-float 8s ease-in-out infinite;
}
.auth-orb--1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #3b82f6, transparent 70%);
    top: -15%; left: -10%;
    animation-delay: 0s;
}
.auth-orb--2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -10%; right: -5%;
    animation-delay: -3s;
}
.auth-orb--3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    top: 50%; left: 60%;
    animation-delay: -6s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -40px) scale(1.05); }
    66%       { transform: translate(-20px, 30px) scale(0.97); }
}

/* ── Container ───────────────────────────────────────────── */
.auth-container {
    position: relative; z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

/* ── Card ────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.45);
    animation: card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Logo ────────────────────────────────────────────────── */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
}
.auth-logo__icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.auth-logo__icon-svg { width: 48px; height: 48px; display: block; }
.auth-logo__text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Tabs ────────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    position: relative;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.75rem;
    border: 1px solid var(--card-border);
}
.auth-tab {
    flex: 1;
    position: relative; z-index: 1;
    background: none;
    border: none;
    color: var(--text-2);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 7px;
    cursor: pointer;
    transition: color var(--transition);
}
.auth-tab--active { color: var(--text-1); }
.auth-tab-indicator {
    position: absolute;
    top: 4px; left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(255,255,255,0.08);
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Form ────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.375rem; }

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-2);
    letter-spacing: 0.01em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 0.875rem;
    width: 16px; height: 16px;
    color: var(--text-2);
    pointer-events: none;
    flex-shrink: 0;
}
.form-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-input);
    color: var(--text-1);
    font-family: var(--font);
    font-size: 0.9375rem;
    padding: 0.6875rem 2.75rem 0.6875rem 2.75rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-input::placeholder { color: var(--text-2); opacity: 0.6; }
.form-input:focus {
    border-color: var(--input-focus);
    background: rgba(59,130,246,0.06);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.input-toggle-pass {
    position: absolute; right: 0.75rem;
    background: none; border: none;
    cursor: pointer; padding: 4px;
    color: var(--text-2); opacity: 0.6;
    transition: opacity var(--transition);
    display: flex; align-items: center;
}
.input-toggle-pass svg { width: 16px; height: 16px; }
.input-toggle-pass:hover { opacity: 1; }

/* ── Password strength ───────────────────────────────────── */
.password-strength {
    margin-top: 0.25rem;
    display: flex; align-items: center; gap: 0.5rem;
    min-height: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-2);
}
.ps-bar {
    height: 3px;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    flex-shrink: 0;
}

/* ── Alerts ──────────────────────────────────────────────── */
.form-error, .form-success {
    font-size: 0.8125rem;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    line-height: 1.5;
}
.form-error   { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.form-success { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }

/* ── Button ──────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: var(--font); font-size: 0.9375rem; font-weight: 600;
    border: none; border-radius: var(--radius-btn);
    cursor: pointer; padding: 0.75rem 1.5rem;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    user-select: none; text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #4f46e5 100%);
    box-shadow: 0 6px 24px rgba(59,130,246,0.45);
}

.btn-full { width: 100%; margin-top: 0.5rem; }

.btn-google {
    background: rgba(255,255,255,0.92);
    color: #1f2937;
    border: 1px solid rgba(255,255,255,0.15);
}
.btn-google:hover:not(:disabled) {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.google-icon { flex-shrink: 0; }

/* ── Divider ─────────────────────────────────────────────── */
.auth-divider {
    display: flex; align-items: center; gap: 0.75rem;
    margin: 0.25rem 0;
    color: var(--text-2);
    font-size: 0.75rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

/* ── Spinner ─────────────────────────────────────────────── */
.btn-spinner { display: inline-flex; align-items: center; }
.btn-spinner[hidden] { display: none !important; }
.spinner {
    width: 20px; height: 20px;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────────────── */
.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-2);
    opacity: 0.5;
    text-align: center;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card { padding: 2rem 1.25rem; }
}

/* ── Páginas legais (Privacidade / Termos) ──────────────────── */
.legal-container {
    position: relative; z-index: 1;
    display: flex; justify-content: center;
    min-height: 100vh;
    padding: 3rem 1.5rem;
}
.legal-card {
    width: 100%;
    max-width: 760px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    padding: 2.75rem 3rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.45);
    line-height: 1.7;
}
.legal-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.legal-card .legal-updated {
    font-size: 0.8125rem;
    color: var(--text-2);
    opacity: 0.7;
    margin-bottom: 2rem;
}
.legal-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--text-1);
}
.legal-card p, .legal-card li { color: var(--text-2); font-size: 0.9375rem; }
.legal-card ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.legal-card li { margin-bottom: 0.375rem; }
.legal-card a { color: var(--accent); text-decoration: none; }
.legal-card a:hover { text-decoration: underline; }
.legal-back {
    display: inline-block;
    margin-top: 2.5rem;
    font-size: 0.875rem;
    color: var(--text-2);
}
@media (max-width: 480px) {
    .legal-card { padding: 2rem 1.5rem; }
}
