/* =====================================================================
   BASE — reset, tipografía y utilidades generales
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* nunca scroll lateral */
  min-width: 320px;
}
body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; margin: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; overflow-wrap: anywhere; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }
small { font-size: 0.85em; }
:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

#app { min-height: 100vh; display: flex; flex-direction: column; }
#app-main { flex: 1; min-width: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* Utilidades */
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 14px; }
.text-xs { font-size: 12.5px; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; }
.hide-mobile { display: none !important; }
@media (min-width: 768px) { .hide-mobile { display: initial !important; } .hide-desktop { display: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Secciones y páginas */
.section { padding: 48px 0; }
@media (min-width: 768px) { .section { padding: 72px 0; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-title { font-size: 24px; letter-spacing: -0.02em; }
@media (min-width: 768px) { .section-title { font-size: 30px; } }
.section-subtitle { color: var(--color-text-muted); margin-top: 6px; font-size: 15px; }

.page { padding: 28px 0 64px; }
@media (min-width: 768px) { .page { padding: 40px 0 80px; } }
.page-title { font-size: 26px; margin-bottom: 4px; }
@media (min-width: 768px) { .page-title { font-size: 32px; } }
.page-subtitle { color: var(--color-text-muted); margin-bottom: 24px; }

/* Iconos SVG en línea */
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 28px; height: 28px; }

/* Animaciones */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn 240ms ease both; }
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.spinner-dark { border-color: var(--gray-200); border-top-color: var(--color-primary); }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px; color: var(--color-text-muted); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
