/* ============================================
   FADEN - Sistema de Variables CSS Globales
   ============================================ */

:root {
    /* ===== COLORES BASE ===== */
    --color-primary: #7c3aed;
    --color-secondary: #4F46E5;
    --color-accent: var(--user-accent, #7c3aed);

    /* ===== ESCALA DE GRISES - LIGHT MODE ===== */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* ===== COLORES SEMÁNTICOS ===== */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* ===== BACKGROUNDS ===== */
    --bg-primary: #FFFFFF;
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --bg-gradient-start: rgba(139, 92, 246, 0.08);
    --bg-gradient-end: rgba(6, 182, 212, 0.08);

    /* ===== TEXT COLORS ===== */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --text-inverse: #FFFFFF;
    --text-muted: var(--gray-400);

    /* ===== BORDERS ===== */
    --border-color: var(--gray-200);
    --border-color-hover: var(--gray-300);
    --border-color-focus: var(--color-accent);

    /* ===== GLASSMORPHISM ===== */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-blur: 20px;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    /* ===== SISTEMA DE ESPACIADO (Base: 4px) ===== */
    --spacing-0: 0;
    --spacing-1: 0.25rem;
    /* 4px */
    --spacing-2: 0.5rem;
    /* 8px */
    --spacing-3: 0.75rem;
    /* 12px */
    --spacing-4: 1rem;
    /* 16px */
    --spacing-5: 1.25rem;
    /* 20px */
    --spacing-6: 1.5rem;
    /* 24px */
    --spacing-8: 2rem;
    /* 32px */
    --spacing-10: 2.5rem;
    /* 40px */
    --spacing-12: 3rem;
    /* 48px */
    --spacing-16: 4rem;
    /* 64px */
    --spacing-20: 5rem;
    /* 80px */
    --spacing-24: 6rem;
    /* 96px */

    /* ===== LAYOUT SPACING ===== */
    --gutter: var(--spacing-4);
    --margin-page: var(--spacing-6);
    --gap-sm: var(--spacing-2);
    --gap-md: var(--spacing-4);
    --gap-lg: var(--spacing-6);
    --gap-xl: var(--spacing-8);

    /* ===== TIPOGRAFÍA ===== */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', 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 */
    --text-5xl: 3rem;
    /* 48px */
    --text-6xl: 3.75rem;
    /* 60px */

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

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* ===== BORDES ===== */
    --radius-none: 0;
    --radius-sm: 0.375rem;
    /* 6px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-2xl: 1.5rem;
    /* 24px */
    --radius-3xl: 2rem;
    /* 32px */
    --radius-full: 9999px;

    --border-width: 1px;
    --border-width-2: 2px;
    --border-width-4: 4px;

    /* ===== SOMBRAS ===== */
    --shadow-none: none;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Glow Effects */
    --glow-accent: 0 0 20px rgba(124, 58, 237, 0.3);
    --glow-accent-strong: 0 0 30px rgba(124, 58, 237, 0.5);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
    --glow-error: 0 0 20px rgba(239, 68, 68, 0.3);

    /* ===== TRANSICIONES ===== */
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 700ms;

    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Common Transitions */
    --transition-colors: color var(--duration-normal) var(--ease-in-out),
        background-color var(--duration-normal) var(--ease-in-out),
        border-color var(--duration-normal) var(--ease-in-out);
    --transition-transform: transform var(--duration-normal) var(--ease-in-out);
    --transition-opacity: opacity var(--duration-normal) var(--ease-in-out);
    --transition-all: all var(--duration-normal) var(--ease-in-out);

    /* ===== Z-INDEX SCALE ===== */
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-notification: 1080;
    --z-max: 9999;
}

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */

.dark {
    /* Inverted Gray Scale */
    --gray-50: #18181B;
    --gray-100: #27272A;
    --gray-200: #3F3F46;
    --gray-300: #52525B;
    --gray-400: #71717A;
    --gray-500: #A1A1AA;
    --gray-600: #D4D4D8;
    --gray-700: #E4E4E7;
    --gray-800: #F4F4F5;
    --gray-900: #FAFAFA;

    /* Dark Backgrounds */
    --bg-primary: #0d1117;
    --bg-secondary: #161B22;
    --bg-tertiary: #1F2937;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    /* Dark Text */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --text-muted: var(--gray-400);

    /* Dark Borders */
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-hover: rgba(255, 255, 255, 0.1);

    /* Dark Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: 10px;
    --glass-shadow: none;

    /* Dark Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* ============================================
   COMPACT MODE
   ============================================ */

.compact-mode {
    --gutter: var(--spacing-3);
    --margin-page: var(--spacing-4);
    --gap-sm: var(--spacing-1);
    --gap-md: var(--spacing-3);
    --gap-lg: var(--spacing-4);
    --gap-xl: var(--spacing-6);
}

/* ============================================
   NO ANIMATIONS MODE
   ============================================ */

.no-animations,
.no-animations * {
    --duration-fast: 0ms !important;
    --duration-normal: 0ms !important;
    --duration-slow: 0ms !important;
    --duration-slower: 0ms !important;
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
}

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

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    border: var(--border-width) solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

/* Text Utilities */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.text-inverse {
    color: var(--text-inverse);
}

.text-accent {
    color: var(--color-accent);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-error {
    color: var(--color-error);
}

/* Background Utilities */
.bg-primary {
    background-color: var(--bg-primary);
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.bg-tertiary {
    background-color: var(--bg-tertiary);
}

.bg-accent {
    background-color: var(--color-accent);
}

/* Transition Utilities */
.transition-colors {
    transition: var(--transition-colors);
}

.transition-transform {
    transition: var(--transition-transform);
}

.transition-opacity {
    transition: var(--transition-opacity);
}

.transition-all {
    transition: var(--transition-all);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile First Approach */
/* sm: 640px */
/* md: 768px */
/* lg: 1024px */
/* xl: 1280px */
/* 2xl: 1536px */

/* ============================================
   FADEN AUTH — Sistema de Inputs Unificado
   Aplica a: registro (register).html + iniciar-sesion (login).html
   Objetivo: igualar visualmente .input-reset con .faden-select-trigger
   ============================================ */

/* Contenedor de campo — reemplaza el .field pill-shaped de login */
.auth-field {
    width: 100%;
    position: relative;
    margin-bottom: 1rem;
}

/* Input base unificado — mismo lenguaje visual que .faden-select-trigger */
.auth-input {
    width: 100%;
    background-color: #0d1117;
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 0.5rem;
    color: #ffffff;
    padding: 0.75rem 1rem;
    height: 48px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

/* Textarea hereda el mismo estilo pero sin altura fija */
textarea.auth-input {
    height: auto;
    padding: 0.75rem 1rem;
    resize: none;
    line-height: 1.5;
}

/* Campos numéricos pequeños (DD, AAAA) — menos padding horizontal */
input[type="number"].auth-input {
    padding: 0.75rem 0.5rem;
    text-align: center;
}

/* Hover — borde púrpura más visible */
.auth-input:hover {
    border-color: rgba(124, 58, 237, 0.6);
}

/* Focus — borde sólido + glow morado */
.auth-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), 0 0 12px rgba(124, 58, 237, 0.2);
}

/* Placeholder */
.auth-input::placeholder {
    color: #6b7280;
    font-family: 'Outfit', sans-serif;
}

/* Label compartido */
.auth-label {
    display: block;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.01em;
}

html.dark .auth-label {
    color: #9ca3af;
}

/* Icon prefix inside input container (ej: candado en login) */
.auth-field .auth-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.auth-field .auth-icon ~ .auth-input {
    padding-left: 2.5rem;
}

/* Botón de mostrar/ocultar contraseña */
.auth-field .auth-toggle-password {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.auth-field .auth-toggle-password:hover {
    color: #7c3aed;
}

/* ── Retrocompatibilidad: .input-reset dentro de .field ──────────────────
   Mantiene el estilo unificado en elementos que usan las clases anteriores
   sin necesidad de renombrar cada input en el HTML.
   ─────────────────────────────────────────────────────────────────────── */
.field .input-reset,
.field input,
.field textarea,
.field select {
    width: 100%;
    background-color: #0d1117!important;
    border: 1px solid rgba(124, 58, 237, 0.3) !important;
    border-radius: 0.5rem !important;
    color: #ffffff !important;
    padding: 0.75rem 1rem !important;
    height: 48px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none !important;
    box-sizing: border-box;
    box-shadow: none !important;
}

.field textarea {
    height: auto !important;
    resize: none;
    line-height: 1.5;
}

.field input[type="number"] {
    padding: 0.75rem 0.5rem !important;
    text-align: center;
}

.field .input-reset:hover,
.field input:hover,
.field textarea:hover {
    border-color: rgba(124, 58, 237, 0.6) !important;
}

.field .input-reset:focus,
.field input:focus,
.field textarea:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), 0 0 12px rgba(124, 58, 237, 0.2) !important;
}

.field .input-reset::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    color: #6b7280;
}

/* Retrocompat: el contenedor .field no debe añadir fondo propio */
.field {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}