/* ============================================
   ROOT24 DESIGN SYSTEM
   Versión: 1.0.0
   Fecha: 7 de junio de 2026
   ============================================ */

/* -------------------------------------------
   1. CSS CUSTOM PROPERTIES (VARIABLES)
   ------------------------------------------- */
:root {
    /* Paleta Oficial Root24 - Extrañda de root24.eu.org */

    /* Navy (Fondos) */
    --color-navy: #050e2a;
    --color-navy-mid: #071540;
    --color-navy-light: #0a2060;

    /* Blue (Elementos principales) */
    --color-blue: #1565c0;
    --color-blue-light: #2196f3;
    --color-blue-glow: #42a5f5;

    /* Colores de Acento */
    --color-accent: #2196f3;
    --color-accent-light: #42a5f5;
    --color-accent-dark: #1565c0;

    /* Neutros */
    --color-white: #FFFFFF;
    --color-gray-50: #F8FAFC;
    --color-gray-100: #F1F5F9;
    --color-gray-200: #E2E8F0;
    --color-gray-300: #CBD5E1;
    --color-gray-400: #94A3B8;
    --color-gray-500: #64748B;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1E293B;
    --color-gray-900: #0F172A;

    /* Estados */
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* Tipografía */
    --font-display: 'Oswald', sans-serif;
    --font-body: 'Droid Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Tamaños de Fuente */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    /* Espaciado */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
    --radius-full: 9999px;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-primary: 0 10px 30px -5px rgb(var(--color-primary-rgb) / 0.3);

    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-spring: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

/* Dark Mode Variables */
.dark {
    --color-bg: var(--color-gray-900);
    --color-bg-secondary: var(--color-gray-800);
    --color-text: var(--color-gray-100);
    --color-text-secondary: var(--color-gray-400);
}

/* -------------------------------------------
   2. BASE STYLES
   ------------------------------------------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-gray-900);
    background-color: var(--color-gray-50);
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

.dark body {
    color: var(--color-gray-100);
    background-color: var(--color-gray-900);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* -------------------------------------------
   3. COMPONENT CLASSES
   ------------------------------------------- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: center;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-gray-700);
    border-color: var(--color-gray-200);
}

.btn-ghost:hover {
    background-color: var(--color-gray-100);
    border-color: var(--color-primary);
}

.dark .btn-ghost {
    color: var(--color-gray-300);
    border-color: var(--color-gray-700);
}

.dark .btn-ghost:hover {
    background-color: var(--color-gray-800);
}

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

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-lg);
}

/* Cards */
.card {
    background-color: var(--color-white);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-gray-100);
    transition: all var(--transition-base);
}

.dark .card {
    background-color: var(--color-gray-800);
    border-color: var(--color-gray-700);
}

.card:hover {
    border-color: rgba(var(--color-primary-rgb), 0.3);
    box-shadow: var(--shadow-lg);
}

.card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

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

.badge-accent {
    background-color: rgba(0, 229, 255, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

/* Input Fields */
.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-base);
    background-color: var(--color-gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.dark .input {
    background-color: var(--color-gray-700);
    color: var(--color-white);
}

.input:focus {
    outline: none;
    background-color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.dark .input:focus {
    background-color: var(--color-gray-600);
}

.input-error {
    border-color: var(--color-error) !important;
}

.input-success {
    border-color: var(--color-success) !important;
}

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

.dark .input-label {
    color: var(--color-gray-300);
}

.input-error-message {
    display: none;
    margin-top: var(--space-1);
    font-size: var(--text-sm);
    color: var(--color-error);
}

.input-error-message.show {
    display: block;
}

/* -------------------------------------------
   4. UTILITY CLASSES
   ------------------------------------------- */

/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Delay Utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.4);
}

/* Focus Utilities */
.focus-ring:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-2) var(--space-4);
    z-index: var(--z-tooltip);
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: 0;
}

/* -------------------------------------------
   5. KEYFRAME ANIMATIONS
   ------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* -------------------------------------------
   6. MOBILE MENU
   ------------------------------------------- */
.mobile-menu {
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.mobile-menu.open {
    transform: translateX(0);
}

/* -------------------------------------------
   7. FORM STATES
   ------------------------------------------- */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* -------------------------------------------
   8. DARK MODE OVERRIDES
   ------------------------------------------- */
.dark .card {
    background-color: var(--color-gray-800);
    border-color: var(--color-gray-700);
}

.dark .card:hover {
    border-color: rgba(var(--color-primary-rgb), 0.5);
}

/* -------------------------------------------
   9. RESPONSIVE UTILITIES
   ------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --text-5xl: 2.5rem;
        --text-6xl: 3rem;
    }
    
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* -------------------------------------------
   10. PRINT STYLES
   ------------------------------------------- */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
