/* ========================================
   Auth layout — split stage with pitch (left) + form panel (right).
   Content is provided per-view via content_for slots in
   app/views/layouts/auth.html.erb. Form styles live in
   components/auth-form.css; code-cell styles in components/verification.css.
   ======================================== */

.auth-body {
  margin: 0;
  padding: 0;
  background: var(--auth-form-bg);
  min-height: 100vh;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;

  /* auth-only design tokens */
  --auth-pitch-1: #0c3527;
  --auth-pitch-2: #114a36;
  --auth-pitch-deep: #07221a;
  --auth-form-bg: #0a1310;
  --auth-form-bg-2: #0d1714;
  --auth-line: rgba(244, 235, 214, 0.08);
  --auth-line-strong: rgba(244, 235, 214, 0.16);
  --auth-ink: #f4ebd6;
  --auth-ink-soft: #c8d6cd;
  --auth-muted: #76887e;
  --auth-green: #4ec77a;
  --auth-green-glow: rgba(78, 199, 122, 0.4);
  --auth-gold: #ffd23f;
  --auth-coral: #ff7866;
}

.auth-stage {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  height: 100vh;
}

/* ─────────────── Pitch (left panel) ─────────────── */
.auth-pitch {
  position: relative;
  overflow: hidden;
  padding: 28px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  height: 100vh;
  background:
    radial-gradient(120% 90% at 50% 20%, rgba(78, 199, 122, 0.07) 0%, transparent 50%),
    repeating-linear-gradient(0deg, var(--auth-pitch-1) 0 100px, var(--auth-pitch-2) 100px 200px);
}
.auth-pitch::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(110% 70% at 50% 60%, transparent 30%, rgba(0, 0, 0, 0.55) 95%);
  pointer-events: none;
}

.auth-pitch__svg {
  position: absolute;
  inset: 32px;
  pointer-events: none;
  opacity: 0.5;
}

.auth-pitch__jersey {
  position: absolute;
  font-family: var(--font-scoreboard);
  color: rgba(255, 255, 255, 0.04);
  font-size: 280px;
  line-height: 0.8;
  letter-spacing: -0.02em;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.auth-pitch__jersey.-a { top: 10%; right: 8%; transform: rotate(8deg); }
.auth-pitch__jersey.-b { bottom: 16%; right: -2%; font-size: 360px; transform: rotate(-4deg); }

/* Top row: brand mark + scoreboard */
.auth-pitch__top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-scoreboard);
  font-size: 18px;
  letter-spacing: 0.16em;
  color: var(--auth-ink);
  text-decoration: none;
}
.auth-brand-mark > svg { width: 22px; height: 22px; color: var(--auth-green); }

.auth-scoreboard {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 9px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  border: 1px solid var(--auth-line);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
}
.auth-scoreboard > * {
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.auth-scoreboard .dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auth-coral);
  box-shadow: 0 0 10px var(--auth-coral);
  animation: auth-blink 1.4s ease-in-out infinite;
}
.auth-scoreboard.-info .dot {
  background: var(--auth-gold);
  box-shadow: 0 0 8px var(--auth-gold);
  animation: none;
}
.auth-scoreboard.-check .dot {
  background: var(--auth-green);
  box-shadow: 0 0 8px var(--auth-green);
  animation: none;
}
.auth-scoreboard .label {
  /* Reset the global form-field .label (atoms.css) leaking into the pill. */
  margin: 0;
  display: inline;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: 0.16em;
  color: var(--auth-coral);
}
.auth-scoreboard.-info .label { color: var(--auth-gold); }
.auth-scoreboard.-check .label { color: var(--auth-green); }
.auth-scoreboard .match { color: var(--auth-ink); }
.auth-scoreboard .match .score {
  color: var(--auth-green);
  font-weight: 600;
  margin: 0 6px;
}
.auth-scoreboard .meta {
  color: var(--auth-gold);
  padding-left: 10px;
  border-left: 1px solid var(--auth-line-strong);
}

@keyframes auth-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Hero block */
.auth-hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--auth-green);
  text-transform: uppercase;
}
.auth-hero__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--auth-green);
}

.auth-hero__title {
  font-family: var(--font-scoreboard);
  font-size: clamp(56px, 8.4vw, 128px);
  line-height: 0.9;
  letter-spacing: 0.005em;
  color: var(--auth-ink);
  white-space: nowrap;
  margin: 0;
}
.auth-hero__title .ball-slot {
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  vertical-align: -0.08em;
  margin: 0 0.02em;
}
.auth-hero__title .ball-slot > svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: center;
  animation: auth-ball-spin 4s linear infinite;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4));
}
@keyframes auth-ball-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.auth-hero__tagline {
  font-size: 17px;
  line-height: 1.55;
  color: var(--auth-ink-soft);
  max-width: 460px;
  margin: 0;
}
.auth-hero__tagline em {
  font-style: normal;
  color: var(--auth-green);
  font-weight: 500;
}
.auth-hero__tagline strong {
  color: var(--auth-ink);
  font-weight: 600;
}

/* Ticker */
/* Always-present slot so the pitch column keeps its space-between distribution
   even when there's no ticker to render (CLAVALO stays put, hero/tagline keep
   their position). */
.auth-ticker-slot {
  position: relative;
  z-index: 3;
  min-height: 48px;
  display: flex;
}
.auth-ticker-slot > * { flex: 1; }

.auth-ticker {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  border: 1px solid var(--auth-line);
}
.auth-ticker > .badge {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--auth-green);
  color: var(--auth-pitch-deep);
  font-weight: 600;
}
.auth-ticker > .track {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 4%, black 96%, transparent);
}
.auth-ticker > .track > .row {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  animation: auth-ticker-scroll 35s linear infinite;
  font-family: var(--mono);
  font-size: 12.5px;
}
.auth-ticker > .track > .row > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-ink-soft);
}
.auth-ticker > .track > .row strong { color: var(--auth-ink); font-weight: 500; }
.auth-ticker > .track > .row em { font-style: normal; color: var(--auth-gold); font-weight: 500; }
.auth-ticker.-static {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--auth-ink-soft);
  gap: 12px;
}
.auth-ticker.-static strong { color: var(--auth-ink); font-weight: 500; }

@keyframes auth-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─────────────── Form panel (right) ─────────────── */
.auth-form-side {
  position: relative;
  background: var(--auth-form-bg);
  display: flex;
  flex-direction: column;
  padding: 28px 56px;
  height: 100vh;
  overflow: hidden;
}
.auth-form-side::before {
  content: "";
  position: absolute;
  top: 80px;
  bottom: 80px;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--auth-green) 50%, transparent);
  opacity: 0.4;
}
.auth-form-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 100% 0%, rgba(78, 199, 122, 0.06), transparent 60%);
  pointer-events: none;
}

.auth-form-side__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.auth-form-side__head .crumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--auth-muted);
}
.auth-form-side__head .crumb b {
  color: var(--auth-ink);
  font-weight: 500;
}
.auth-form-side__head .switch {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--auth-muted);
}
.auth-form-side__head .switch a {
  color: var(--auth-green);
  text-decoration: none;
  margin-left: 6px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.auth-form-side__head .switch a:hover { border-bottom-color: var(--auth-green); }

.auth-form-side__body {
  flex: 1 1 auto;
  display: flex;
  align-items: safe center;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--auth-line-strong) transparent;
}
.auth-form-side__body::-webkit-scrollbar { width: 6px; }
.auth-form-side__body::-webkit-scrollbar-thumb {
  background: var(--auth-line-strong);
  border-radius: 999px;
}
.auth-form-side__content {
  width: 100%;
  max-width: 420px;
  padding: 12px 0;
}

.auth-form-side__foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--auth-line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--auth-muted);
  gap: 16px;
  flex: 0 0 auto;
}
.auth-form-side__foot .stamp { justify-self: start; }
.auth-form-side__foot .legal-links { justify-self: center; }
.auth-form-side__foot > span:last-child { justify-self: end; }
.auth-form-side__foot .stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.auth-form-side__foot .stamp .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-green);
  box-shadow: 0 0 6px var(--auth-green);
}

/* ─────────────── Mobile ─────────────── */
@media (max-width: 900px) {
  .auth-stage {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .auth-pitch {
    padding: 32px 24px 28px;
    gap: 22px;
    height: auto;
    min-height: 60vh;
  }
  .auth-pitch__svg { inset: 16px; }
  .auth-pitch__jersey { display: none; }
  .auth-pitch__top { gap: 12px; }
  .auth-scoreboard { padding: 7px 12px; gap: 10px; }
  .auth-scoreboard > .match { font-size: 12px; }
  .auth-scoreboard > .label { font-size: 9.5px; }
  .auth-scoreboard > .meta { padding-left: 10px; font-size: 10.5px; }
  .auth-hero__title { font-size: clamp(56px, 14vw, 96px); }
  .auth-hero__tagline { font-size: 14.5px; }
  .auth-ticker > .badge { font-size: 9px; padding: 3px 7px; }
  .auth-ticker > .track > .row { font-size: 11.5px; gap: 22px; }

  .auth-form-side {
    padding: 32px 24px 28px;
    height: auto;
    min-height: auto;
    overflow: visible;
  }
  .auth-form-side__body {
    overflow: visible;
  }
  .auth-form-side::before { display: none; }
  .auth-form-side__head { margin-bottom: 24px; }
  .auth-form-side__head .crumb { font-size: 10px; }
  .auth-form-side__foot {
    padding-top: 24px;
    margin-top: 28px;
    grid-template-columns: 1fr;
    text-align: center;
    gap: 8px;
  }
  .auth-form-side__foot .stamp,
  .auth-form-side__foot .legal-links,
  .auth-form-side__foot > span:last-child {
    justify-self: center;
  }
  .auth-form-side__foot .stamp,
  .auth-form-side__foot span { font-size: 10px; }
}
