/* ============================================================
   Pymander Health — auth gates (invite + signup)
   Layered on home-v2.css. Split-screen layout: a clean light form
   panel on the left, a full-height editorial image on the right.
   Brighter-orange accent for the login flow. No visibility gate
   here — pages that need the pre-paint redirect gate add it inline.
   ============================================================ */

:root { --accent: #161614; }

body { background: var(--light); min-height: 100svh; }

.hidden { display: none !important; }
.center { text-align: center; }

/* ── split layout ─────────────────────────────────────────────── */
.auth-split {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  background: var(--light);
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: clamp(26px, 3.5vw, 52px);
}
.auth-top { display: flex; justify-content: center; padding-bottom: 16px; }
.auth-logo-link { display: inline-flex; align-items: center; gap: 9px; }
.auth-logo-link img { width: 30px; height: 30px; }
.auth-logo-link span { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; color: var(--ink); }

.auth-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 0;
  text-align: center;
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 16px;
  font-size: 12.5px;
  color: var(--text-muted, rgba(31,31,31,0.42));
}
.auth-foot a { color: inherit; transition: color 0.2s var(--ease); }
.auth-foot a:hover { color: var(--ink); }
.auth-foot .sep { opacity: 0.45; }

/* right-hand panel: the homepage service cards (reusing .svc from
   home-v2.css) scrolling vertically, stacked on top of each other.
   Hidden on mobile via the breakpoint below. */
.auth-media {
  position: relative; overflow: hidden;
  display: flex; gap: clamp(12px, 1.4vw, 18px);
  padding: 0 clamp(20px, 2.4vw, 40px);
  background: var(--light);
}
/* two columns scrolling vertically in opposite directions. Tracks are
   absolute so their (tall) height doesn't stretch the grid row. */
.svc-vcol { position: relative; flex: 1; min-width: 0; }
.svc-vtrack {
  position: absolute; top: 0; left: 0; right: 0;
  will-change: transform; animation: svc-vscroll 28s linear infinite;
}
.svc-vtrack.is-down { animation-name: svc-vscroll-down; }
@keyframes svc-vscroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes svc-vscroll-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
/* override the homepage's fixed-width horizontal card; uniform margin
   (not flex gap) keeps the -50% loop seamless */
.auth-media .svc { flex: none; width: 100%; aspect-ratio: 4 / 5; margin: 0 0 14px; cursor: default; }
@media (prefers-reduced-motion: reduce) { .svc-vtrack { animation: none; } }

@media (max-width: 880px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-media { display: none; }
}

/* ── headings ─────────────────────────────────────────────────── */
.auth-panel-inner .eyebrow { color: var(--accent); margin-bottom: 14px; font-weight: 600; letter-spacing: 0.16em; }
/* matches the homepage hero heading weight + tracking, with a tighter
   line-height so it doesn't stack too tall in the narrower panel */
.auth-panel-inner h1 {
  font-weight: 500;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.auth-sub { margin-top: 12px; font-size: 15.5px; line-height: 1.5; color: var(--on-light-dim, rgba(31,31,31,0.55)); }

/* ── choice view: stacked auth buttons ────────────────────────── */
.auth-stack { margin-top: clamp(24px, 3vw, 32px); display: flex; flex-direction: column; gap: 12px; }

.btn-auth-secondary {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 15px 20px; border-radius: 14px;
  background: #fff; color: var(--ink);
  border: none;
  box-shadow: 0 1px 2px rgba(17,16,16,0.05), 0 2px 8px rgba(17,16,16,0.04);
  font-size: 15px; font-weight: 600;
  transition: transform 0.25s var(--ease), box-shadow 0.2s var(--ease);
}
.btn-auth-secondary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(17,16,16,0.08); }
.btn-auth-secondary:disabled { opacity: 0.5; cursor: default; }
.btn-auth-icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.btn-auth-icon svg { width: 100%; height: 100%; }

.auth-divider { display: flex; align-items: center; justify-content: center; color: var(--on-light-dim, rgba(31,31,31,0.5)); font-size: 12.5px; margin: 4px 0; }

.auth-helper { margin-top: 8px; font-size: 13px; color: var(--on-light-dim, rgba(31,31,31,0.5)); line-height: 1.45; }
.auth-helper a { color: var(--ink); border-bottom: 1px solid rgba(17,16,16,0.25); transition: border-color 0.2s var(--ease); }
.auth-helper a:hover { border-color: var(--ink); }
.auth-legal { margin-top: clamp(16px, 2.5vw, 22px); font-size: 12.5px; color: var(--on-light-dim, rgba(31,31,31,0.5)); line-height: 1.5; }
.auth-legal a { color: var(--ink); border-bottom: 1px solid rgba(17,16,16,0.25); transition: border-color 0.2s var(--ease); }
.auth-legal a:hover { border-color: var(--ink); }

/* GIS renders its real button into this hidden slot; our styled button proxies the click */
#google-signin-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ── email + code views ───────────────────────────────────────── */
.email-header { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 4px; }
.email-header h1 { font-size: clamp(26px, 3vw, 34px); }
.back-button { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: var(--light); transition: opacity 0.2s var(--ease); }
.back-button:hover { opacity: 0.88; }
.back-button svg { width: 18px; height: 18px; }
#view-email .auth-sub, #view-code .auth-sub { text-align: left; }

.field { display: block; text-align: left; margin-top: 16px; }
.field-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--on-light-dim, rgba(31,31,31,0.55)); margin-bottom: 7px; letter-spacing: 0.01em; }
.input {
  width: 100%; padding: 15px 16px; border-radius: 14px;
  background: #fff; border: none;
  box-shadow: 0 1px 2px rgba(17,16,16,0.05), 0 2px 8px rgba(17,16,16,0.04);
  color: var(--ink); font-family: var(--font); font-size: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
  transition: box-shadow 0.18s var(--ease);
}
.input::placeholder { color: rgba(31,31,31,0.32); }
.input:focus { box-shadow: 0 0 0 3px rgba(238,106,69,0.22); }
.input.is-error { box-shadow: 0 0 0 3px rgba(238,106,69,0.3); }
.otp-input { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 28px; font-weight: 600; letter-spacing: 0.34em; text-indent: 0.34em; text-align: center; text-transform: uppercase; }
.otp-input::placeholder { letter-spacing: 0.34em; }

/* live password requirements (sign-up) */
.pw-reqs { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.pw-reqs li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1.3; color: var(--on-light-dim, rgba(31,31,31,0.5)); transition: color 0.2s var(--ease); }
.pw-reqs .pw-check {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(17,16,16,0.22);
  display: grid; place-items: center;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.pw-reqs .pw-check svg { width: 10px; height: 10px; color: #fff; opacity: 0; transition: opacity 0.2s var(--ease); }
.pw-reqs li.is-met { color: rgba(31,31,31,0.4); text-decoration: line-through; }
.pw-reqs li.is-met .pw-check { background: #34a76d; border-color: #34a76d; }
.pw-reqs li.is-met .pw-check svg { opacity: 1; }

.auth-submit {
  width: 100%; margin-top: 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px; border-radius: 14px;
  background: var(--ink); color: var(--light);
  font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease), background 0.2s var(--ease), opacity 0.25s var(--ease);
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); background: #2a2727; }
.auth-submit:disabled { opacity: 0.42; cursor: not-allowed; }

.text-link { color: var(--ink); border-bottom: 1px solid rgba(17,16,16,0.25); cursor: pointer; font-size: 13.5px; transition: border-color 0.2s var(--ease); }
.text-link:hover { border-color: var(--ink); }
.text-link.is-disabled { color: var(--on-light-dim, rgba(31,31,31,0.5)); border-color: transparent; cursor: default; }

.strong { font-weight: 600; color: var(--ink); }

/* ── feedback: spinner, errors, toast ─────────────────────────── */
.spinner { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; border: 2px solid rgba(241,241,241,0.35); border-top-color: var(--light); border-radius: 50%; animation: auth-spin 0.7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.error-text { margin-top: 14px; min-height: 18px; font-size: 13.5px; line-height: 1.45; color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); z-index: 50;
  max-width: min(440px, 90vw); padding: 13px 20px; border-radius: 14px;
  background: var(--ink); color: var(--light); font-size: 14px; font-weight: 500;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .btn-auth-secondary:hover:not(:disabled), .auth-submit:hover:not(:disabled) { transform: none; }
}
