/* ========================================
   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: calc(100vh / var(--app-zoom));
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;

  /* 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: #0adbc6;
  --auth-green-glow: rgba(10, 219, 198, 0.4);
  --auth-gold: #ffd23f;
  --auth-coral: #ff7866;
}

.auth-stage {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  height: calc(100vh / var(--app-zoom));
}

/* ─────────────── Pitch (left panel) ─────────────── */
.auth-pitch {
  position: relative;
  overflow: hidden;
  padding: 28px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  height: calc(100vh / var(--app-zoom));
  background:
    radial-gradient(120% 80% at 28% 16%, rgba(10, 219, 198, 0.16) 0%, transparent 55%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(0deg, rgba(10, 219, 198, 0.022) 0 100px, transparent 100px 200px),
    linear-gradient(180deg, #0c1512 0%, #0a120f 60%, #080d0b 100%);
}
.auth-pitch::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 55%, transparent 45%, rgba(0, 0, 0, 0.45) 100%);
  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); }

/* Solo visible en mobile donde el pitch está oculto */
.auth-mobile-brand { display: none; }
@media (max-width: 640px) {
  .auth-mobile-brand { display: inline-flex; }
}

.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.92em;
  height: 0.92em;
  vertical-align: baseline;
  margin-left: 0.04em;
  transform: translateY(0.116em);
}
.auth-hero__title .ball-slot > img {
  width: 100%;
  height: 100%;
  display: block;
  filter:
    drop-shadow(0 0 6px rgba(10, 219, 198, 0.55))
    drop-shadow(0 0 18px rgba(10, 219, 198, 0.32));
}

/* Streak — línea teal que cierra el wordmark */
.auth-hero__streak {
  height: 5px;
  width: clamp(180px, 42%, 320px);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--auth-green), rgba(10, 219, 198, 0));
  box-shadow: 0 0 14px var(--auth-green-glow);
}

.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;
}

/* Sponsor rail — marquee de logos al pie del pitch. */
/* Slot siempre presente para que el pitch mantenga su space-between. */
.auth-rail-slot {
  position: relative;
  z-index: 3;
  min-height: 132px;
  display: flex;
  align-items: flex-end;
}
.auth-rail-slot > * { flex: 1; }

.auth-sponsors {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tooltip Clavalo — vive fuera del track (posicionado por JS) */
.auth-sponsors__tip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%) translateY(4px);
  padding: 8px 13px 9px;
  background: rgba(8, 16, 13, 0.96);
  border: 1px solid var(--auth-green);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 18px var(--auth-green-glow);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--auth-ink);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}
.auth-sponsors__tip.-on {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-4px);
}
.auth-sponsors__tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--auth-green);
  margin-top: -1px;
}
.auth-sponsors__label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-scoreboard);
  font-size: 27px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--auth-ink);
}
.auth-sponsors__label::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--auth-green);
  box-shadow: 0 0 10px var(--auth-green-glow);
}
.auth-sponsors__track {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.auth-sponsors__row {
  display: flex;
  align-items: center;
  gap: 18px;
  width: max-content;
  padding: 4px 0;
  animation: auth-sponsors-scroll 42s linear infinite;
}
.auth-sponsors:hover .auth-sponsors__row { animation-play-state: paused; }
/* La imagen del sponsor ES el cuadrado (ya viene con su fondo). Sin chip extra. */
.auth-sponsors__chip {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.auth-sponsors__chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 15px; /* redondeo propio: sobrevive al transform del chip en hover */
  /* Filtro: monocromo por defecto; color real al hover. */
  filter: grayscale(1) contrast(0.95) brightness(0.95);
  transition: filter 0.3s ease;
}
.auth-sponsors__chip:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.auth-sponsors__chip:hover img {
  filter: none;
}
.auth-sponsors__chip .mk {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: rgba(244, 235, 214, 0.96);
  font-family: var(--font-scoreboard);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: #11201a;
}

@keyframes auth-sponsors-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-sponsors__row { animation: none; }
}

/* ─────────────── Form panel (right) ─────────────── */
.auth-form-side {
  position: relative;
  background: var(--auth-form-bg);
  display: flex;
  flex-direction: column;
  padding: 28px 56px;
  height: calc(100vh / var(--app-zoom));
  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(10, 219, 198, 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);
}

/* ─────────────── Tablet (900px) ─────────────── */
@media (max-width: 900px) {
  .auth-stage {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh / var(--app-zoom));
    overflow-x: hidden;
  }
  .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(48px, 14vw, 96px); white-space: normal; }
  .auth-hero__tagline { font-size: 14.5px; }
  .auth-sponsors__chip { width: 72px; height: 72px; }
  .auth-sponsors__label { font-size: 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; }
}

/* ─────────────── Mobile (640px) — solo el form ─────────────── */
@media (max-width: 640px) {
  .auth-pitch { display: none; }

  .auth-stage {
    display: block;
    min-height: calc(100vh / var(--app-zoom));
  }

  .auth-form-side {
    min-height: calc(100vh / var(--app-zoom));
    padding: 28px 20px 24px;
    display: flex;
    flex-direction: column;
  }

  .auth-form-side__body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
  }

  .auth-form-side__content {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
}

/* Badges "Próximamente en stores" — entre body y footer */
.auth-stores {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid var(--auth-line);
}
.auth-stores__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--auth-muted);
}
.auth-stores__label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--auth-line-strong);
}
.auth-stores__row { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-store {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  color: var(--auth-ink);
  text-decoration: none;
  cursor: default;
}
.auth-store__icon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--auth-ink); }
.auth-store__tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.auth-store__tx .r {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--auth-muted);
}
.auth-store__tx b {
  font-family: var(--font-scoreboard);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--auth-ink);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Brandmark mobile: logo más grande y con glow para que se vea */
@media (max-width: 640px) {
  .auth-mobile-brand > svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 6px var(--auth-green-glow));
  }
  .auth-mobile-brand { font-size: 20px; gap: 12px; }
}

/* Mobile: stack stores si el ancho aprieta */
@media (max-width: 380px) {
  .auth-stores__row { flex-direction: column; }
}
