/* ============================================================
   1Rank.site — Auth pages: "The Pit"
   Pure-black operator-room aesthetic. Tight serif display, hairline
   inputs, slowed starfield, heartbeat line, side ticker on
   desktop. Scoped to .auth-body so the rest of main.css is
   untouched.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---------- Base ---------- */
.auth-body {
  background:
    radial-gradient(1050px 620px at 16% 10%, rgba(61, 106, 176, .16), transparent 62%),
    radial-gradient(840px 520px at 88% 12%, rgba(25, 58, 112, .12), transparent 68%),
    #000;
  color: #fff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0;
  --header-safe-top: env(safe-area-inset-top, 0px);
  --header-dock-top: var(--header-safe-top);
  --header-flow-gap: 0px;
}

.auth-body * { box-sizing: border-box; }

/* Stars: dimmed almost-still backdrop. Canvas opacity is the cheap
   way to "slow" the perceived motion without rewriting stars.js. */
.auth-body .stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: .54;
  pointer-events: none;
  filter: blur(.2px);
}

/* Tight side vignette so the form column reads as the focal area
   without pushing a visible card around it. */
.auth-body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  background:
    radial-gradient(1200px 600px at 18% 50%, rgba(120,160,220,.13), transparent 60%),
    radial-gradient(circle at 74% 18%, rgba(255,255,255,.12) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 72%, rgba(210,228,255,.10) 0 1px, transparent 2px),
    linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.6) 100%);
  opacity: .96;
  pointer-events: none;
}

/* ---------- Layout ---------- */
.auth-body .auth-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px clamp(20px, 4vw, 48px);
  gap: 28px;
}

/* Header bar — wordmark + meta */
.auth-body .auth-header {
  position: sticky;
  top: var(--header-dock-top);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  text-align: left;
  transition: background var(--t-slow), border-color var(--t-slow), box-shadow var(--t-slow), padding var(--t-slow);
}
.auth-body .auth-header .wordmark {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  color: #fff;
  text-decoration: none;
}
.auth-body .auth-header .wordmark .mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1.5px solid #fff;
  border-radius: 4px;
  background: rgba(255,255,255,.045);
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}
.auth-body .auth-header .meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6a6a6a;
}
/* Hide the old logo/tagline if a view still emits them */
.auth-body .auth-header .logo,
.auth-body .auth-header .auth-tagline { display: none; }

/* Main split: form (left) + ticker rail (right) on desktop */
.auth-body .auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

/* The form column never exceeds a comfortable reading width */
.auth-body .auth-card {
  width: 100%;
  max-width: 520px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  animation: pit-fade-in .6s ease both;
}

.auth-body .auth-login-panel {
  background:
    linear-gradient(180deg, rgba(7, 24, 50, .92), rgba(2, 10, 24, .88));
  border: 1px solid rgba(93, 124, 168, .44);
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 24px 70px rgba(0,0,0,.34);
  padding: clamp(20px, 4vw, 28px);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.auth-body .auth-login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 16%, rgba(255,255,255,.10), transparent 1.4px),
    radial-gradient(circle at 82% 22%, rgba(255,255,255,.08), transparent 1.2px),
    radial-gradient(circle at 64% 74%, rgba(255,255,255,.06), transparent 1.1px);
  opacity: .7;
}
.auth-body .auth-login-panel > * {
  position: relative;
  z-index: 1;
}
.auth-body .auth-login-hero .auth-sub {
  margin-bottom: 0;
}
.auth-body .auth-login-form-panel .auth-tabs {
  display: flex;
  width: 100%;
}
.auth-body .auth-login-form-panel form {
  margin: 0;
}
.auth-body .auth-login-meta-panel {
  padding-top: 18px;
  padding-bottom: 18px;
}
.auth-body .auth-login-meta-panel .auth-meta {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

@keyframes pit-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Typography ---------- */
.auth-body .auth-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #9a9a9a;
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.auth-body .auth-eyebrow::before {
  content: "";
  width: 28px; height: 1px; background: #4a4a4a;
}

.auth-body h1 {
  font-family: 'Fraunces', 'Times New Roman', serif !important;
  font-weight: 700 !important;
  color: #fff !important;
  font-size: clamp(2.4rem, 5.6vw, 3.6rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.025em !important;
  margin: 0 0 14px !important;
  text-align: left !important;
}
.auth-body h1 em {
  font-style: italic;
  font-weight: 600;
  color: #cfcfcf;
}
.auth-body .auth-card h1 { text-align: left; }

.auth-body .auth-sub {
  text-align: left;
  color: #9a9a9a;
  font-size: 1rem;
  max-width: 440px;
  margin: 0 0 36px;
}

/* ---------- Tabs (Sign in / Create) ---------- */
.auth-body .auth-tabs {
  display: inline-flex;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #17263d;
  padding: 0;
  margin: 0 0 28px;
  gap: 28px;
}
.auth-body .auth-tabs a {
  flex: 0 0 auto;
  padding: 0 0 14px;
  border-radius: 0;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .04em;
  color: #6a6a6a;
  text-transform: uppercase;
  position: relative;
  text-decoration: none;
  transition: color 180ms ease;
}
.auth-body .auth-tabs a:hover { color: #fff; }
.auth-body .auth-tabs a.active {
  background: transparent;
  color: #fff;
}
.auth-body .auth-tabs a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: #fff;
}

/* ---------- Form: hairline inputs, no card ---------- */
.auth-body .form-group {
  margin-bottom: 26px;
  position: relative;
}
.auth-body .form-label {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #6a6a6a;
  margin-bottom: 10px;
  font-weight: 500;
}
.auth-body .form-control {
  width: 100%;
  padding: 10px 0 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #2b4264;
  border-radius: 0;
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  letter-spacing: 0;
  transition: border-color 200ms ease, color 200ms ease;
  box-shadow: none;
}
.auth-body .form-control::placeholder { color: #4a4a4a; }
.auth-body .form-control:hover { border-bottom-color: #4a4a4a; }
.auth-body .form-control:focus {
  outline: none;
  border-bottom-color: #fff;
  background: transparent;
  box-shadow: none;
}
.auth-body .form-control:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0px 1000px #000 inset;
  caret-color: #fff;
}
.auth-body .form-hint {
  margin-top: 8px;
  color: #6a6a6a;
  font-size: 12px;
  letter-spacing: .02em;
}

/* Checkbox row — thinner, no green */
.auth-body .checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer;
  font-size: .9rem;
  color: #9a9a9a;
}
.auth-body .checkbox input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  margin-top: 2px;
  border: 1px solid #4a4a4a;
  background: transparent;
  border-radius: 2px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 160ms ease;
}
.auth-body .checkbox input[type="checkbox"]:checked {
  background: #fff;
  border-color: #fff;
}
.auth-body .checkbox input[type="checkbox"]:checked::after {
  content: ""; width: 8px; height: 8px; background: #000;
  clip-path: polygon(14% 44%, 0% 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.auth-body .checkbox a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #4a4a4a; }
.auth-body .checkbox a:hover { text-decoration-color: #fff; }

/* ---------- Primary button: full-bleed bar ---------- */
.auth-body .auth-card .btn,
.auth-body .auth-card .btn-block,
.auth-body .auth-card .btn-lg {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-radius: 0;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}
.auth-body .auth-card .btn::after {
  content: "→";
  font-family: 'Fraunces', serif;
  font-size: 18px;
  letter-spacing: 0;
  margin-left: 12px;
  transition: transform 200ms ease;
}
.auth-body .auth-card .btn:hover {
  background: #cfcfcf;
  border-color: #cfcfcf;
  color: #000;
}
.auth-body .auth-card .btn:hover::after { transform: translateX(4px); }
.auth-body .auth-card .btn:active { transform: translateY(1px); }

/* ---------- Meta links under the form ---------- */
.auth-body .auth-meta {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #17263d;
  text-align: left;
  font-size: 13px;
  color: #6a6a6a;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em;
}
.auth-body .auth-meta a {
  color: #fff;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #4a4a4a;
  text-underline-offset: 4px;
}
.auth-body .auth-meta a:hover { text-decoration-color: #fff; }
.auth-body .auth-meta .text-faint { color: #4a4a4a; }

/* ---------- Flash messages ---------- */
.auth-body .flash {
  padding: 12px 14px;
  font-size: .9rem;
  margin-bottom: 22px;
  border: 1px solid #2b4264;
  border-radius: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .02em;
  color: #cfcfcf;
}
.auth-body .flash-error {
  border-color: #4a2a2a;
  color: #ffb4b4;
  background: rgba(255,80,80,.04);
}
.auth-body .flash-error::before {
  content: "";
  color: #ff8a8a;
  font-weight: 700;
}
.auth-body .flash-success {
  border-color: #4a4a4a;
  color: #ffffff;
  background: rgba(255,255,255,.04);
}
.auth-body .flash-success::before {
  content: "";
  font-weight: 700;
}

/* ---------- Right rail: ticker / promises ---------- */
.auth-body .auth-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid #17263d;
  padding-left: clamp(24px, 3vw, 48px);
  min-height: 360px;
}
.auth-body .rail-panel {
  background:
    linear-gradient(180deg, rgba(7, 24, 50, .88), rgba(2, 10, 24, .82));
  border: 1px solid rgba(93, 124, 168, .38);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 18px 54px rgba(0,0,0,.26);
  position: relative;
  overflow: hidden;
}
.auth-body .rail-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.09), transparent 1.2px),
    radial-gradient(circle at 76% 70%, rgba(255,255,255,.06), transparent 1px);
  opacity: .7;
}
.auth-body .rail-panel > * {
  position: relative;
  z-index: 1;
}
.auth-body .rail-promise-panel {
  padding: 22px;
}
.auth-body .rail-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #6a6a6a;
}
.auth-body .rail-headline {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  line-height: 1.15;
  color: #fff;
  margin: 0;
}
.auth-body .rail-headline em { font-style: italic; color: #cfcfcf; }

.auth-body .rail-ticker {
  display: flex; flex-direction: column;
  gap: 12px;
}
.auth-body .rail-ticker .row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 16px;
}
.auth-body .rail-ticker .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #4a4a4a;
  letter-spacing: .12em;
}
.auth-body .rail-ticker .label {
  font-size: .92rem;
  color: #cfcfcf;
}
.auth-body .rail-ticker .value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  color: #fff;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* ---------- Heartbeat hairline (bottom of viewport) ---------- */
.auth-body .heartbeat {
  position: fixed;
  left: clamp(20px, 4vw, 48px);
  right: clamp(20px, 4vw, 48px);
  bottom: 78px;
  height: 1px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, #17263d 12%, #17263d 88%, transparent 100%);
}
.auth-body .heartbeat::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  transform: translate(0, -50%);
  box-shadow: 0 0 12px rgba(255,255,255,.6);
  animation: hb-run 9s linear infinite;
}
@keyframes hb-run {
  0%   { left: 0%;   opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ---------- Footer ---------- */
.auth-body .auth-footer {
  position: relative;
  z-index: 2;
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #17263d;
  padding-top: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #4a4a4a;
}
.auth-body .auth-footer p { margin: 0; }
.auth-body .auth-footer a { color: #6a6a6a; text-decoration: none; }
.auth-body .auth-footer a:hover { color: #fff; }
.auth-body .auth-footer .footer-links a + a { margin-left: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .auth-body .auth-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .auth-body .auth-rail {
    border-left: 0;
    border-top: 1px solid #17263d;
    padding-left: 0;
    padding-top: 28px;
    min-height: 0;
  }
  .auth-body .heartbeat { display: none; }
}

@media (max-width: 560px) {
  .auth-body {
    --header-dock-top: max(8px, env(safe-area-inset-top, 0px));
    --header-flow-gap: calc(var(--header-dock-top) + 18px);
  }
  .auth-body .auth-wrap {
    padding: calc(22px + var(--header-flow-gap)) 18px 22px;
    gap: 20px;
  }
  .auth-body .auth-header {
    margin: 0;
    padding: 0;
    gap: 10px;
  }
  .auth-body.header-is-docked .auth-header {
    padding: 8px;
    margin: -8px -8px 0;
    background: rgba(0,0,0,.68);
    border: 1px solid rgba(156, 184, 232, .30);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,.42), 0 1px 0 rgba(255,255,255,.07) inset;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .auth-body .auth-header .wordmark {
    gap: 9px;
    font-size: 13px;
  }
  .auth-body .auth-header .wordmark .mark {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .auth-body .auth-header .meta { display: none; }
  .auth-body h1 { font-size: 2.1rem !important; }
  .auth-body .auth-sub { font-size: .95rem; }
  .auth-body .auth-login-panel {
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 14px;
  }
  .auth-body .rail-promise-panel {
    padding: 18px;
  }
  .auth-body .rail-ticker .row {
    grid-template-columns: 26px 1fr;
  }
  .auth-body .rail-ticker .value {
    grid-column: 2;
  }
  .auth-body .auth-card .btn,
  .auth-body .auth-card .btn-lg { padding: 16px 18px; font-size: 13px; }
  .auth-body .auth-footer .footer-links a + a { margin-left: 12px; }
}

/* Reduce motion: kill the heartbeat run + fade */
@media (prefers-reduced-motion: reduce) {
  .auth-body .auth-card { animation: none; }
  .auth-body .heartbeat::after { animation: none; left: 50%; }
}

.auth-body, .auth-body *, .auth-body input, .auth-body textarea, .auth-body select, .auth-body button {
  font-family: var(--font-typewriter) !important;
  letter-spacing: 0 !important;
}
.auth-body [class*="num"], .auth-body [class*="value"], .auth-body [class*="price"], .auth-body [class*="amount"], .auth-body [class*="metric"], .auth-body [class*="stat"] {
  font-family: var(--font-typewriter) !important;
  font-variant-numeric: tabular-nums !important;
}

.auth-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.language-form select {
  appearance: none;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  border-radius: 999px;
  padding: 8px 28px 8px 12px;
  font: inherit;
  font-size: 12px;
}
.language-form select option {
  background: #061934;
  color: #fff;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[dir="rtl"] .auth-body,
[dir="rtl"] .auth-card,
[dir="rtl"] .auth-rail {
  text-align: right;
}
[dir="rtl"] .auth-tabs,
[dir="rtl"] .auth-footer,
[dir="rtl"] .auth-header {
  direction: rtl;
}
