/* ============================================================================
 * Sonde — auth pages (sign up / sign in / forgot / reset / oauth terms).
 * Split-shell layout on top of the marketing tokens (marketing.css loads
 * first): ink brand pane left, form pane right. Ported from the Claude
 * Design handoff ("Sonde Sign Up.html").
 * ========================================================================== */

html, body { height: 100%; }
body { background: var(--bg); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 460px) 1fr;
}

/* ——— Left: brand panel (ink) ——— */
.auth-brandpane {
  background: var(--ink);
  color: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 44px 34px;
  position: relative; overflow: hidden;
}
.auth-brandpane .brand .word { color: var(--bg); }
.auth-brandpane .brand { position: relative; z-index: 1; }

.bp-mid { position: relative; z-index: 1; }
.bp-mid h2 {
  color: var(--bg);
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  letter-spacing: -0.035em; line-height: 1.02;
  margin: 0 0 28px; text-wrap: balance;
}
.bp-mid h2 .hl-dark {
  background-image: linear-gradient(180deg, transparent 0 58%, rgba(126,224,60,0.34) 58% 94%, transparent 94%);
  padding: 0 2px;
}
.bp-stats { display: grid; gap: 0; border-top: 1px solid rgba(239,241,235,0.14); }
.bp-stat {
  display: grid; grid-template-columns: 14px 1fr; gap: 12px; align-items: baseline;
  padding: 13px 0; border-bottom: 1px solid rgba(239,241,235,0.14);
}
.bp-stat .dmd { width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg) translateY(-1px); flex-shrink: 0; }
.bp-stat .tx { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.5px; color: #c7ccc7; line-height: 1.5; }
.bp-stat .tx b { color: var(--bg); font-weight: 700; }

.bp-foot {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.8px;
  color: #6f786f; display: flex; gap: 14px; flex-wrap: wrap;
}
.bp-foot a:hover { color: var(--bg); }

/* faint oversized ring, echoing the mark */
.bp-ring {
  position: absolute; right: -180px; bottom: -180px; width: 460px; height: 460px;
  border-radius: 50%; border: 1.5px solid rgba(126,224,60,0.14); pointer-events: none;
}
.bp-ring::after {
  content: ""; position: absolute; inset: 70px; border-radius: 50%;
  border: 1.5px solid rgba(126,224,60,0.08);
}

/* ——— Right: form pane ——— */
.auth-formpane {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px clamp(24px, 5vw, 72px);
  position: relative;
}
.auth-card { width: 100%; max-width: 396px; }

.auth-head { margin-bottom: 26px; }
.auth-head h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.1rem);
  letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 8px;
}
.auth-head p { font-size: 14px; color: var(--dim); line-height: 1.5; }

/* ——— Flash messages ——— */
.auth-flash { display: grid; gap: 8px; margin-bottom: 20px; }
.auth-flash .fl {
  font-size: 13px; line-height: 1.5; border-radius: 10px;
  padding: 11px 14px; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink2);
}
.auth-flash .fl.success { background: var(--up-soft); border-color: rgba(31,125,78,0.3); color: var(--up); }
.auth-flash .fl.danger  { background: var(--down-soft); border-color: rgba(200,71,58,0.3); color: var(--down); }
.auth-flash .fl.warning { background: var(--caution-soft); border-color: var(--caution-line); color: var(--caution); }

/* ——— Segmented tabs ——— */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; margin-bottom: 28px;
}
.auth-tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--dim);
  padding: 10px 8px; border-radius: 9px; line-height: 1;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab[aria-selected="true"] {
  background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 2px rgba(13,20,16,0.08), 0 4px 12px rgba(13,20,16,0.06);
}

/* ——— Form ——— */
.auth-panel[hidden] { display: none; }
.fields { display: grid; gap: 16px; margin-bottom: 20px; }
.field { display: grid; gap: 7px; }
.field label {
  font-size: 12px; font-weight: 600; color: var(--ink2); letter-spacing: 0.1px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.field .forgot { font-size: 12px; font-weight: 500; color: var(--dim); }
.field .forgot:hover { color: var(--ink); text-decoration: underline; }
.input-wrap { position: relative; }
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%; box-sizing: border-box;
  font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px; line-height: 1.2;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--faint); }
.field input:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input.has-toggle { padding-right: 62px; }
.field input.invalid { border-color: var(--down); }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--dim); padding: 8px; border-radius: 6px;
}
.pw-toggle:hover { color: var(--ink); background: var(--bg2); }
.field .hint { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.3px; }
.field .field-error { font-size: 12px; color: var(--down); line-height: 1.4; }

/* ——— Terms checkbox (server-enforced; styled to sit where the mock's
       legal small print goes) ——— */
.terms-check {
  display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start;
  margin-bottom: 20px; font-size: 12px; color: var(--dim); line-height: 1.55;
}
.terms-check input[type="checkbox"] {
  appearance: none; width: 16px; height: 16px; margin: 1px 0 0;
  border: 1.5px solid var(--line-strong); border-radius: 5px;
  background: var(--paper); cursor: pointer; position: relative;
  transition: border-color .15s ease, background .15s ease;
}
.terms-check input[type="checkbox"]:checked {
  background: var(--ink); border-color: var(--ink);
}
.terms-check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px; border: solid var(--accent);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.terms-check input[type="checkbox"]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
}
.terms-check label { cursor: pointer; }
.terms-check a { text-decoration: underline; text-underline-offset: 2px; }
.terms-check a:hover { color: var(--ink); }
.terms-check .field-error { grid-column: 2; font-size: 12px; color: var(--down); }

.btn-block { width: 100%; justify-content: center; padding: 14px 22px; font-size: 14.5px; }

/* ——— Divider + Google ——— */
.or-divider {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
  margin: 20px 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--faint);
}
.or-divider::before, .or-divider::after { content: ""; height: 1px; background: var(--line-strong); }
.btn-google {
  background: var(--paper); color: var(--ink); border-color: var(--line-strong);
  font-weight: 600;
}
.btn-google:hover { border-color: var(--ink); background: var(--paper); }
.btn-google svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ——— Small print ——— */
.auth-legal { margin-top: 22px; font-size: 12px; color: var(--dim); line-height: 1.55; text-wrap: pretty; }
.auth-legal a { text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--ink); }
.auth-trust {
  margin-top: 16px; font-family: var(--mono); font-size: 10.5px; color: var(--faint);
  letter-spacing: 0.4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.auth-trust b { color: var(--ink2); font-weight: 600; }
.auth-trust .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

.switch-note { margin-top: 22px; font-size: 13px; color: var(--dim); text-align: center; }
.switch-note button, .switch-note a {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 2px;
}

/* back to site */
.back-home {
  position: absolute; top: 28px; right: clamp(24px, 5vw, 72px);
  font-size: 13px; font-weight: 500; color: var(--dim);
}
.back-home:hover { color: var(--ink); }

/* mobile brand row (hidden on desktop) */
.auth-mobilebrand { display: none; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brandpane { display: none; }
  .auth-formpane { justify-content: flex-start; padding-top: 24px; }
  .auth-mobilebrand {
    display: flex; width: 100%; max-width: 396px;
    align-items: center; justify-content: space-between; margin-bottom: 36px;
  }
  .back-home { position: static; }
  .auth-card { padding-bottom: 40px; }
}
