/* ============================================================
   DocSeguro — Design System
   Tema: Modern Security Startup (Light)
   Fontes: Inter (corpo) + JetBrains Mono (técnico)
   ============================================================ */

/* ---- Variáveis ---- */
:root {
    --bg-deep:      #f8fafc;
    --bg-surface:   #ffffff;
    --bg-raised:    #f1f5f9;
    --bg-overlay:   #e2e8f0;
    --border:       #e2e8f0;
    --border-light: #f1f5f9;

    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #64748b;

    --accent:         #4f46e5;
    --accent-hover:   #4338ca;
    --accent-dim:     #4338ca;
    --accent-glow:    rgba(79, 70, 229, 0.12);
    --accent-subtle:  rgba(79, 70, 229, 0.06);

    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --success-text:   #166534;

    --error:          #dc2626;
    --error-bg:       #fee2e2;
    --error-text:     #991b1b;

    --warning:        #d97706;
    --warning-bg:     #fef3c7;
    --warning-text:   #92400e;

    --info:           #2563eb;
    --info-bg:        #dbeafe;
    --info-text:      #1e40af;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-5:  1.25rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;

    --r-sm:   4px;
    --r-md:   6px;
    --r-lg:   12px;
    --r-xl:   16px;
    --r-full: 9999px;

    --shadow-sm:  0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);

    --transition:      150ms ease;
    --transition-slow: 300ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-deep);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img, svg { display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text-primary);
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
h4 { font-size: 0.9375rem; }
p  { color: var(--text-secondary); line-height: 1.7; }

code, .mono {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-raised);
    padding: 0.15em 0.4em;
    border-radius: var(--r-sm);
    color: var(--accent);
    border: 1px solid var(--border);
}

.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-muted); }
.text-error    { color: var(--error); }
.text-success  { color: var(--success); }
.text-mono     { font-family: var(--font-mono); }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only       { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sr-only-focusable:focus,
.sr-only-focusable:focus-within {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--accent);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 99999;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
}

/* ---- Layout ---- */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

.app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-8);
    height: 56px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.app-nav-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    text-decoration: none;
}

.app-nav-brand-icon {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
}

.app-nav-links a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 var(--sp-3);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
    white-space: nowrap;
}

.app-nav-links a:hover { color: var(--text-primary); }

.app-nav-links a.active { color: var(--text-primary); }

.app-nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--sp-3);
    right: var(--sp-3);
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

.app-nav-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.app-nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    text-transform: uppercase;
}

.app-main {
    flex: 1;
    padding: var(--sp-8);
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.page-header { margin-bottom: var(--sp-6); }
.page-header h1 { font-size: 1.375rem; margin-bottom: var(--sp-1); }
.page-header p  { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* ---- Auth ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
    background: var(--bg-deep);
    background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79,70,229,0.07) 0%, transparent 60%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-10) var(--sp-8);
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.3s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-8);
}

.auth-brand-icon {
    width: 38px;
    height: 38px;
    background: var(--accent);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-title    { font-size: 1.375rem; font-weight: 600; margin-bottom: var(--sp-2); color: var(--text-primary); }
.auth-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: var(--sp-6); }

.auth-footer-text {
    text-align: center;
    margin-top: var(--sp-5);
    font-size: 0.875rem;
    color: var(--text-muted);
}
.auth-footer-text a { color: var(--accent); font-weight: 500; }

/* ---- Alertas ---- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-size: 0.875rem;
    margin-bottom: var(--sp-5);
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-error   { background: var(--error-bg);   color: var(--error-text);   border-color: rgba(220,38,38,0.15); }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: rgba(22,163,74,0.15); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: rgba(217,119,6,0.15); }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border-color: rgba(37,99,235,0.15); }

/* ---- Badge — pílula ---- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2em 0.625em;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-success { background: var(--success-bg); color: var(--success-text); border-color: rgba(22,163,74,0.15); }
.badge-error   { background: var(--error-bg);   color: var(--error-text);   border-color: rgba(220,38,38,0.15); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); border-color: rgba(217,119,6,0.15); }
.badge-info    { background: var(--info-bg);    color: var(--info-text);    border-color: rgba(37,99,235,0.15); }
.badge-muted   { background: var(--bg-raised);  color: var(--text-secondary); border-color: var(--border); }
.badge-accent  { background: var(--accent-subtle); color: var(--accent); border-color: rgba(79,70,229,0.15); }

/* ---- Card ---- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }

/* ---- Divider ---- */
.divider { height: 1px; background: var(--border); margin: var(--sp-6) 0; }
