/* ════════════════════════════════════════════════════════════════════════════
   Vélo · Design System · Base
   Tokens, reset, tema light/dark, tipografía, utilidades
   ════════════════════════════════════════════════════════════════════════════ */

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

/* ══ TEMA CLARO (default) ════════════════════════════════════════════════ */
:root {
  color-scheme: light;

  /* Marca */
  --brand:        #1A1A2E;
  --brand-2:      #16213E;
  --accent:       #E94560;
  --accent-h:     #c73050;
  --accent-soft:  rgba(233,69,96,.10);
  --gold:         #F5A623;
  --gold-soft:    rgba(245,166,35,.12);

  /* Superficies */
  --bg:           #F6F7FB;
  --bg-2:         #EEF0F6;
  --surface:      #FFFFFF;
  --surface-2:    #F9FAFC;
  --elevated:     #FFFFFF;

  /* Glass (iOS-style) */
  --glass-bg:     rgba(255,255,255,.72);
  --glass-border: rgba(255,255,255,.55);
  --glass-blur:   saturate(180%) blur(22px);
  --glass-hairline: rgba(20,20,45,.08);

  /* Texto */
  --text:         #1A1A2E;
  --text-2:       #2D2D44;
  --muted:        #6B7280;
  --muted-2:      #9CA3AF;
  --on-brand:     #FFFFFF;

  /* Bordes */
  --border:       #E5E7EB;
  --border-2:     #D1D5DB;
  --ring:         rgba(233,69,96,.35);

  /* Semánticos */
  --success:      #10B981;
  --success-soft: rgba(16,185,129,.12);
  --warning:      #F59E0B;
  --warning-soft: rgba(245,158,11,.14);
  --danger:       #EF4444;
  --danger-soft:  rgba(239,68,68,.12);
  --info:         #3B82F6;
  --info-soft:    rgba(59,130,246,.12);

  /* Tipografía */
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, monospace;

  /* Radios */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Sombras (light) */
  --shadow-xs: 0 1px 2px rgba(17,24,39,.05);
  --shadow-sm: 0 2px 4px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.04);
  --shadow:    0 8px 20px rgba(17,24,39,.08), 0 2px 6px rgba(17,24,39,.05);
  --shadow-lg: 0 20px 40px rgba(17,24,39,.12), 0 6px 12px rgba(17,24,39,.06);
  --shadow-xl: 0 30px 60px rgba(17,24,39,.18);
  --shadow-ring: 0 0 0 4px var(--ring);

  /* Motion */
  --spring:     cubic-bezier(.34, 1.56, .64, 1);
  --ease:       cubic-bezier(.25, .1, .25, 1);
  --t-fast:     120ms var(--ease);
  --t:          220ms var(--ease);
  --t-slow:     380ms var(--ease);
  --t-spring:   420ms var(--spring);

  /* Layout */
  --nav-h:      68px;
  --header-h:   60px;
  --content-max: 640px;

  /* Header backdrop (se activa al hacer scroll) */
  --header-bg:  rgba(26,26,46,.95);
  --header-bd:  rgba(255,255,255,.08);
}

/* ══ TEMA OSCURO ════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  color-scheme: dark;

  --brand:        #0E0E1E;
  --brand-2:      #1A1A2E;
  --accent:       #FF5975;
  --accent-h:     #ff4063;
  --accent-soft:  rgba(255,89,117,.14);
  --gold:         #F5B84A;
  --gold-soft:    rgba(245,184,74,.15);

  --bg:           #0B0B14;
  --bg-2:         #111120;
  --surface:      #151525;
  --surface-2:    #1C1C30;
  --elevated:     #1F1F36;

  --glass-bg:     rgba(28,28,48,.60);
  --glass-border: rgba(255,255,255,.10);
  --glass-blur:   saturate(160%) blur(24px);
  --glass-hairline: rgba(255,255,255,.08);

  --text:         #F5F5F7;
  --text-2:       #D1D5E0;
  --muted:        #8B8FA3;
  --muted-2:      #64697D;
  --on-brand:     #FFFFFF;

  --border:       #2A2A40;
  --border-2:     #353552;
  --ring:         rgba(255,89,117,.45);

  --success:      #34D399;
  --success-soft: rgba(52,211,153,.14);
  --warning:      #FBBF24;
  --warning-soft: rgba(251,191,36,.15);
  --danger:       #F87171;
  --danger-soft:  rgba(248,113,113,.14);
  --info:         #60A5FA;
  --info-soft:    rgba(96,165,250,.14);

  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.35);
  --shadow:    0 10px 24px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 48px rgba(0,0,0,.55);
  --shadow-xl: 0 36px 72px rgba(0,0,0,.65);
  --shadow-ring: 0 0 0 4px var(--ring);

  --header-bg:  rgba(11,11,20,.78);
  --header-bd:  rgba(255,255,255,.06);
}

/* ══ Base ═══════════════════════════════════════════════════════════════ */
html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t), color var(--t);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--t-fast); }
a:hover { opacity: .85; }

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

input, select, textarea, button {
  font-family: inherit; font-size: inherit; color: inherit;
  border: none; outline: none; background: none;
}

button { cursor: pointer; }

/* Selección */
::selection { background: var(--accent-soft); color: var(--text); }

/* Scrollbars (discretos) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
::-webkit-scrollbar-track { background: transparent; }

/* ══ Utilidades ═════════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.text-lg     { font-size: 1.125rem; }
.fw-500      { font-weight: 500; }
.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; } .mb-4 { margin-bottom: 32px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }

.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1     { flex: 1; }
.grid       { display: grid; }

.rounded    { border-radius: var(--radius); }
.rounded-pill { border-radius: var(--radius-pill); }

.shadow-sm  { box-shadow: var(--shadow-sm); }
.shadow     { box-shadow: var(--shadow); }
.shadow-lg  { box-shadow: var(--shadow-lg); }

/* ══ Spinner ════════════════════════════════════════════════════════════ */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 36px; height: 36px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ Skeleton ═══════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ══ Toast (para success/info rápidos, warnings van por SweetAlert) ════ */
#toast-container {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  padding: 0 12px;
}
@media (min-width: 768px) {
  #toast-container { bottom: 24px; }
}

.toast {
  background: var(--surface);
  color: var(--text);
  padding: 12px 18px 12px 14px;
  border-radius: var(--radius-pill);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-hairline);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: toastIn .4s var(--spring), toastOut .3s var(--ease) 2.7s forwards;
  pointer-events: auto;
  max-width: 340px;
  display: flex; align-items: center; gap: 10px;
}
.toast i { font-size: 1rem; }
.toast.success i { color: var(--success); }
.toast.error i   { color: var(--danger); }
.toast.info i    { color: var(--info); }
@keyframes toastIn  { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ══ Fade-in suave para contenido ═══════════════════════════════════════ */
.fade-in { animation: fadeIn .4s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

/* ══ SweetAlert2 overrides (para que herede los tokens) ═════════════════ */
.swal2-popup {
  border-radius: var(--radius-lg) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  box-shadow: var(--shadow-xl) !important;
  border: 1px solid var(--glass-hairline);
}
.swal2-title  { color: var(--text) !important; font-family: var(--font-display) !important; font-weight: 700 !important; }
.swal2-html-container { color: var(--muted) !important; }
.swal2-confirm {
  background: var(--accent) !important;
  border-radius: var(--radius-pill) !important;
  padding: 10px 22px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px var(--accent-soft) !important;
}
.swal2-cancel {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-pill) !important;
  padding: 10px 22px !important;
  font-weight: 600 !important;
}
.swal2-icon { border-width: 3px !important; }
.swal2-backdrop-show { backdrop-filter: blur(8px); }

/* ══ FontAwesome ajustes ════════════════════════════════════════════════ */
.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands { line-height: 1; }
.icon-lg { font-size: 1.25rem; }
.icon-xl { font-size: 1.75rem; }
.icon-2xl { font-size: 2.25rem; }

/* ══ Reduce motion ══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
