/* ============================================================
   Healthcare Ecosystem — Base Reset + Utilities
   base.css
   ============================================================ */

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

html {
    /* Regla UX permanente v2: base 18px (adultos mayores) */
    font-size: 18px;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-gray-800);
    background-color: var(--color-primary-bg-soft);
    background-image:
        radial-gradient(700px 400px at 85% -5%, rgba(72, 202, 228, 0.12), transparent 55%),
        radial-gradient(600px 500px at -10% 30%, rgba(0, 119, 182, 0.06), transparent 55%),
        linear-gradient(180deg, var(--color-primary-bg), var(--color-primary-bg-soft));
    background-attachment: fixed;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-dark); }
a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol { list-style: none; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--color-primary-dark);       /* navy profundo */
}
h1 { font-size: var(--font-size-4xl); font-weight: var(--font-weight-extrabold); line-height: var(--line-height-tight); }
h2 { font-size: var(--font-size-3xl); font-weight: var(--font-weight-bold); line-height: var(--line-height-tight); }
h3 { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); }
h4 { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
h5 { font-size: var(--font-size-lg); font-weight: var(--font-weight-medium); }
h6 { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); }

p { margin-bottom: var(--space-4); }

small { font-size: var(--font-size-sm); }
strong { font-weight: var(--font-weight-semibold); }

/* ---- Utilities ---- */
/* Bootstrap 5 ya provee: .text-center, .text-muted, .d-flex, .d-none, .d-block,
   .flex-column, .align-items-center, .justify-content-center, .gap-*, .m-*, .p-*,
   .w-100, .rounded, .shadow, .bg-*.
   Solo se mantienen utilities que Bootstrap NO ofrece o que usan variables CSS propias. */

.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }

/* ---- Accessibility ---- */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-content link for keyboard users (WCAG 2.4.1) */
.skip-to-content {
    position: absolute;
    top: -9999px;
    left: 0;
    z-index: 9999;
    padding: var(--space-3) var(--space-6);
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: var(--font-weight-semibold);
    border-radius: 0 0 var(--radius-md) 0;
    text-decoration: none;
}
.skip-to-content:focus {
    top: 0;
}

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

/* ---- Reduced Motion (WCAG 2.3.3) ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in { animation: fadeIn var(--transition-base); }
.slide-up { animation: slideUp var(--transition-base); }

/* ---- Loading Spinner ---- */
/* Unificado con .spinner-hc en components.css — usar .spinner-hc en todo el código */
