/* ══════════════════════════════════════════════════════════════════════════
   RivoPadel — Beta landing (mobile-first)
   Tokens mirror rivopadel-v1 "RivoPadel Design System" (tokens.css)
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg:        #0B0F1A;
  --card:      #131A2B;
  --card-alt:  #1A2332;
  --border:    #1E293B;

  /* Text */
  --text:      #E2E8F0;
  --text-2:    #94A3B8;
  --muted:     #64748B;

  /* Brand */
  --blue:      #1A56A8;
  --blue-bright:#3B82F6;
  --pink:      #E84393;
  --pink-soft: rgba(232, 67, 147, 0.12);
  --blue-soft: rgba(26, 86, 168, 0.15);
  --green:     #22C55E;
  --red:       #EF4444;

  /* Type */
  --display: 'Manrope', system-ui, sans-serif;
  --body:    'IBM Plex Sans', system-ui, sans-serif;
  --mono:    'Inter', system-ui, sans-serif;

  /* Shape */
  --radius-2: 8px;
  --radius-3: 10px;
  --radius-4: 12px;
  --radius-5: 20px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(.2, .8, .3, 1);
  --dur-fast: 0.2s;
  --dur-base: 0.36s;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 520px at 85% -10%, rgba(26, 86, 168, 0.22), transparent 60%),
    radial-gradient(760px 460px at -10% 108%, rgba(232, 67, 147, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
/* Subtle padel court behind the first screenful — top-down court markings:
   outer walls, net across the middle, service lines and centre line. The
   whole court fits inside a phone viewport so it reads as a court, and it
   scrolls with the page. The wrapper clips the rotated corners so they can
   never cause horizontal scroll. */
.court {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.court[hidden] { display: none !important; }

/* Landing is a single screen: no page scroll while it's showing.
   On very short viewports, fall back to scrolling rather than clipping. */
body.is-landing { overflow: hidden; height: 100dvh; }
@media (max-height: 620px) {
  body.is-landing { overflow: auto; height: auto; }
}
.court::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50vh;
  width: min(94vw, 50vh);
  aspect-ratio: 400 / 760;
  transform: translate(-50%, -50%) rotate(-6deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 760' fill='none' stroke='%235B8DEF' stroke-width='2'%3E%3Crect x='12' y='12' width='376' height='736'/%3E%3Cline x1='12' y1='380' x2='388' y2='380' stroke-width='3'/%3E%3Cline x1='12' y1='128' x2='388' y2='128'/%3E%3Cline x1='12' y1='632' x2='388' y2='632'/%3E%3Cline x1='200' y1='128' x2='200' y2='632'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  opacity: 0.17;
}
.app { position: relative; z-index: 1; }

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
input, select { font: inherit; }

/* ── App frame: full-width phone, contained column on bigger screens ───── */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
@media (min-width: 720px) {
  .app { max-width: 520px; }
  body { font-size: 16px; }
}

/* ── Top bar / brand lockup ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: center;
  padding: clamp(12px, 2.5vh, 22px) 16px 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px; /* ~22% app-icon radius, per V1 lockup */
  object-fit: contain;
}
.brand-wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
.brand-wordmark-accent { color: var(--blue-bright); }
@media (min-width: 720px) {
  .topbar { padding-top: 34px; }
  .brand-logo { width: 40px; height: 40px; border-radius: 9px; }
  .brand-wordmark { font-size: 26px; }
}

/* ── Shared bits ────────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
}
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--radius-4);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-pink { background: var(--pink); color: #fff; }
.btn-pink:hover { background: #F0559F; }
.btn-pink[disabled] { opacity: 0.55; cursor: default; }
.btn-outline { border: 1px solid var(--border); background: var(--card); color: var(--text); }
.btn-outline:hover { border-color: var(--muted); }
.btn-full { width: 100%; }

.view[hidden] { display: none; }
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  animation: view-in var(--dur-base) var(--ease-out);
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ══ LANDING ═════════════════════════════════════════════════════════════ */
.view--landing { justify-content: space-between; gap: clamp(14px, 2.5vh, 28px); }

.landing-hero {
  text-align: center;
  padding-top: clamp(8px, 4vh, 56px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 14px);
  align-items: center;
}
.landing-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, min(11vw, 6.2vh), 52px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.landing-title-accent {
  background: linear-gradient(100deg, var(--blue-bright) 10%, var(--pink) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-sub {
  margin: 0;
  max-width: 34ch;
  color: var(--text-2);
  font-size: 15px;
}
@media (min-width: 720px) {
  .landing-sub { font-size: 17px; max-width: 40ch; }
}

/* Route cards */
.route-cards { display: flex; flex-direction: column; gap: 12px; }
.route-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-5);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.route-card:active { transform: scale(0.985); }
.route-card-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-4);
}
.route-card-icon svg { width: 24px; height: 24px; }
.route-card--player .route-card-icon { background: var(--pink-soft); color: var(--pink); }
.route-card--organiser .route-card-icon { background: var(--blue-soft); color: var(--blue-bright); }
.route-card--player:hover, .route-card--player:focus-visible { border-color: rgba(232, 67, 147, 0.5); background: var(--card-alt); }
.route-card--organiser:hover, .route-card--organiser:focus-visible { border-color: rgba(59, 130, 246, 0.5); background: var(--card-alt); }
.route-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.route-card-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.route-card-sub { font-size: 13px; color: var(--text-2); }
.route-card-chevron { margin-left: auto; color: var(--muted); flex: 0 0 auto; }
.route-card-chevron svg { width: 18px; height: 18px; }

/* Landing footer */
.landing-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 14px);
  padding-bottom: clamp(12px, 2.5vh, 26px);
}
.store-lockup { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.store-coming {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.store-badge { height: 40px; width: auto; opacity: 0.92; }
.landing-foot-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.landing-foot-links a { text-decoration: none; }
.landing-foot-links a:hover { color: var(--text); }
.foot-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.landing-copyright { margin: 0; font-size: 11px; color: var(--muted); }

/* ══ WIZARD ══════════════════════════════════════════════════════════════ */
.view--wizard { padding-bottom: 0; }
.wizard-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 18px;
}
.wizard-back {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--radius-3);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.wizard-back:hover { color: var(--text); border-color: var(--muted); }
.wizard-back svg { width: 18px; height: 18px; }
.wizard-progress {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--card-alt);
  overflow: hidden;
}
.wizard-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--blue-bright), var(--pink));
  transition: width var(--dur-base) var(--ease-out);
}
.wizard-step-count {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.wizard-body { flex: 1; }
.wizard-step { display: flex; flex-direction: column; gap: 18px; animation: view-in var(--dur-fast) var(--ease-out); }
.step-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.step-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.step-hint { margin: -8px 0 0; font-size: 13px; color: var(--text-2); }

/* Option cards (radio & checkbox) */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-4);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-label { font-size: 15px; font-weight: 500; color: var(--text); }
.option-sub { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.option-mark {
  margin-left: auto;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all var(--dur-fast) var(--ease-out);
}
.option--check .option-mark { border-radius: 6px; }
.option-mark svg { width: 13px; height: 13px; }
.option:hover { border-color: var(--muted); }
.option.selected { border-color: var(--pink); background: var(--pink-soft); }
.option.selected .option-mark { border-color: var(--pink); background: var(--pink); color: #fff; }

/* Text inputs */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}
.field-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-4);
  color: var(--text);
  font-size: 16px; /* ≥16px prevents iOS zoom-on-focus */
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field-input::placeholder { color: var(--muted); }
.field-input:focus { border-color: var(--blue-bright); }
.field-input.invalid { border-color: var(--red); }

.wizard-foot {
  position: sticky;
  bottom: 0;
  padding: 14px 0 calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wizard-error {
  margin: 0;
  font-size: 13px;
  color: var(--red);
  text-align: center;
}

/* ══ CONFIRMATION ════════════════════════════════════════════════════════ */
.view--thanks { justify-content: center; }
.thanks-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 24px 0 32px;
}
.thanks-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.14);
  color: var(--green);
  animation: pop-in 0.5s var(--ease-out);
}
.thanks-check svg { width: 30px; height: 30px; }
@keyframes pop-in {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.thanks-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.thanks-sub { margin: 0; max-width: 36ch; color: var(--text-2); font-size: 14px; }
.thanks-steps {
  list-style: none;
  margin: 10px 0;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-5);
  text-align: left;
}
.thanks-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text);
}
.thanks-steps li + li { border-top: 1px solid var(--border); }
.thanks-step-num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-bright);
  font-size: 11px;
  font-weight: 700;
}
.thanks-home {
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}
.thanks-home:hover { color: var(--text); }
.store-lockup--thanks { margin-top: 14px; }

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
