:root {
  color-scheme: light;
  --bg: #1c1c1c;
  --card: #ffffff;
  --ink: #272727;
  --muted: #6f6e66;
  --line: #e4e2d0;
  --accent: #dfff4f;
  --error: #b3261e;
  --ok: #2e6b30;
  --display: "League Spartan", Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #121212;
  color: var(--ink);
  overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.brand {
  display: flex;
  justify-content: center;
  color: #fff;
  margin-bottom: 32px;
}
.brand svg { height: 24px; width: auto; display: block; }
.brand { animation: px-fade 0.8s ease-out both; }
form {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 34px 28px 30px;
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(223, 255, 79, 0.08),
    0 0 80px -20px rgba(223, 255, 79, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: px-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
}
form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #f4ffb3 50%, var(--accent));
  background-size: 200% 100%;
  animation: px-shimmer 4s linear infinite;
}
h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.intro { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.45; }
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 8px;
}
label:first-of-type { margin-top: 0; }
input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
button:hover { filter: brightness(0.96); }
input[readonly] { background: #f5f4ec; color: var(--muted); }
button {
  width: 100%;
  margin-top: 20px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 12px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: wait; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.error { color: var(--error); font-size: 14px; margin-top: 12px; min-height: 1.2em; }
.note { position: relative; animation: px-fade 0.8s ease-out 0.4s both; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.6); margin-top: 20px; line-height: 1.5; }
.note a { color: var(--accent); }


/* ── Animated court background ─────────────────────────────────────────────
   A padel court in perspective that draws itself in, with a glowing net and a
   ball rallying across it. Markup is added by auth.js. */
.px-court-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 58%, #2b2b2b 0%, #1c1c1c 45%, #0f0f0f 100%);
}
.px-court-bg::after {
  /* soft vignette so the card always reads clearly */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(18, 18, 18, 0.35) 0, rgba(18, 18, 18, 0) 30%),
    linear-gradient(180deg, rgba(15, 15, 15, 0.6) 0%, transparent 25%, transparent 75%, rgba(15, 15, 15, 0.7) 100%);
}
.px-glow {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 90vmax;
  height: 90vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(223, 255, 79, 0.11) 0%, rgba(223, 255, 79, 0) 55%);
  animation: px-breathe 7s ease-in-out infinite;
}
.px-court {
  position: absolute;
  left: 50%;
  top: 58%;
  width: min(1500px, 175vw);
  transform: translate(-50%, -50%) perspective(1600px) rotateX(58deg) rotateZ(-20deg);
  animation: px-drift 22s ease-in-out infinite alternate;
}
.px-court svg { display: block; width: 100%; height: auto; overflow: visible; }
.px-court .line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 0.55;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: px-draw 1.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.px-court .wall { stroke: rgba(255, 255, 255, 0.06); stroke-width: 4; }
.px-court .d1 { animation-delay: 0.15s; }
.px-court .d2 { animation-delay: 0.45s; }
.px-court .d3 { animation-delay: 0.55s; }
.px-court .d4 { animation-delay: 0.75s; }
.px-court .net {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 6px rgba(223, 255, 79, 0.9)) drop-shadow(0 0 18px rgba(223, 255, 79, 0.5));
  animation: px-draw 1.2s cubic-bezier(0.65, 0, 0.35, 1) 0.9s forwards, px-net 3.5s ease-in-out 2.1s infinite;
}

/* Ball: travels across the screen (rally) while bouncing (ball) with a shadow. */
.px-rally {
  position: absolute;
  left: 0;
  top: 0;
  animation: px-rally 7s cubic-bezier(0.45, 0, 0.55, 1) 1.6s infinite alternate both;
}
.px-ball {
  position: relative;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -30px;
  animation: px-bounce 1.4s linear 1.6s infinite both;
}
.px-ball-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 34% 30%, #fbffd6 0%, #e9ff7a 22%, #dfff4f 45%, #a8c71c 100%);
  box-shadow: 0 0 22px rgba(223, 255, 79, 0.55), inset -3px -4px 8px rgba(0, 0, 0, 0.18);
  animation: px-spin 1.1s linear infinite;
}
.px-ball-inner::before,
.px-ball-inner::after {
  /* the ball's curved seams */
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  width: 70%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}
.px-ball-inner::before { left: -42%; }
.px-ball-inner::after { right: -42%; }
.px-shadow {
  position: absolute;
  left: -16px;
  top: -4px;
  width: 32px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 70%);
  animation: px-shadow 1.4s linear 1.6s infinite both;
}

@keyframes px-draw { to { stroke-dashoffset: 0; } }
@keyframes px-net {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes px-breathe {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes px-drift {
  from { transform: translate(-50%, -50%) perspective(1600px) rotateX(59deg) rotateZ(-22deg); }
  to { transform: translate(-50%, -50%) perspective(1600px) rotateX(55deg) rotateZ(-15deg); }
}
@keyframes px-rally {
  from { transform: translate(12vw, 80vh); }
  to { transform: translate(86vw, 34vh); }
}
@keyframes px-bounce {
  0% { transform: translateY(0) scale(1.18, 0.82); animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); }
  8% { transform: translateY(-14px) scale(0.94, 1.06); animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); }
  50% { transform: translateY(-130px) scale(1, 1); animation-timing-function: cubic-bezier(0.55, 0.06, 0.68, 0.19); }
  96% { transform: translateY(-6px) scale(0.96, 1.04); }
  100% { transform: translateY(0) scale(1.18, 0.82); }
}
@keyframes px-shadow {
  0%, 100% { transform: scale(1.15); opacity: 0.9; }
  50% { transform: scale(0.45); opacity: 0.25; animation-timing-function: cubic-bezier(0.55, 0.06, 0.68, 0.19); }
}
@keyframes px-spin { to { transform: rotate(360deg); } }
@keyframes px-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes px-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes px-shimmer { to { background-position: -200% 0; } }

@media (max-width: 640px) {
  .px-court { top: 86%; width: 250vw; }
  .px-glow { top: 86%; }
  .px-ball { width: 22px; height: 22px; margin-left: -11px; margin-top: -22px; }
  @keyframes px-rally {
    from { transform: translate(10vw, 94vh); }
    to { transform: translate(88vw, 84vh); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .px-court-bg *, .px-court-bg *::before, .px-court-bg *::after,
  form, form::before, .brand, .note { animation: none !important; }
  .px-court .line, .px-court .net { stroke-dashoffset: 0; }
  .px-rally { transform: translate(72vw, 70vh); }
}

.wordmark { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: #fff; }
.wordmark b { font-weight: 700; margin-left: 5px; color: var(--accent); }
.wm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }

.mode-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 auto 14px; width: fit-content; max-width: 100%; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.mode-tabs button { width: auto; margin: 0; border: 0; background: none; color: rgba(255, 255, 255, 0.7); font: 700 12px var(--display); letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 14px 7px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.mode-tabs button[aria-selected="true"] { background: #fff; color: #1c1c1c; }
form[hidden], .note[hidden] { display: none; }

/* Sign-in logos: Padel X Club and Padel Magic UK side by side */
.brand.logos { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; color: #fff; }
.brand.logos .logo-px { height: 24px; width: auto; display: block; }
.brand.logos .logo-pm { height: 30px; width: auto; display: block; }
.brand.logos .logo-divider { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.28); }
@media (max-width: 420px) { .brand.logos { gap: 16px; } .brand.logos .logo-px { height: 20px; } .brand.logos .logo-pm { height: 25px; } }
