/* =========================================
   GLOBAL.CSS - Variables y Reseteo Base
   IRIS
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;1,9..144,400&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* ── Paleta Principal ── */
    --bg-main:      #f8fafc;        /* Fondo neutro, alineado con agenda y pacientes */
    --bg-surface:   #ffffff;        /* Superficies / tarjetas */
    --bg-surface-2: #ffffff;        /* Tarjetas elevadas */
    --bg-dark:      #1c2e28;        /* Dark sections */
    --bg-dark-2:    #243b33;        /* Dark surface */

    /* ── Colores de Acción ── */
    --primary:      #3d9b7a;        /* Verde salvia profundo */
    --primary-dark: #2d7a5e;        /* Hover states */
    --primary-light:#a8d5be;        /* Tints decorativos */
    --accent:       #f0c87a;        /* Ámbar cálido — CTA urgentes */
    --accent-dark:  #d4a84b;

    /* ── Texto ── */
    --text-dark:    #1c2e28;        /* Titulares */
    --text-body:    #3d5248;        /* Cuerpo */
    --text-muted:   #7a9488;        /* Secundario */
    --text-on-dark: #e8f0ec;        /* Texto sobre fondos oscuros */

    /* ── Bordes ── */
    --border:       rgba(61, 155, 122, 0.15);
    --border-dark:  rgba(61, 155, 122, 0.08);

    /* ── Tipografía ── */
    --font-heading: 'Fraunces', Georgia, serif;      /* Cálido, elegante, distintivo */
    --font-body:    'Outfit', system-ui, sans-serif; /* Limpio, moderno, legible */

    /* ── Escala Tipográfica ── */
    --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 */

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

    /* ── Sombras ── */
    --shadow-xs:  0 1px 3px rgba(28, 46, 40, 0.06);
    --shadow-sm:  0 4px 12px rgba(28, 46, 40, 0.08);
    --shadow-soft: 0 4px 12px rgba(28, 46, 40, 0.08);
    --shadow-md:  0 8px 24px rgba(28, 46, 40, 0.10);
    --shadow-lg:  0 16px 48px rgba(28, 46, 40, 0.12);
    --shadow-xl:  0 24px 64px rgba(28, 46, 40, 0.15);

    /* ── Radios ── */
    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --radius-xl:  28px;
    --radius-full: 9999px;

    /* ── Transiciones ── */
    --transition-fast:   all 0.15s ease;
    --transition:        all 0.25s ease;
    --transition-slow:   all 0.4s cubic-bezier(0.16, 1, 0.3, 1);


    /* ── Estados ── */
    --success:      #2c7a5e;
    --warning:      #ed8936;
    --danger:       #e53e3e;
    --info:         #3182ce;
    --border-light: #edf2f7;

    /* ── Layout ── */
    --container-max: 1200px;
    --sidebar-width: 260px;
}

/* ─── Reset ─────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

ul, ol { list-style: none; }

button, input, select, textarea {
    font-family: var(--font-body);
    font-size: var(--text-base);
}

/* ─── Componentes Globales ───────────────── */

/* Botón Principal */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--primary);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--text-base);
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(61, 155, 122, 0.35);
}

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

/* Botón Outline */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    font-weight: 600;
    font-size: var(--text-base);
    padding: 13px 28px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-slow);
    text-decoration: none;
}

.btn-outline:hover {
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(61, 155, 122, 0.25);
}

.btn-outline.dark {
    color: var(--text-dark);
    border-color: var(--text-dark);
}

.btn-outline.dark:hover {
    background: var(--text-dark);
    color: var(--text-on-dark);
}

/* Botón Ghost */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: transparent;
    color: var(--text-body);
    font-weight: 500;
    font-size: var(--text-base);
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-ghost:hover {
    background: var(--bg-surface);
    color: var(--text-dark);
}

/* Tamaños */
.btn-sm { padding: 9px 18px; font-size: var(--text-sm); }
.btn-lg { padding: 16px 36px; font-size: var(--text-lg); }

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--medical-accent, #a7d7b8);
    border-radius: 8px;
    color: var(--medical-dark, #4e796b);
    font-family: 'Inter', sans-serif;
    outline: none;
    margin-bottom: 1.5rem;
}

/* ─── Logo ───────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -1px;
    flex-shrink: 0;
    font-family: var(--font-heading);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.02em;
}

/* ─── Utilidades ─────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-surface);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: var(--space-6);
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 580px;
}

/* ─── Animaciones ────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse-ring {
    0%   { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

.animate-fade-up {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ─── Componentes base reutilizables ────── */
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.55rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

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

.btn-danger:hover {
    background: #c53030;
    color: #fff;
}

.ui-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.search-box { position: relative; }
.search-box input {
    width: 100%;
    padding: 0.65rem 2rem 0.65rem 2.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-body);
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 155, 122, 0.12);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
