/* ─────────────────────────────────────────────────────────────
   PadelHub · Sistema de diseño compartido
   Un solo lenguaje visual para todo el sitio: landing, login,
   registro, paneles y el módulo de torneos. Oscuro, de alto
   contraste, con un único acento (lima) — pensado para que se
   sienta como una marca de rendimiento (Porsche/Tesla/Apple),
   no como un SaaS genérico verde-sobre-blanco.

   Cómo usarlo: <link rel="stylesheet" href="design-system.css">
   ANTES del <style> propio de cada página, para que los tokens
   y clases base (.btn, .card, .input, .pill, .glass) ya existan
   y cada página solo agregue sus layouts específicos.
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,100..900&display=swap');

:root {
  /* ── Superficie ── */
  --bg: #0a1322;
  --bg-elevated: #0d182a;
  --surface: #111d30;
  --surface-2: #17263f;
  --surface-3: #1d2e4a;
  --border: rgba(214,228,255,0.12);
  --border-strong: rgba(214,228,255,0.24);

  /* ── Texto ── */
  --ink: #eaf0fa;
  --ink-dim: #b7c3d8;
  --ink-muted: #8e9cb6;

  /* ── Acento (el único color de marca) ── */
  --lime: #c6f135;
  --lime-bright: #dcff5c;
  --lime-dark: #96b81f;
  --lime-dim: rgba(198, 241, 53, 0.1);
  --lime-glow: rgba(198, 241, 53, 0.35);

  /* ── Estado ── */
  --danger: #ff5d4e;
  --danger-dim: rgba(255, 93, 78, 0.1);
  --ok: var(--lime);

  /* ── Forma ── */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* ── Sombra ── */
  --shadow-sm: 0 2px 10px rgba(3,8,18,0.3);
  --shadow-md: 0 8px 30px rgba(3,8,18,0.45);
  --shadow-glow: 0 8px 28px var(--lime-glow);

  /* ── Tipografía ── */
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, -apple-system, sans-serif;
}

/* Tema claro opcional (algunas pantallas internas, como paneles
   densos en datos, pueden preferir fondo claro — se activa con
   data-theme="light" en <html> o <body>). El acento y la
   tipografía se mantienen; solo invierte superficie/texto. */
[data-theme='light'] {
  --bg: #f4f5f1;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eceee7;
  --surface-3: #e2e4db;
  --border: rgba(10,19,34,0.08);
  --border-strong: rgba(10,19,34,0.16);
  --ink: #0a0b08;
  --ink-dim: #4b4f45;
  --ink-muted: #878b80;
  --lime-dim: rgba(150, 184, 31, 0.12);
  --shadow-sm: 0 2px 10px rgba(10, 11, 8, 0.06);
  --shadow-md: 0 10px 30px rgba(10, 11, 8, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100%;
  line-height: 1.5;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.015em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0; color: var(--ink-dim); }
.muted { color: var(--ink-muted); }
a { color: var(--lime); text-decoration: none; }
a:hover { color: var(--lime-bright); }

/* ── Botones ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease-out, box-shadow 0.18s ease-out, border-color 0.18s ease-out, background 0.18s ease-out, opacity 0.18s ease-out;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--lime); color: #0b1405; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--lime-bright); box-shadow: 0 10px 34px var(--lime-glow); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }

.btn-dark { background: var(--surface-2); color: var(--ink); border-color: var(--border); }
.btn-dark:hover { background: var(--surface-3); border-color: var(--border-strong); }

.btn-danger { background: transparent; border-color: rgba(255, 93, 78, 0.35); color: var(--danger); }
.btn-danger:hover { background: var(--danger-dim); border-color: var(--danger); }

.btn-lg { padding: 1rem 2rem; font-size: 0.95rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.76rem; }
.btn-block { width: 100%; }

/* ── Tarjetas / materiales ────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

/* Vidrio translúcido — para barras flotantes (nav, toolbars) que
   dejan ver el contenido deslizándose debajo. */
.glass {
  background: rgba(10,19,34,0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(214,228,255,0.12);
}
[data-theme='light'] .glass {
  background: rgba(214,228,255,0.72);
  border-bottom: 1px solid rgba(10, 11, 8, 0.06);
}

/* ── Inputs ───────────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}
.input, .field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--lime);
  background: var(--surface-3);
}
.input::placeholder, .field input::placeholder { color: var(--ink-muted); }

/* ── Pills / badges ───────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  color: var(--ink-dim);
  border: 1px solid var(--border);
}
.pill-accent { background: var(--lime-dim); color: var(--lime); border-color: rgba(198, 241, 53, 0.3); }
.pill-danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(255, 93, 78, 0.3); }

/* ── Mensajes ─────────────────────────────────────────────── */
.msg { padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: 0.82rem; line-height: 1.5; }
.msg.error { background: var(--danger-dim); border: 1px solid rgba(255, 93, 78, 0.3); color: var(--danger); }
.msg.success { background: var(--lime-dim); border: 1px solid rgba(198, 241, 53, 0.3); color: var(--lime); }

/* ── Utilidades de layout ─────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Movimiento — respuesta instantánea, nunca brusca ─────── */
.hoverable { transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, border-color 0.18s ease-out; }
.hoverable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
