/* ========================================
   00-GLOBAL.CSS - NK Insurance
   Variables, Reset, Typography & Utilities
   ======================================== */

/* ========================================
   CSS Variables / Custom Properties
   ======================================== */
:root {
    /* Brand Colors */
    --primary: #0B2545;          /* Azul marino profundo */
    --primary-dark: #061529;      /* Azul marino más oscuro */
    --primary-light: #134E6F;     /* Azul marino claro */
    
    --secondary: #0F8B64;         /* Verde esmeralda corporativo */
    --secondary-dark: #0A6B4D;    /* Esmeralda profundo (hover) */
    --secondary-light: #14B583;   /* Esmeralda claro */
    
    --accent: #0A6B4D;            /* Esmeralda oscuro (gradients) */
    --accent-gold: #C8A961;       /* Dorado cálido para acentos editoriales */
    --warning: #FFB800;           /* Amarillo dorado */
    --danger: #E74C3C;            /* Rojo */
    --success: #0F8B64;           /* Verde éxito (alineado con secondary) */
    
    /* Text Colors */
    --text-dark: #1A1A2E;         /* Texto principal oscuro */
    --text-body: #545454;         /* Texto de párrafos */
    --text-light: #F5F5F7;        /* Texto claro */
    --text-muted: #868686;        /* Texto deshabilitado */
    
    /* Background Colors */
    --bg-white: #FFFFFF;
    --bg-cream: #FAF6EE;          /* Crema cálido para secciones editoriales */
    --bg-light: #F8FAFB;          /* Fondo gris muy claro */
    --bg-gray: #F3F4F6;
    --bg-dark: #1F2937;
    
    /* Typography Families */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    
    /* Spacing Scale */
    --spacing-xs: 0.25rem;        /* 4px */
    --spacing-sm: 0.5rem;         /* 8px */
    --spacing-md: 1rem;           /* 16px */
    --spacing-lg: 1.5rem;         /* 24px */
    --spacing-xl: 2rem;           /* 32px */
    --spacing-2xl: 3rem;          /* 48px */
    --spacing-3xl: 4rem;          /* 64px */
    --spacing-4xl: 6rem;          /* 96px */
    
    /* Typography Scale */
    --font-xs: 0.75rem;           /* 12px */
    --font-sm: 0.875rem;          /* 14px */
    --font-base: 1rem;            /* 16px */
    --font-lg: 1.125rem;          /* 18px */
    --font-xl: 1.25rem;           /* 20px */
    --font-2xl: 1.5rem;           /* 24px */
    --font-3xl: 2rem;             /* 32px */
    --font-4xl: 2.5rem;           /* 40px */
    --font-5xl: 3rem;             /* 48px */
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line Heights */
    --line-tight: 1.2;
    --line-normal: 1.6;
    --line-relaxed: 1.8;
    
    /* Border Radius */
    --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-full: 9999px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --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);
    
    /* Custom Shadows */
    --shadow-primary: 0 4px 20px rgba(11, 37, 69, 0.15);
    --shadow-secondary: 0 4px 20px rgba(0, 212, 170, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* Container */
    --container-max: 1200px;
    --container-padding: 1rem;
}

/* ========================================
   CSS Reset / Normalize
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-base);
    font-weight: var(--font-normal);
    line-height: var(--line-normal);
    color: var(--text-dark);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--line-tight);
    letter-spacing: -0.015em;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.025em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
    font-size: var(--font-xl);
}

h6 {
    font-size: var(--font-lg);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-body);
    line-height: var(--line-relaxed);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--secondary);
}

strong, b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--font-sm);
}

/* Lists */
ul, ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   Layout Components
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--spacing-4xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.section-tag {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-md);
}

.section-tag::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-gold);
    margin-right: 0.75em;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--primary);
    margin-bottom: var(--spacing-lg);
}

.section-subtitle {
    font-size: var(--font-lg);
    color: var(--text-body);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: var(--font-base);
    font-weight: var(--font-semibold);
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-all);
    white-space: nowrap;
    user-select: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    border-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    box-shadow: var(--shadow-secondary);
    color: white;
}

.btn-secondary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-primary);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: var(--font-sm);
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: var(--font-lg);
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   Forms
   ======================================== */
input,
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: var(--font-base);
    color: var(--text-dark);
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-medium);
    color: var(--text-dark);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* ========================================
   Utility Classes
   ======================================== */

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--text-muted); }
.text-white { color: white; }

/* Background Colors */
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-light { background-color: var(--bg-light); }
.bg-white { background-color: var(--bg-white); }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mt-5 { margin-top: var(--spacing-2xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.mb-5 { margin-bottom: var(--spacing-2xl); }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: var(--spacing-sm); }
.pt-2 { padding-top: var(--spacing-md); }
.pt-3 { padding-top: var(--spacing-lg); }
.pt-4 { padding-top: var(--spacing-xl); }
.pt-5 { padding-top: var(--spacing-2xl); }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: var(--spacing-sm); }
.pb-2 { padding-bottom: var(--spacing-md); }
.pb-3 { padding-bottom: var(--spacing-lg); }
.pb-4 { padding-bottom: var(--spacing-xl); }
.pb-5 { padding-bottom: var(--spacing-2xl); }

/* Display Utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox Utilities */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

/* Border Utilities */
.border { border: 1px solid #e0e0e0; }
.border-top { border-top: 1px solid #e0e0e0; }
.border-bottom { border-bottom: 1px solid #e0e0e0; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Width Utilities */
.w-100 { width: 100%; }
.w-75 { width: 75%; }
.w-50 { width: 50%; }
.w-25 { width: 25%; }

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fadeIn { animation: fadeIn 0.6s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease-out; }
.animate-slideInLeft { animation: slideInLeft 0.6s ease-out; }
.animate-slideInRight { animation: slideInRight 0.6s ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ========================================
   Accessibility
   ======================================== */
.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;
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* Skip to Content */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    img {
        max-width: 100% !important;
    }
    
    @page {
        margin: 0.5cm;
    }
}