/* =========================================================================
   FitSync auth pages — matches the marketing site's design system
   (athletic editorial: ink #0C0F09, signal lime #C6F135, bone paper #f4f4f2;
   Bricolage Grotesque display / Schibsted Grotesk text / Spline Sans Mono data)
   ========================================================================= */

:root {
  --ink: #0c0f09;
  --ink-2: #141a0f;
  --ink-3: #1d2415;
  --line-ink: rgba(244, 244, 242, 0.14);
  --line-ink-soft: rgba(244, 244, 242, 0.08);
  --lime: #c6f135;
  --lime-soft: rgba(198, 241, 53, 0.14);
  --on-lime: #101408;
  --paper: #f4f4f2;
  --paper-2: #eaeae6;
  --line-paper: #d9d9d3;
  --on-paper: #171b10;
  --muted-paper: #5f625b;
  --muted-ink: #a2a5a0;
  --orange: #f2622e;
  --font-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-text: "Schibsted Grotesk", "Helvetica Neue", sans-serif;
  --font-mono: "Spline Sans Mono", "SF Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  color: var(--on-paper);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lime); color: var(--on-lime); }
a { color: inherit; }

@keyframes auth-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.rise { animation: auth-rise 0.8s var(--ease-out) both; animation-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---- Layout: full-height split ---- */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  min-height: 100dvh;
}

/* ---- Left: ink brand panel ---- */
.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(28px, 4vw, 56px);
  overflow: hidden;
}
.auth-side::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(55% 60% at 80% 12%, rgba(198, 241, 53, 0.13), transparent 60%),
    radial-gradient(45% 55% at 5% 95%, rgba(198, 241, 53, 0.06), transparent 60%),
    repeating-linear-gradient(90deg, var(--line-ink-soft) 0 1px, transparent 1px 88px);
}
.auth-side > * { position: relative; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--paper); text-decoration: none; width: fit-content;
}
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--lime); color: var(--on-lime);
  transform: rotate(-8deg);
  transition: transform 0.3s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(8deg) scale(1.05); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }

.auth-side-mid { display: grid; gap: 28px; max-width: 460px; }
.auth-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0;
}
.auth-display em { font-style: italic; font-weight: 600; color: var(--lime); }
.auth-side-sub { color: var(--muted-ink); font-size: 15.5px; margin: 0; max-width: 40ch; }

.auth-side-foot {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted-ink);
  display: flex; align-items: center; gap: 12px;
}
.auth-side-foot::before { content: ""; width: 26px; height: 2px; background: var(--lime); }

/* Mini product console on the ink panel */
.mini-console {
  background: var(--ink-2);
  border: 1px solid var(--line-ink);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  font-size: 13px;
  max-width: 400px;
}
.mini-console-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-ink-soft);
}
.mini-console-dots { display: inline-flex; gap: 5px; }
.mini-console-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-ink); }
.mini-console-dots i:first-child { background: var(--orange); }
.mini-console-dots i:nth-child(2) { background: var(--lime); }
.mini-console-title { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--muted-ink); }
.mini-console-body { padding: 16px; display: grid; gap: 10px; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-kpi { background: var(--ink-3); border: 1px solid var(--line-ink-soft); border-radius: 10px; padding: 11px 12px; }
.mini-kpi span { display: block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-ink); margin-bottom: 4px; }
.mini-kpi b { font-family: var(--font-mono); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.mini-kpi small { display: block; font-size: 10.5px; color: var(--lime); margin-top: 2px; }
.mini-row {
  display: flex; align-items: center; gap: 9px;
  background: var(--ink-3); border-radius: 10px; padding: 9px 11px;
  font-size: 12px;
}
.mini-row em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--muted-ink); }
.mini-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); flex: none; }
.mini-dot--warn { background: var(--orange); }

/* ---- Right: paper form panel ---- */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 48px);
  background:
    radial-gradient(40% 40% at 90% 8%, rgba(198, 241, 53, 0.12), transparent 65%),
    var(--paper);
}
.auth-card { width: min(430px, 100%); }

.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted-paper); margin: 0 0 14px;
}
.auth-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--lime); }

.auth-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 10px;
}
.auth-sub { color: var(--muted-paper); font-size: 15px; margin: 0 0 26px; }

.auth-alert {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 14px; font-weight: 600;
  margin-bottom: 18px;
}
.auth-alert--error, .auth-alert--warning {
  background: rgba(242, 98, 46, 0.1);
  border: 1.5px solid rgba(242, 98, 46, 0.45);
  color: #b3401a;
}
.auth-alert--success, .auth-alert--info {
  background: var(--lime-soft);
  border: 1.5px solid rgba(198, 241, 53, 0.7);
  color: var(--on-paper);
}

.auth-form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 7px; }
.auth-field > span {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-paper);
}
.auth-field input[type="text"],
.auth-field input[type="tel"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  background: #fbfaf4;
  border: 1.5px solid var(--line-paper);
  border-radius: 12px;
  padding: 13px 16px;
  font-family: var(--font-text);
  font-size: 15.5px;
  color: var(--on-paper);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-field input::placeholder { color: #a9a692; }
.auth-field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--ink);
  box-shadow: 0 0 0 3.5px rgba(198, 241, 53, 0.4);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 36px; height: 36px;
  background: transparent; border: none; border-radius: 10px;
  color: var(--muted-paper); cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.pw-toggle:hover { color: var(--on-paper); background: var(--paper-2); }
.pw-toggle:focus-visible { outline: 2.5px solid var(--lime); outline-offset: 1px; }

.auth-check {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted-paper);
  cursor: pointer; user-select: none;
}
.auth-check input {
  appearance: none; -webkit-appearance: none;
  width: 19px; height: 19px; margin: 0;
  border: 1.5px solid var(--line-paper); border-radius: 6px;
  background: #fbfaf4;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.auth-check input::after {
  content: "";
  width: 10px; height: 10px;
  transform: scale(0);
  transition: transform 0.15s var(--ease-out);
  background: var(--on-lime);
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 16%, 84% 4%, 38% 70%);
}
.auth-check input:checked { background: var(--lime); border-color: var(--lime); }
.auth-check input:checked::after { transform: scale(1); }
.auth-check input:focus-visible { outline: 2.5px solid var(--lime); outline-offset: 2px; }

.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border: none; border-radius: 999px;
  padding: 15px 28px;
  font-family: var(--font-text); font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s;
}
.auth-btn:hover { background: var(--ink-3); transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(12, 15, 9, 0.65); }
.auth-btn:active { transform: none; }
.auth-btn:disabled { opacity: 0.65; cursor: default; transform: none; box-shadow: none; }
.auth-btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

.auth-foot {
  margin: 6px 0 0; padding-top: 18px;
  border-top: 1px solid var(--line-paper);
  font-size: 14px; color: var(--muted-paper);
  display: grid; gap: 8px;
}
.auth-foot a {
  color: var(--on-paper); font-weight: 700; text-decoration: none;
  text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.auth-foot a:hover { color: var(--orange); }

/* ---- Mobile ---- */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 100dvh; }
  .auth-side { min-height: auto; padding-bottom: 34px; gap: 26px; }
  .auth-side-mid { gap: 18px; }
  .mini-console { display: none; }
  .auth-display { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .auth-main { align-items: flex-start; padding-top: 34px; }
}

.auth-field-error { font-style: normal; font-size: 13px; font-weight: 600; color: var(--orange); }

/* Reserve space only once Turnstile has rendered — avoids the empty gap when
   the widget fails to load (wrong hostname / blocked script). */
.auth-turnstile { display: grid; gap: 8px; min-height: 0; }
.auth-turnstile.is-ready .cf-turnstile { min-height: 65px; }
.auth-turnstile.is-failed { min-height: 0; }
.auth-turnstile-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
}
.cf-turnstile { min-height: 0; }
