/* Accounts (account.js): the nav's Sign in / Sign up (Home and an initial once signed in), the sign-in pages
   (white on the left where the form is, midnight on the right: the moonlit cloud sea and a line in the hand),
   and the Account settings shown in Home. */

/* ------------------------------------------------------------------ the nav */
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: calc(14.5px * var(--ts, 1));
  font-weight: 560;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  background: color-mix(in srgb, currentColor 8%, transparent);
  transition: background var(--t-1);
}
.nav-account:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.nav-account:focus-visible,
.nav-signup:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-account.is-in {
  padding: 0 14px 0 6px;
}
.acct-dot {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: calc(13px * var(--ts, 1));
  font-weight: 650;
  color: #2a1d08;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 35%, transparent);
}
.nav-signup {
  margin-left: 2px;
}
@media (max-width: 560px) {
  .nav-account {
    height: 36px;
    padding: 0 12px;
    font-size: calc(14px * var(--ts, 1));
  }
  .nav-account.is-in {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .nav-account.is-in .acct-label {
    display: none;
  }
  .nav-signup {
    --h: 36px;
    padding: 0 14px;
  }
}

/* ------------------------------------------------------------------ the sign-in pages */
html.auth-on,
html.auth-on body {
  overflow: hidden;
}
/* the page under the sign-in page, once the fade in is over (account.js setUnderneath) */
html.auth-on body > .auth-under {
  content-visibility: hidden;
}
.auth-page {
  /* by day the left is paper-white: the night is all on the right (at night the left is blue hour, below) */
  --ink: #1a1c33;
  --ink-2: #45465f;
  --ink-3: #6b6b82;
  --surface: #ffffff;
  --surface-2: #f6f3ef;
  --line: rgba(26, 28, 51, 0.08);
  --line-2: rgba(26, 28, 51, 0.14);
  --line-3: rgba(26, 28, 51, 0.24);
  --hover: rgba(13, 25, 54, 0.05);
  --accent: #2d3d9a;
  --accent-wash-2: rgba(45, 61, 154, 0.13);
  --primary: #1b1f38;
  --primary-hi: #262b4a;
  --primary-top: #33395e;
  --on-primary: #fff6e4;
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(460px, 45%) 1fr;
  color: var(--ink);
  background: #fffdfa;
  color-scheme: light;
  animation: auth-in 0.5s var(--ease) both;
}
@keyframes auth-in {
  from {
    opacity: 0;
  }
}
/* At night (the dark theme, chosen or the system's) the form's side is blue hour as well, not a white screen: the
   site's own night tokens, with an error red and a gold that hold their contrast on it. */
:root[data-theme="dark"] .auth-page {
  --ink: #eef0ff;
  --ink-2: #c3c6e4;
  --ink-3: #9a9dc2;
  --surface: #17163d;
  --surface-2: #1b1a46;
  --line: rgba(220, 230, 255, 0.08);
  --line-2: rgba(220, 230, 255, 0.16);
  --line-3: rgba(220, 230, 255, 0.26);
  --hover: rgba(220, 230, 255, 0.07);
  --accent: #a9b6ff;
  --accent-wash: rgba(138, 174, 255, 0.11);
  --accent-wash-2: rgba(138, 174, 255, 0.2);
  --primary: #f1e2bf;
  --primary-hi: #f8ebcc;
  --primary-top: #fff4dc;
  --on-primary: #171a33;
  --bad: #ff8f84;
  --warn: #f0c26e;
  --good: #5fd09a;
  background: radial-gradient(120% 70% at 0% 0%, #17183f, transparent 60%), #0b0d24;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-page {
    --ink: #eef0ff;
    --ink-2: #c3c6e4;
    --ink-3: #9a9dc2;
    --surface: #17163d;
    --surface-2: #1b1a46;
    --line: rgba(220, 230, 255, 0.08);
    --line-2: rgba(220, 230, 255, 0.16);
    --line-3: rgba(220, 230, 255, 0.26);
    --hover: rgba(220, 230, 255, 0.07);
    --accent: #a9b6ff;
    --accent-wash: rgba(138, 174, 255, 0.11);
    --accent-wash-2: rgba(138, 174, 255, 0.2);
    --primary: #f1e2bf;
    --primary-hi: #f8ebcc;
    --primary-top: #fff4dc;
    --on-primary: #171a33;
    --bad: #ff8f84;
    --warn: #f0c26e;
    --good: #5fd09a;
    background: radial-gradient(120% 70% at 0% 0%, #17183f, transparent 60%), #0b0d24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .auth-page .af-note.is-info {
  background: color-mix(in srgb, var(--gold-hi) 12%, transparent);
}
:root[data-theme="dark"] .auth-page .auth-night {
  box-shadow: inset 0 0 0 1px rgba(200, 215, 255, 0.08), 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-page .af-note.is-info {
    background: color-mix(in srgb, var(--gold-hi) 12%, transparent);
  }
  :root:not([data-theme="light"]) .auth-page .auth-night {
    box-shadow: inset 0 0 0 1px rgba(200, 215, 255, 0.08), 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  }
}
.auth-left {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  padding: 26px clamp(24px, 4vw, 56px) 22px;
  overflow-y: auto;
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-top .brand {
  display: inline-flex;
  color: var(--ink);
}
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  font-size: calc(14px * var(--ts, 1));
  font-weight: 560;
  color: var(--ink-2);
  text-decoration: none;
  transition: background var(--t-1), color var(--t-1);
}
.auth-back:hover {
  color: var(--ink);
  background: var(--hover);
}
.auth-back .ico {
  width: 15px;
  height: 15px;
}
.ico.flip {
  transform: scaleX(-1);
}
.auth-main {
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vh, 64px) 0;
}
.auth-body {
  width: min(400px, 100%);
}
.auth-view {
  animation: auth-view 0.45s var(--ease) both;
}
@keyframes auth-view {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.auth-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.2vw, 54px);
  font-weight: 380;
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--ink);
}
.auth-sub {
  margin-top: 12px;
  font-size: calc(16px * var(--ts, 1));
  line-height: 1.55;
  color: var(--ink-2);
}
.auth-switch {
  margin-top: 26px;
  font-size: calc(15px * var(--ts, 1));
  color: var(--ink-2);
}
.auth-switch a,
.auth-foot a {
  color: var(--ink);
  font-weight: 560;
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 4px;
}
.auth-switch a:hover,
.auth-foot a:hover {
  text-decoration-color: currentColor;
}
.auth-hint {
  font-size: calc(14.5px * var(--ts, 1));
  line-height: 1.55;
  color: var(--ink-3);
}
.auth-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  font-size: calc(13px * var(--ts, 1));
  color: var(--ink-3);
}
.auth-foot a {
  font-weight: 500;
  color: var(--ink-3);
  padding-block: 3px;
}

/* the midnight side */
.auth-right {
  padding: 14px 14px 14px 0;
  min-height: 0;
}
.auth-night {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #05061a 0%, #0c0e2e 46%, #1e2156 78%, #3a3a7a 100%);
  box-shadow: 0 30px 80px -40px rgba(8, 10, 40, 0.6);
  isolation: isolate;
}
.auth-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
}
/* deeper at the edges and the foot: midnight, not dusk */
.auth-night::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 38%, transparent 55%, rgba(3, 4, 20, 0.55) 100%),
    linear-gradient(180deg, transparent 55%, rgba(6, 7, 30, 0.42) 100%);
}
.auth-stars {
  position: absolute;
  inset: 0 0 45% 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 27% 34%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 41% 12%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(1px 1px at 58% 27%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.3px 1.3px at 69% 9%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 83% 22%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1.1px 1.1px at 92% 40%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 7% 46%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1.2px 1.2px at 36% 52%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 74% 48%, rgba(255, 255, 255, 0.5), transparent 60%);
  animation: auth-twinkle 6s ease-in-out infinite alternate;
}
@keyframes auth-twinkle {
  to {
    opacity: 0.6;
  }
}
.auth-words {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 30%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}
.auth-line {
  display: flex;
  justify-content: center;
  width: min(560px, 100%);
  min-height: 96px;
  filter: drop-shadow(0 2px 18px rgba(170, 180, 255, 0.35));
}
/* (the written line keeps inside the band on the narrowest phones, scaled whole rather than cut at the edge) */
.auth-line .wl-wrap {
  max-width: 100%;
}
.auth-line canvas.auth-line-cv {
  max-width: 100%;
  height: auto !important;
}
.auth-cap {
  font-family: var(--font-display);
  font-style: italic;
  font-size: calc(20px * var(--ts, 1));
  color: rgba(232, 236, 255, 0.72);
}
@media (prefers-reduced-motion: reduce) {
  .auth-page,
  .auth-view,
  .auth-stars {
    animation: none;
  }
}
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
  .auth-right {
    order: -1;
    height: clamp(200px, 32vh, 280px);
    padding: 10px 10px 0;
  }
  .auth-night {
    border-radius: 22px;
  }
  .auth-words {
    top: 26%;
  }
  .auth-line {
    min-height: 64px;
  }
  /* (the tagline sat on the moon's glow in a band this short: the written line says it alone) */
  .auth-cap {
    display: none;
  }
  .auth-words {
    top: 50%;
    transform: translateY(-62%);
  }
  .auth-left {
    overflow: visible;
    padding-top: 18px;
  }
  .auth-top {
    position: absolute;
    top: 20px;
    left: 22px;
    right: 22px;
    z-index: 3;
  }
  .auth-top .brand,
  .auth-back {
    color: #eef1ff;
  }
  .auth-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }
  .auth-main {
    padding: 28px 0 34px;
    place-items: start center;
  }
}

/* ------------------------------------------------------------------ forms */
.af {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}
.af-note {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: calc(14.5px * var(--ts, 1));
  color: var(--ink);
  background: color-mix(in srgb, var(--good) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 28%, transparent);
}
.af-note.is-info {
  background: color-mix(in srgb, var(--gold-hi) 16%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 34%, transparent);
}
.af-field {
  display: grid;
  gap: 7px;
}
.af-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: calc(14px * var(--ts, 1));
  font-weight: 600;
  color: var(--ink-2);
}
.af-inline {
  font-size: calc(13.5px * var(--ts, 1));
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
}
.af-inline:hover {
  color: var(--ink);
}
.af-opt {
  font-size: calc(13px * var(--ts, 1));
  font-weight: 400;
  color: var(--ink-3);
}
.af-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font-size: calc(16px * var(--ts, 1)); /* (16px: phones don't zoom into the field) */
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow var(--t-1), background var(--t-1);
}
.af-input:hover {
  box-shadow: inset 0 0 0 1px var(--line-3);
}
.af-input:focus {
  outline: none;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-wash-2);
}
.af-meter:not([data-score]) {
  display: none;
}
.af-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -8px;
  font-size: calc(12.5px * var(--ts, 1));
  color: var(--ink-3);
}
.af-meter-track {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--line-2);
}
.af-meter-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--bad);
  transition: width var(--t-2) var(--ease), background var(--t-2);
}
.af-meter[data-score="2"] .af-meter-bar {
  background: var(--warn);
}
.af-meter[data-score="3"] .af-meter-bar,
.af-meter[data-score="4"] .af-meter-bar,
.af-meter[data-score="5"] .af-meter-bar {
  background: var(--good);
}
.af-agree {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: calc(14px * var(--ts, 1));
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}
.af-agree a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.af-check {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}
.af-error {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: calc(14.5px * var(--ts, 1));
  line-height: 1.45;
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 8%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 24%, transparent);
}
.af-submit {
  --h: 52px;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  font-size: calc(16px * var(--ts, 1));
}

/* ---- the sign-in pages' fields (2026-10-16): the label a real <label>, a hint and an error line under each field,
   the password's eye, Caps Lock, and "Did you mean…?" */
.af-label label {
  display: flex;
  flex: 1;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  cursor: default;
}
.af-hint,
.af-field .af-meter {
  margin: 1px 0 0;
  font-size: calc(13px * var(--ts, 1));
  line-height: 1.45;
  color: var(--ink-3);
}
.af-hint:empty {
  display: none;
}
.af-field-err {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 2px 0 0;
  font-size: calc(13.5px * var(--ts, 1));
  font-weight: 520;
  line-height: 1.45;
  color: var(--bad);
}
.af-field-err::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: calc(11px * var(--ts, 1));
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--bad);
}
.af-field-err[hidden] {
  display: none;
}
.af-input[aria-invalid="true"],
.af-input[aria-invalid="true"]:hover {
  box-shadow: inset 0 0 0 1.5px var(--bad);
}
.af-input[aria-invalid="true"]:focus {
  box-shadow: inset 0 0 0 1.5px var(--bad), 0 0 0 4px color-mix(in srgb, var(--bad) 16%, transparent);
}
.af-agree .af-check[aria-invalid="true"] {
  outline: 2px solid var(--bad);
  outline-offset: 2px;
}
.af-row-end {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 -4px;
}
.af-row-end .af-inline {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.af-pw {
  position: relative;
}
.af-input.af-input-pw {
  padding-right: 52px;
}
.af-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--ink-3);
  background: none;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color var(--t-1), background var(--t-1);
}
.af-eye svg {
  width: 20px;
  height: 20px;
}
.af-eye:hover {
  color: var(--ink);
  background: var(--hover);
}
.af-eye[aria-pressed="true"] {
  color: var(--accent);
}
.af-eye:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.af-caps {
  margin: 0;
  font-size: calc(13px * var(--ts, 1));
  font-weight: 560;
  color: var(--warn);
}
.af-caps:empty,
.af-suggest:empty {
  display: none;
}
.af-caps:not(:empty) {
  margin-top: 6px;
}
.af-suggest {
  margin: 1px 0 0;
  font-size: calc(13.5px * var(--ts, 1));
  line-height: 1.45;
  color: var(--ink-2);
}
.af-suggest-btn {
  padding: 1px 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.af-suggest-btn:hover {
  background: var(--accent-wash);
}
.af-meter.is-always {
  display: flex;
  margin-top: 4px;
}
.af-meter.is-always[data-score="0"] .af-meter-track {
  opacity: 0.6;
}
.auth-title:focus {
  outline: none;
}
.auth-view .af a:focus-visible,
.auth-switch a:focus-visible,
.auth-foot a:focus-visible,
.auth-back:focus-visible,
.auth-top .brand:focus-visible,
.af-agree a:focus-visible,
.af-check:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.af-submit[disabled] {
  cursor: progress;
}

/* ------------------------------------------------------------------ the Account settings (in Home) */
.acct-grid {
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
}
.acct-card {
  padding: 24px 26px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--sh-1);
}
.acct-card-head {
  margin-bottom: 8px;
}
.acct-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.acct-card-head p,
.acct-danger p {
  margin-top: 4px;
  font-size: calc(14px * var(--ts, 1));
  color: var(--ink-3);
}
.acct-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.acct-card-head + .acct-row {
  border-top: 0;
}
.acct-k {
  flex: none;
  width: 120px;
  font-size: calc(14px * var(--ts, 1));
  font-weight: 600;
  color: var(--ink-3);
}
.acct-v {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.acct-inline {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.acct-inline .af-field {
  flex: 1;
}
.acct-inline .af-input,
.acct-stack .af-input {
  height: 44px;
}
.acct-inline .btn {
  --h: 44px;
}
.acct-stack {
  display: grid;
  gap: 12px;
  padding-bottom: 6px;
}
.acct-card .af-agree {
  margin-top: 6px;
}
.acct-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.acct-link {
  font-size: calc(14px * var(--ts, 1));
  color: var(--ink-2);
  text-underline-offset: 3px;
}
.acct-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: color-mix(in srgb, var(--bad) 5%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 22%, transparent);
}
.acct-danger h2 {
  font-size: 22px;
}
.acct-del {
  flex: none;
  color: #fff;
  background: var(--bad);
  box-shadow: none;
}
.acct-del:hover {
  background: color-mix(in srgb, var(--bad) 86%, #000);
}
.acct-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 0;
  font-size: calc(13.5px * var(--ts, 1));
  color: var(--ink-3);
}
.acct-foot a {
  color: inherit;
  text-underline-offset: 3px;
}
@media (max-width: 560px) {
  .acct-card {
    padding: 20px 18px;
  }
  .acct-k {
    width: 96px;
  }
  .acct-row {
    flex-wrap: wrap;
  }
  .acct-danger {
    flex-direction: column;
    align-items: stretch;
  }
}
