/* ============================================
   Chronos Brasil — Design System
   Tokens, variáveis, tipografia, base reset
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&family=Nunito:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ---- CSS Custom Properties (Theme: Executivo Bancário - Default) ---- */
:root {
    /* Spacing (4px grid) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;
    --sp-20: 80px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-tooltip: 600;

    /* Typography Scale */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 22px;
    --text-3xl: 28px;
    --text-4xl: 36px;
    --text-5xl: 48px;
    --text-6xl: 64px;

    /* Line Heights */
    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;

    /* Font Weights */
    --font-light: 300;
    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* ---- Theme: Executivo Bancário (Default) ---- */
    --font-display: 'DM Sans', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Backgrounds */
    --bg-primary: #0A1628;
    --bg-secondary: #0F1D32;
    --bg-tertiary: #142540;
    --bg-card: rgba(20, 37, 64, 0.7);
    --bg-card-hover: rgba(25, 45, 75, 0.85);
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-glass: rgba(14, 26, 46, 0.65);

    /* Foreground */
    --fg-primary: #F0F4F8;
    --fg-secondary: #A8BDD4;
    --fg-muted: #6B8AAD;
    --fg-faint: #3D5A80;

    /* Accent Colors */
    --accent-primary: #3B82F6;
    --accent-primary-hover: #60A5FA;
    --accent-gold: #C9A44C;
    --accent-gold-hover: #D4B76A;

    /* Semantic */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* Dashboard Stats & Progress Colors */
    --stat-green: #34C759;
    --stat-green-light: #5AD8A6;
    --stat-green-bg: rgba(52, 199, 89, 0.12);
    --stat-green-border: rgba(52, 199, 89, 0.25);
    --stat-green-shadow: rgba(52, 199, 89, 0.15);

    --stat-orange: #FF9500;
    --stat-orange-light: #FFCC00;
    --stat-orange-bg: rgba(255, 149, 0, 0.12);
    --stat-orange-border: rgba(255, 149, 0, 0.25);
    --stat-orange-shadow: rgba(255, 149, 0, 0.15);

    --stat-red: #FF2D55;
    --stat-red-bg: rgba(255, 45, 85, 0.12);
    --stat-red-border: rgba(255, 45, 85, 0.25);
    --stat-red-shadow: rgba(255, 45, 85, 0.15);

    --stat-blue: #007AFF;
    --stat-blue-bg: rgba(0, 122, 255, 0.12);
    --stat-blue-border: rgba(0, 122, 255, 0.25);
    --stat-blue-shadow: rgba(0, 122, 255, 0.15);

    /* Badge Colors */
    --badge-nacional: #10B981;
    --badge-nacional-bg: rgba(16, 185, 129, 0.15);
    --badge-bancario: #3B82F6;
    --badge-bancario-bg: rgba(59, 130, 246, 0.15);
    --badge-facultativo: #F59E0B;
    --badge-facultativo-bg: rgba(245, 158, 11, 0.15);
    --badge-lunar: #A78BFA;
    --badge-lunar-bg: rgba(167, 139, 250, 0.15);
    --badge-estacao: #EC4899;
    --badge-estacao-bg: rgba(236, 72, 153, 0.15);
    --badge-especial: #F97316;
    --badge-especial-bg: rgba(249, 115, 22, 0.15);
    --badge-default: #6B7280;
    --badge-default-bg: rgba(107, 114, 128, 0.15);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --border-color-active: rgba(59, 130, 246, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
    --shadow-gold-glow: 0 0 20px rgba(201, 164, 76, 0.2);

    /* Glass Effect */
    --glass-blur: blur(20px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(14, 26, 46, 0.65);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #0A1628 0%, #1E3A5F 50%, #0F1D32 100%);
    --gradient-accent: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    --gradient-gold: linear-gradient(135deg, #C9A44C 0%, #D4B76A 50%, #C9A44C 100%);
    --gradient-card: linear-gradient(145deg, rgba(20, 37, 64, 0.8) 0%, rgba(15, 29, 50, 0.6) 100%);

    /* Calendar Day */
    --day-today-bg: rgba(59, 130, 246, 0.2);
    --day-today-border: rgba(59, 130, 246, 0.5);
    --day-weekend-opacity: 0.45;
    --day-holiday-bg: rgba(16, 185, 129, 0.1);
    --day-hover-bg: rgba(255, 255, 255, 0.05);

    /* Scrollbar */
    --scrollbar-track: rgba(0, 0, 0, 0.2);
    --scrollbar-thumb: rgba(255, 255, 255, 0.15);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.25);

    /* Content Width */
    --max-width: 1280px;
    --max-width-narrow: 960px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--fg-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--duration-slow) var(--ease-out),
                color var(--duration-slow) var(--ease-out);
}

/* ---- Scrollbar Custom ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ---- Selection ---- */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--fg-primary);
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    letter-spacing: -0.02em;
    line-height: var(--leading-tight);
    color: var(--fg-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
    color: var(--fg-secondary);
    line-height: var(--leading-relaxed);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
    color: var(--accent-primary-hover);
}

code, pre {
    font-family: var(--font-mono);
}

/* ---- Utility: Monospace for Data ---- */
.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ---- Layout ---- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--sp-6);
}

.container--narrow {
    max-width: var(--max-width-narrow);
}

.section {
    padding: var(--sp-16) 0;
}

.section__title {
    font-size: var(--text-3xl);
    margin-bottom: var(--sp-2);
}

.section__subtitle {
    font-size: var(--text-lg);
    color: var(--fg-muted);
    margin-bottom: var(--sp-8);
}

/* ---- Grid System ---- */
.grid {
    display: grid;
    gap: var(--sp-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }

/* ---- Flex Utilities ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

/* ---- Text Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--fg-muted); }
.text-faint { color: var(--fg-faint); }
.text-accent { color: var(--accent-primary); }
.text-gold { color: var(--accent-gold); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* ---- Visually Hidden (a11y) ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Gradient Text ---- */
.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-gold {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Main Content Area ---- */
.main-content {
    min-height: calc(100vh - 80px);
    padding-top: 80px; /* header height */
}

/* ---- Separator ---- */
.separator {
    height: 1px;
    background: var(--border-color);
    border: none;
    margin: var(--sp-8) 0;
}
