/* ============================================================================
 * GMA Padel Trophy — Brand tokens & shared UI
 * Extracted from GMA Hub / design_handoff_rebrand.
 * ========================================================================== */

:root {
  /* ── GMA spectrum (from the rainbow logo) ─────────────── */
  --spec-lime:     #BCEC00;
  --spec-sky:      #4CADFF;
  --spec-blue:     #6C8FF7;
  --spec-lavender: #A88FEF;
  --spec-coral:    #EC7D72;
  --spec-orange:   #FF8C42;

  /* Signature gradient (used on titles + accents) */
  --grad-brand: linear-gradient(
    90deg,
    #BCEC00 0%,
    #4CADFF 28%,
    #6CA2FF 44%,
    #A88FEF 60%,
    #EC7D72 80%,
    #FF8C42 100%
  );

  /* ── Primary UI colours (dark theme — event mood) ─────── */
  --bg:        #0C0F15;
  --surface:   #161B23;
  --surface-2: #1D232D;
  --surface-3: #262E3A;
  --line:      #28303C;
  --line-2:    #38424F;
  --ink:       #EAEDF3;
  --ink-2:     #B4BCC8;
  --ink-3:     #7C8694;
  --ink-faint: #4C5460;

  --primary:        #2E97F0;
  --primary-strong: #1B7FD6;
  --primary-tint:   rgba(46,151,240,0.12);
  --on-primary:     #FFFFFF;

  --success: #5FB87C;
  --warning: #F5A623;
  --error:   #E5564E;

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radius / shadows */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.15);
  --shadow-md: 0 4px 14px rgba(0,0,0,.30), 0 2px 6px rgba(0,0,0,.20);
  --shadow-lg: 0 20px 44px rgba(0,0,0,.45), 0 6px 14px rgba(0,0,0,.25);
  --shadow-primary: 0 8px 24px rgba(46,151,240,.35);
}

/* ─── Base ─────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(46,151,240,0.14) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 100%, rgba(168,143,239,0.12) 0%, transparent 40%),
    var(--bg);
  min-height: 100dvh;
  min-height: 100vh;
}

/* ─── Layout shell (mobile-first) ─────────────────────── */
.shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.spacer { flex: 1; }

/* ─── Brand header ─────────────────────────────────────── */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}
.brand-logo img {
  height: 28px;
  width: auto;
  display: block;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Titles ──────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(28px, 8vw, 44px); line-height: 1.05; }
h2 { font-size: clamp(20px, 5vw, 28px); line-height: 1.15; }
h3 { font-size: 16px; }

.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-top: 12px;
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 14px;
  padding: 16px 26px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); transform: translateY(-2px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-3); background: rgba(255,255,255,0.03); }
.btn-block { width: 100%; }

.btn-gradient {
  background: var(--grad-brand);
  color: #0C0F15;
  box-shadow: 0 8px 24px rgba(168,143,239,.35);
}

/* ─── Forms ───────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  padding: 16px 18px;
  min-height: 54px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;               /* iOS: >=16px to prevent zoom on focus */
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.field .error-msg {
  color: var(--error);
  font-size: 13px;
  margin-top: 6px;
  min-height: 18px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  cursor: pointer;
  padding: 6px 0;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 22px;
  min-width: 22px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  margin: 0;
  flex-shrink: 0;
}
.check input:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check input:checked::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check a { color: var(--primary); text-decoration: none; }

/* ─── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ─── Loading spinner ─────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.error { background: #3a1010; color: #ffb4ae; border: 1px solid rgba(229,86,78,0.5); }
.toast.ok    { background: #10251b; color: #b4f0c8; border: 1px solid rgba(95,184,124,0.5); }
