/* ==========================================================================
   UNIVERSIDAD INDOAMÉRICA — DESIGN SYSTEM
   Estética Apple · Tipografía Inter · Paleta de Marca
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {

    /* ── BRAND PALETTE (Manual de Marca Indoamérica) ── */
    --brand-indigo-900: #1f0b3c;   /* Dark surface / sidebar */
    --brand-indigo-800: #2a0f52;   /* Sidebar secondary */
    --brand-indigo-700: #3a1467;   /* Persian Indigo — P97-16C */
    --brand-indigo-600: #542e91;   /* Persian Indigo — P96-8C  */
    --brand-indigo-500: #644a98;   /* Persian Indigo — P96-7C  */
    --brand-indigo-100: #ede9f5;   /* Tint muy suave */
    --brand-indigo-50:  #f4f2f9;   /* Fondo base */

    --brand-orange:     #f37121;   /* Vivid Tangelo — P30-8C  */
    --brand-orange-dark:#d4580f;   /* Orange pressed  */
    --brand-yellow:     #ffd54c;   /* Gargoyle Gas — P7-7C    */

    /* Aliases semánticos */
    --primary-color:    var(--brand-indigo-700);
    --primary-light:    var(--brand-indigo-600);
    --primary-lighter:  var(--brand-indigo-500);
    --dark-surface:     var(--brand-indigo-800);
    --dark-surface-2:   var(--brand-indigo-900);
    --accent-orange:    var(--brand-orange);
    --accent-yellow:    var(--brand-yellow);
    --color-white:      #ffffff;

    /* ── TYPOGRAPHY SCALE (Apple Style) ── */

    /* Fuente base */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

    /* Tamaños */
    --text-xs:   11px;    /* Etiquetas micro, badges */
    --text-sm:   12px;    /* Labels de card, metadatos */
    --text-base: 14px;    /* Cuerpo de texto principal  ← Apple default */
    --text-md:   15px;    /* Cuerpo secundario / subtítulos */
    --text-lg:   17px;    /* Títulos de sección pequeños */
    --text-xl:   20px;    /* Títulos de sección */
    --text-2xl:  24px;    /* Títulos de página */
    --text-3xl:  28px;    /* KPIs / Números grandes */
    --text-4xl:  34px;    /* Hero / banner principal */

    /* Pesos */
    --fw-regular:   400;
    --fw-medium:    500;
    --fw-semibold:  600;
    --fw-bold:      700;
    --fw-extrabold: 800;
    --fw-black:     900;

    /* Interlineados */
    --lh-tight:  1.2;
    --lh-snug:   1.35;
    --lh-normal: 1.5;
    --lh-relaxed:1.6;

    /* Tracking (letter-spacing) */
    --ls-tight:  -0.03em;
    --ls-normal: -0.01em;
    --ls-label:   0.05em;   /* Card labels */
    --ls-micro:   0.08em;   /* Eyebrows / badges */
    --ls-wide:    0.12em;   /* Texto en mayúsculas */

    /* ── COLOR SEMANTICS ── */
    --bg-color:       var(--brand-indigo-50);   /* #f4f2f9 */
    --bg-subtle:      #f8f7fb;                  /* Alternativo muy sutil */
    --surface-color:  #ffffff;
    --top-banner-bg:  var(--brand-indigo-100);

    /* Texto — reemplaza negros puros por grises sofisticados (Apple) */
    --text-primary:   #1d1d1f;    /* Casi negro — color Apple estándar */
    --text-secondary: #3c3c43;    /* Gris oscuro para texto secundario */
    --text-tertiary:  #6e6e73;    /* Texto terciario / placeholders */
    --text-muted:     #8e8e93;    /* Texto apagado / metadatos */
    --text-on-dark:   rgba(255,255,255,0.88);

    /* Alias compatibles con código existente */
    --text-main: var(--text-primary);

    /* ── BORDERS & DIVIDERS ── */
    --border-color:    rgba(60, 60, 67, 0.12);   /* iOS system separator */
    --border-strong:   rgba(60, 60, 67, 0.22);
    --border-divider:  1px solid var(--border-color);

    /* ── SHADOWS (reducidas — más sutiles) ── */
    --shadow-xs:    0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:    0 2px 8px rgba(58,20,103,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md:    0 8px 24px rgba(58,20,103,0.09), 0 2px 8px rgba(0,0,0,0.05);
    --shadow-hover: 0 16px 40px rgba(58,20,103,0.14), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-orange:0 4px 16px rgba(243,113,33,0.28);

    /* ── SPACING SCALE ── */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ── BORDER RADIUS ── */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-xl:   18px;
    --radius-full: 9999px;

    /* ── ANIMATIONS ── */
    --ease-apple:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-snappy:   cubic-bezier(0.25, 1, 0.5, 1);
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 160ms;
    --duration-base: 260ms;
    --duration-slow: 400ms;
}

/* ============================================================
   GLOBAL RESET & BASE TYPOGRAPHY
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: var(--text-base);     /* 14px — Apple default */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);   /* 1.5 */
    color: var(--text-primary);      /* #1d1d1f */
    background-color: var(--bg-color);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

/* ── Jerarquía tipográfica ── */

/* Cuerpo */
p, li, td, th, span, label, input, select, textarea, button {
    font-size: var(--text-base);     /* 14px */
    line-height: var(--lh-normal);
    color: var(--text-primary);
}

/* Títulos — escala modular */
h1 {
    font-size: var(--text-4xl);      /* 34px */
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--primary-color);
}

h2 {
    font-size: var(--text-2xl);      /* 24px */
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-normal);
    color: var(--primary-color);
}

h3 {
    font-size: var(--text-lg);       /* 17px */
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
    color: var(--text-primary);
}

h4, h5, h6 {
    font-size: var(--text-md);       /* 15px */
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

/* Card label (12-13px + 0.05em tracking) — regla del manual */
.label-card,
.stat-label,
.banner-eyebrow,
.page-eyebrow {
    font-size: var(--text-sm);       /* 12px */
    font-weight: var(--fw-semibold); /* 600 */
    letter-spacing: var(--ls-label); /* 0.05em */
    color: #333333;
    text-transform: uppercase;
}

/* Número KPI (28px + semibold) — regla del manual */
.kpi-value,
.stat-value {
    font-size: var(--text-3xl);      /* 28px */
    font-weight: var(--fw-semibold); /* 600 */
    line-height: var(--lh-tight);
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

/* ── Texto muted / meta ── */
.text-muted, .meta-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--fw-regular);
}

/* ── Texto terciario ── */
.text-tertiary {
    color: var(--text-tertiary);
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse-orange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(243,113,33,0.35); }
    50%       { box-shadow: 0 0 0 6px rgba(243,113,33,0); }
}

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

.animar-entrada {
    opacity: 0;
    animation: fadeInUp var(--duration-slow) var(--ease-apple) forwards;
}

.cascada-1 { animation-delay: 40ms; }
.cascada-2 { animation-delay: 80ms; }
.cascada-3 { animation-delay: 120ms; }
.cascada-4 { animation-delay: 160ms; }
.cascada-5 { animation-delay: 200ms; }

/* ============================================================
   SURFACE & CARD PRIMITIVES
   ============================================================ */

/* Superficie base — whitespace generoso */
.card-premium {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition:
        box-shadow var(--duration-base) var(--ease-apple),
        transform var(--duration-base) var(--ease-apple);
}

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

/* Variante con acento superior de color (para otras vistas) */
.card-accent-top {
    border-top: 3px solid var(--primary-light);
}

/* Separador */
.section-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-6) 0;
    border: none;
}

/* ============================================================
   FORMS — Input premium
   ============================================================ */

.input-premium {
    width: 100%;
    padding: 9px 14px;                   /* compact pero aireado */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-base);         /* 14px */
    font-weight: var(--fw-regular);
    font-family: var(--font-family);
    background-color: #fafafa;
    color: var(--text-primary);
    transition:
        border-color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-fast) var(--ease-standard),
        background-color var(--duration-fast);
    -webkit-appearance: none;
    appearance: none;
}

.input-premium::placeholder {
    color: var(--text-muted);
    font-weight: var(--fw-regular);
}

.input-premium:focus {
    outline: none;
    background-color: var(--surface-color);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(84, 46, 145, 0.14);
}

select.input-premium {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* CTA principal — Vivid Tangelo */
.btn-premium {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 9px 18px;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--text-base);         /* 14px */
    font-weight: var(--fw-semibold);     /* 600 */
    cursor: pointer;
    box-shadow: var(--shadow-orange);
    transition:
        background var(--duration-fast),
        box-shadow var(--duration-fast),
        transform var(--duration-fast);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.btn-premium:hover {
    background: var(--brand-orange-dark);
    box-shadow: 0 6px 22px rgba(243,113,33,0.42);
    transform: translateY(-1px);
}

.btn-premium:active { transform: scale(0.97); }

/* Botón secundario (ghost sobre oscuro) */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 16px;
    background: transparent;
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-apple);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.45);
    color: white;
}

/* ============================================================
   BANNERS (vistas no-dashboard con top-banner)
   ============================================================ */

.top-banner {
    background: linear-gradient(135deg,
        var(--brand-indigo-700) 0%,
        var(--brand-indigo-600) 60%,
        #7b3fa0 100%
    );
    padding: var(--space-10) var(--space-12);
    position: relative;
    overflow: hidden;
}

/* Línea de acento naranja */
.top-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow));
}

/* Orbe decorativo */
.top-banner::after {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 240px; height: 240px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.banner-eyebrow {
    display: block;
    font-size: var(--text-xs);      /* 11px */
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--accent-yellow);
    margin-bottom: var(--space-2);
}

.banner-title {
    font-size: var(--text-4xl);     /* 34px */
    font-weight: var(--fw-bold);
    color: #ffffff;
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-tight);
    margin-bottom: var(--space-2);
}

.banner-desc {
    font-size: var(--text-md);      /* 15px */
    color: rgba(255,255,255,0.68);
    max-width: 600px;
    line-height: var(--lh-relaxed);
    font-weight: var(--fw-regular);
}

/* ============================================================
   LEGACY ALIASES (compatibilidad con CSS existentes)
   ============================================================ */
:root {
    --text-muted:      var(--text-tertiary);  /* #6e6e73 */
    --border-color:    rgba(60, 60, 67, 0.12);
    --shadow-sm:       0 2px 8px rgba(58,20,103,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md:       0 8px 24px rgba(58,20,103,0.09);
    --shadow-hover:    0 16px 40px rgba(58,20,103,0.14);
    --shadow-orange:   0 4px 16px rgba(243,113,33,0.28);
    --ease-apple:      cubic-bezier(0.16, 1, 0.3, 1);
    --ease-snappy:     cubic-bezier(0.25, 1, 0.5, 1);
    --bg-color:        #f4f2f9;
    --surface-color:   #ffffff;
}

/* ============================================================
   NAVBAR GLASS (páginas no-dashboard)
   ============================================================ */
.navbar-glass {
    background: rgba(31, 11, 60, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-8);
    height: 56px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}

.navbar-glass h2 {
    font-size: var(--text-lg);      /* 17px */
    font-weight: var(--fw-bold);
    color: #ffffff;
    letter-spacing: var(--ls-normal);
}

.navbar-glass span { color: var(--accent-orange); }
