/* ========================================
   DIVITAE DESIGN SYSTEM v4.0
   Sistema de Design Unificado e Moderno
   ======================================== */

:root {
    /* ===== CORES PRINCIPAIS ===== */
    --accent-color: #fad02c;           /* Amarelo dourado principal */
    --secondary-accent: #1e90ff;       /* Azul secundário */
    --accent-hover: #f4d03f;           /* Amarelo hover */
    --secondary-hover: #4da6ff;        /* Azul hover */
    
    /* ===== NEUTRALS ===== */
    --gray-900: #212121;               /* Texto primário */
    --gray-800: #424242;               /* Texto secundário */
    --gray-700: #616161;               /* Texto terciário */
    --gray-600: #757575;               /* Placeholders */
    --gray-500: #9e9e9e;               /* Bordas médias */
    --gray-400: #bdbdbd;               /* Bordas claras */
    --gray-300: #e0e0e0;               /* Backgrounds claros */
    --gray-200: #eeeeee;               /* Backgrounds muito claros */
    --gray-100: #f5f5f5;               /* Backgrounds extremamente claros */
    --gray-50: #fafafa;                /* Backgrounds mais claros */
    
    /* ===== BACKGROUNDS ===== */
    --bg-primary: #ffffff;             /* Cards principais */
    --bg-secondary: #fafafa;           /* Backgrounds secundários */
    --bg-tertiary: #f5f5f5;            /* Backgrounds terciários */
    --bg-dark: linear-gradient(135deg, #121212, #1e1e1e, #0f0f0f);
    --bg-card: rgba(30, 30, 30, 0.85);
    --bg-overlay: rgba(20, 20, 20, 0.1);
    --bg-glass: rgba(255, 255, 255, 0.1);
    --bg-glass-dark: rgba(0, 0, 0, 0.1);
    
    /* ===== STATUS COLORS ===== */
    --success: #22c55e;                /* Verde aprovado */
    --success-light: #4ade80;          /* Verde claro */
    --success-dark: #16a34a;           /* Verde escuro */
    --warning: #fbbf24;                /* Amarelo pendente */
    --warning-light: #fcd34d;          /* Amarelo claro */
    --warning-dark: #f59e0b;           /* Amarelo escuro */
    --danger: #ef4444;                 /* Vermelho rejeitado */
    --danger-light: #f87171;           /* Vermelho claro */
    --danger-dark: #dc2626;            /* Vermelho escuro */
    --info: #3b82f6;                   /* Azul informativo */
    --info-light: #60a5fa;             /* Azul claro */
    --info-dark: #2563eb;              /* Azul escuro */
    
    /* ===== TYPOGRAPHY ===== */
    --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    
    /* ===== FONT SIZES ===== */
    --text-xs: 0.75rem;                /* 12px */
    --text-sm: 0.875rem;               /* 14px */
    --text-base: 1rem;                 /* 16px */
    --text-lg: 1.125rem;               /* 18px */
    --text-xl: 1.25rem;                /* 20px */
    --text-2xl: 1.5rem;                /* 24px */
    --text-3xl: 1.875rem;              /* 30px */
    --text-4xl: 2.25rem;               /* 36px */
    
    /* ===== SPACING ===== */
    --space-1: 0.25rem;                /* 4px */
    --space-2: 0.5rem;                 /* 8px */
    --space-3: 0.75rem;                /* 12px */
    --space-4: 1rem;                   /* 16px */
    --space-5: 1.25rem;                /* 20px */
    --space-6: 1.5rem;                 /* 24px */
    --space-8: 2rem;                   /* 32px */
    --space-10: 2.5rem;                /* 40px */
    --space-12: 3rem;                  /* 48px */
    --space-16: 4rem;                  /* 64px */
    --space-20: 5rem;                  /* 80px */
    
    /* ===== BORDER RADIUS ===== */
    --radius-sm: 6px;                  /* Elementos pequenos */
    --radius-md: 8px;                  /* Botões, inputs */
    --radius-lg: 12px;                 /* Cards */
    --radius-xl: 16px;                 /* Containers principais */
    --radius-2xl: 20px;                /* Containers grandes */
    --radius-full: 9999px;             /* Círculos */
    
    /* ===== SHADOWS ===== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(250, 208, 44, 0.3);
    
    /* ===== TRANSITIONS ===== */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* ===== Z-INDEX ===== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* ===== LAYOUT ===== */
    --sidebar-width: 280px;
    --header-height: 80px;
    --container-max-width: 1200px;
    --content-padding: 2rem;
    
    /* ===== BREAKPOINTS ===== */
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #2a2a2a;
    --gray-900: #ffffff;
    --gray-800: #e0e0e0;
    --gray-700: #a0a0a0;
    --gray-600: #808080;
    --gray-500: #606060;
    --gray-400: #404040;
    --gray-300: #333333;
    --gray-200: #2a2a2a;
    --gray-100: #1a1a1a;
    --gray-50: #0f0f0f;
}

/* ===== RESET E BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

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-base); }

p {
    margin-bottom: var(--space-4);
    color: var(--gray-700);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* ===== LAYOUT COMPONENTS ===== */

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

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

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

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

/* ===== CARD COMPONENTS ===== */

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--bg-tertiary);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--gray-200);
    background: var(--bg-tertiary);
}

/* Glass Card */
.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-card);
}

.card-glass:hover {
    box-shadow: var(--shadow-card-hover);
}

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

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.form-control {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--bg-primary);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(250, 208, 44, 0.1);
    background-color: var(--bg-primary);
}

.form-control::placeholder {
    color: var(--gray-500);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Floating Label Input */
.form-floating {
    position: relative;
    margin-bottom: var(--space-6);
}

.form-floating .form-control {
    height: 3.5rem;
    padding: var(--space-4) var(--space-4) var(--space-2);
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: var(--space-4);
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--gray-600);
    font-size: var(--text-base);
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--accent-color);
}

/* Select */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* Textarea */
.form-control[rows] {
    min-height: 4rem;
    resize: vertical;
}

/* ===== BUTTON COMPONENTS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    font-family: var(--font-body);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(250, 208, 44, 0.1);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #000000;
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-accent);
    color: #ffffff;
    border-color: var(--secondary-accent);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
    border-color: var(--success);
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline:hover {
    background: var(--accent-color);
    color: #000000;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-xl);
    font-weight: 600;
}

/* Full Width Button */
.btn-block {
    width: 100%;
}

/* ===== BADGE COMPONENTS ===== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ===== ALERT COMPONENTS ===== */

.alert {
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--success-dark);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
    color: var(--warning-dark);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-dark);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--info-dark);
}

/* ===== TABLE COMPONENTS ===== */

.table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th {
    background: var(--bg-tertiary);
    padding: var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== LOADING STATES ===== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ANIMATIONS ===== */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

/* ===== UTILITY CLASSES ===== */

/* Spacing */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Colors */
.text-primary { color: var(--accent-color); }
.text-secondary { color: var(--secondary-accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

.text-gray-900 { color: var(--gray-900); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-500 { color: var(--gray-500); }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .card-body,
    .card-header,
    .card-footer {
        padding: var(--space-4);
    }
    
    .btn-xl {
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-lg);
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .card-body,
    .card-header,
    .card-footer {
        padding: var(--space-3);
    }
    
    .btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
    }
    
    .form-control {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Screen Reader Only */
.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;
}

/* ===== PRINT STYLES ===== */

@media print {
    .card,
    .table-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn {
        display: none;
    }
    
    .badge {
        border: 1px solid #ccc;
        background: none;
    }
} 