/* =========================================================================
   Orbit — authentication surfaces (login / signup / forgot / reset / account
   / app activation). Inherits the landing tokens, type, and line-art canvas
   from styles.css; this file only adds the auth layout and controls.

   Register: brand. A two-column split (brand aside | task panel) over the
   dark canvas — not a lonely floating card. The aside states what you are
   signing into; the panel is the single focused task.
   ========================================================================= */

.auth-body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* minimal brand bar — no marketing chrome on the auth surfaces */
.auth-top {
  position: relative;
  z-index: 2;
  padding: 22px 24px;
}
.auth-top .brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  letter-spacing: 0.2px;
}
.auth-top .brand img { width: 24px; height: 24px; }
.auth-top .brand .back {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-faint);
  margin-left: 4px; transition: color .2s var(--ease);
}
.auth-top .brand:hover .back { color: var(--accent); }

/* ---------- shell -------------------------------------------------------- */
.auth-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
  gap: clamp(28px, 5vw, 88px);
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: clamp(16px, 4vw, 56px) 24px clamp(48px, 8vw, 96px);
  position: relative;
  z-index: 1;
}

/* brand aside — the orb, the promise, the local-first reassurance */
.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  max-width: 30rem;
}
.auth-aside .orb {
  width: 96px; height: 96px;
  filter: drop-shadow(0 0 38px rgba(216, 185, 117, 0.34));
  animation: orb-breathe 6s var(--ease) infinite;
}
@keyframes orb-breathe {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50%      { transform: translateY(-4px) scale(1.012); opacity: 0.94; }
}
.auth-aside h2 {
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.4px;
}
.auth-aside .aside-lead {
  font-size: 15px; line-height: 24px; color: var(--fg-muted); max-width: 34ch;
}
.aside-points { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.aside-points li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 14px; line-height: 21px; color: var(--fg-muted);
}
.aside-points svg { flex: none; margin-top: 2px; color: var(--accent); }
.aside-points b { color: var(--fg); font-weight: 500; }

/* ---------- task panel --------------------------------------------------- */
.auth-panel {
  align-self: center;
  width: 100%;
  max-width: 27rem;
  justify-self: end;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-media);
  padding: clamp(26px, 3vw, 38px);
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.8);
}
.auth-panel .eyebrow { margin-bottom: 16px; }
.auth-panel h1 {
  font-size: clamp(1.7rem, 1.3rem + 1vw, 2.1rem);
  line-height: 1.08;
  margin: 0 0 8px;
}
.auth-panel .auth-sub {
  font-size: 14px; line-height: 21px; color: var(--fg-muted);
  margin-bottom: 24px; max-width: none;
}
.auth-panel .auth-sub a { color: var(--accent); }
.auth-panel .auth-sub a:hover { text-decoration: underline; }

/* ---------- fields ------------------------------------------------------- */
.auth-form { display: flex; flex-direction: column; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field label {
  font-size: 12px; font-weight: 500; letter-spacing: 0.2px;
  color: var(--fg-muted);
}
.field-head a { font-size: 12px; color: var(--accent); }
.field-head a:hover { text-decoration: underline; }

.input-shell { position: relative; display: flex; }
.auth-input {
  width: 100%;
  font-family: var(--font-body); font-size: 15px; line-height: 22px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.auth-input::placeholder { color: var(--fg-faint); }
.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(189, 166, 247, 0.18);
}
.has-toggle .auth-input { padding-right: 44px; }
.field.is-invalid .auth-input { border-color: var(--err); }
.field.is-invalid .auth-input:focus { box-shadow: 0 0 0 3px rgba(226, 104, 94, 0.2); }

/* show / hide password */
.pw-toggle {
  position: absolute; top: 0; right: 0; height: 100%;
  width: 42px; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--fg-faint);
  transition: color .16s var(--ease);
}
.pw-toggle:hover { color: var(--fg-muted); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 4px; }

.field-error {
  font-size: 12px; line-height: 17px; color: var(--err);
  min-height: 0; display: none;
}
.field.is-invalid .field-error { display: block; }

.field-hint { font-size: 12px; line-height: 17px; color: var(--fg-faint); }
.field-hint a { color: var(--accent); font-weight: 500; }
.field-hint a:hover { text-decoration: underline; }

/* ---------- submit + form message --------------------------------------- */
.auth-submit {
  margin-top: 4px;
  width: 100%; justify-content: center;
  background: var(--fg); color: var(--bg);
  font-size: 15px; font-weight: 600; padding: 13px 18px;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font-body);
  transition: background .2s var(--ease), opacity .2s var(--ease), transform .12s var(--ease);
}
.auth-submit:hover:not(:disabled) { background: #fff; }
.auth-submit:active:not(:disabled) { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.55; cursor: progress; }

.auth-msg {
  font-size: 13px; line-height: 19px;
  border-radius: var(--radius-btn);
  padding: 11px 13px;
  display: none;
}
.auth-msg.show { display: block; }
.auth-msg.is-error { color: #F2C0BA; background: rgba(226, 104, 94, 0.12); border: 1px solid rgba(226, 104, 94, 0.32); }
.auth-msg.is-ok    { color: #BFE6CC; background: rgba(95, 185, 122, 0.12); border: 1px solid rgba(95, 185, 122, 0.32); }
.auth-msg.is-info  { color: var(--fg-muted); background: var(--surface-5); border: 1px solid var(--hairline-2); }

/* ---------- alternate actions ------------------------------------------- */
.auth-alt {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 13px; color: var(--fg-muted);
  text-align: center;
}
.auth-alt a { color: var(--accent); font-weight: 500; }
.auth-alt a:hover { text-decoration: underline; }

/* terminal-prompt footnote under the panel */
.auth-fineprint {
  margin-top: 18px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint);
}
.auth-fineprint a { color: var(--fg-muted); }
.auth-fineprint a:hover { color: var(--accent); }

/* ---------- spinner ------------------------------------------------------ */
.spinner {
  width: 16px; height: 16px; flex: none;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner--lg { width: 30px; height: 30px; border-width: 3px;
  border-color: var(--hairline-2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- plan badge (account) ---------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  padding: 5px 11px; border-radius: 999px; border: 1px solid;
}
.badge .pip { width: 7px; height: 7px; border-radius: 50%; }
.badge--lifetime { color: var(--gold); border-color: rgba(216, 185, 117, 0.4); background: rgba(216, 185, 117, 0.08); }
.badge--lifetime .pip { background: var(--gold); box-shadow: 0 0 8px 1px rgba(216, 185, 117, 0.6); }
.badge--active { color: var(--ok); border-color: rgba(95, 185, 122, 0.4); background: rgba(95, 185, 122, 0.08); }
.badge--active .pip { background: var(--ok); }
.badge--none { color: var(--fg-muted); border-color: var(--hairline-2); background: var(--surface-5); }
.badge--none .pip { background: var(--fg-faint); }

/* account rows */
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.acct-row:last-of-type { border-bottom: 0; }
.acct-row .k { font-size: 13px; color: var(--fg-muted); }
.acct-row .v { font-size: 14px; color: var(--fg); font-weight: 500; }
.acct-actions { display: flex; flex-direction: column; gap: 11px; margin-top: 22px; }
.btn-ghost {
  width: 100%; justify-content: center;
  background: var(--surface-5); color: var(--fg);
  border: 1px solid var(--hairline-2); border-radius: var(--radius-btn);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  padding: 12px 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.btn-ghost:hover { background: var(--surface-10); border-color: var(--hairline-2); }

/* ---------- app activation ---------------------------------------------- */
.activate-icon { display: grid; place-items: center; margin-bottom: 18px; }
.activate-icon img { width: 64px; height: 64px; filter: drop-shadow(0 0 26px rgba(216, 185, 117, 0.4)); }

.code-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-deep); border: 1px solid var(--hairline-2);
  border-radius: var(--radius-btn); padding: 10px 10px 10px 14px;
  margin-top: 12px;
}
.code-box code {
  flex: 1; min-width: 0; background: none; padding: 0;
  font-family: var(--font-mono); font-size: 13px; color: var(--fg-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-btn {
  flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--fg); background: var(--surface-10); border: 1px solid var(--hairline-2);
  border-radius: 4px; padding: 7px 12px; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.copy-btn:hover { background: var(--accent); color: var(--bg); border-color: transparent; }
.copy-btn.copied { color: var(--ok); }

.activate-state { display: none; }
.activate-state.show { display: block; }
.activate-state .center { text-align: center; }

/* ---------- responsive --------------------------------------------------- */
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 30px; max-width: 30rem; }
  .auth-aside { display: none; }
  .auth-panel { justify-self: stretch; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-aside .orb, .spinner, .spinner--lg { animation: none; }
}

/* Turnstile widget slot — zero footprint until the CAPTCHA renders into it. */
.orbit-captcha:not(:empty) { margin: 4px 0 14px; }
