/* Authentication follows the public brand without affecting the signed-in app. */
.public-shell:not([data-route="landing"]) {
  --auth-ease: cubic-bezier(.22, 1, .36, 1);
  --auth-muted: var(--public-muted);
}
.public-shell:not([data-route="landing"]) .public-header {
  position: relative;
  top: auto;
  height: 84px;
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
}
.public-shell:not([data-route="landing"]) .nod-wordmark small { display: none; }
.public-shell:not([data-route="landing"]) .public-back::after { content: none; }
.public-shell:not([data-route="landing"]) .public-back span { margin-right: 6px; }
.public-shell:not([data-route="landing"]) .public-footer {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
  padding-block: 24px;
  border-color: var(--public-border);
  font-size: 12px;
}
.public-shell:not([data-route="landing"]) .public-footer > .public-brand { display: none; }
.public-shell:not([data-route="landing"]) .public-footer > span { margin-right: auto; }
.public-shell:not([data-route="landing"]) .public-footer :is(button, a) { min-height: 44px; display: inline-flex; align-items: center; }
.public-shell .public-auth {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: none;
  min-height: calc(100svh - 178px);
  margin: 0;
  padding: 30px 24px 56px;
  gap: 0;
}
.public-shell[data-route="signup"] .public-auth { padding-top: 22px; }
.auth-ambient { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.auth-ambient::before {
  content: "";
  position: absolute;
  width: 900px;
  height: 550px;
  left: calc(50% - 450px);
  top: -345px;
  background: radial-gradient(ellipse, #d3b67616, transparent 67%);
  animation: auth-light-in 1.2s var(--auth-ease) both;
}
.auth-ambient i {
  position: absolute;
  left: calc(50% - 540px);
  top: -625px;
  width: 1080px;
  height: 750px;
  border: 1px solid color-mix(in srgb, var(--public-gold) 9%, transparent);
  border-radius: 50%;
  opacity: .6;
}
.auth-ambient i:nth-child(2) { top: -603px; opacity: .3; }
.auth-ambient i:nth-child(3) { top: -581px; opacity: .15; }
.public-shell .public-auth-form { position: relative; width: min(100%, 384px); border: 0; padding: 0; }
.public-shell[data-route="signup"] .public-auth-form { width: min(100%, 440px); }
.public-shell .public-auth-panel { animation: none; }
.public-auth.route-enter .public-auth-panel:not([hidden]),
.public-auth.route-enter #invite-form:not(.hidden) { animation: auth-enter 420ms var(--auth-ease) both; }
.auth-emblem { display: flex; justify-content: center; margin: 0 auto 18px; }
.auth-emblem img { width: 44px; height: 44px; object-fit: contain; }
.public-shell .public-auth-form h1 {
  color: var(--public-ink);
  font: 300 36px/1.1 var(--font-display); letter-spacing: -.04em;
  letter-spacing: -.01em;
  text-align: center;
  margin: 0 0 12px;
}
.public-shell .public-auth-subtitle { text-align: center; font-size: 15px; line-height: 1.6; margin: 0 0 26px; color: var(--auth-muted); }
.public-shell .public-google {
  height: 48px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  background: color-mix(in srgb, var(--public-ink) 3%, var(--public-bg));
  border-color: color-mix(in srgb, var(--public-ink) 20%, var(--public-bg));
  transition: background 160ms, border-color 160ms, transform 160ms var(--auth-ease);
}
.public-shell .public-google:hover { background: var(--public-raised); border-color: var(--public-muted); }
.public-shell .public-auth :is(.public-button, .public-google):active { transform: translateY(1px) scale(.995); }
.public-shell .public-divider { margin: 18px 0; font-size: 11px; color: var(--auth-muted); }
.public-shell .public-divider span { padding-inline: 16px; }
.public-shell .public-auth-form .field-group { margin-bottom: 19px; }
#auth-screen.public-shell .public-auth-form .field-group label { font-size: 12px; font-weight: 500; margin-bottom: 8px; }
#auth-screen.public-shell .public-auth-form .field-group label small { font-size: 11px; font-weight: 400; }
#auth-screen.public-shell .public-auth-form :is(input:not([type="checkbox"]):not([type="radio"]), select) {
  height: 48px;
  border-radius: 10px;
  font-size: 15px;
  padding-inline: 13px;
  border-color: color-mix(in srgb, var(--public-ink) 25%, var(--public-bg)) !important;
  background: color-mix(in srgb, var(--public-ink) 3%, var(--public-bg)) !important;
  transition: border-color 160ms, box-shadow 160ms;
}
#auth-screen.public-shell .public-auth-form :is(input, select):focus-visible {
  outline: 2px solid var(--public-gold);
  outline-offset: 3px;
}
#auth-screen.public-shell .public-auth-form .password-wrap input { padding-right: 50px; }
#auth-screen.public-shell .public-auth-form .pwd-toggle { width: 44px; height: 46px; right: 2px; opacity: 1 !important; }
.public-shell .public-auth-form .field-hint { font-size: 11px; line-height: 1.55; margin-top: 7px; }
.public-shell .public-auth-form p.field-error { font-size: 12px; color: #f48e8e; }
[data-theme="light"] .public-shell .public-auth-form p.field-error { color: #ab2525; }
.public-shell .public-auth-form .password-wrap > p.field-error { margin-bottom: 4px; }
.public-shell .public-auth-meta { margin: 8px 0 16px; gap: 8px; font-size: 12px; }
.public-shell .public-auth-meta > a, .public-shell .public-auth-meta > label { min-height: 44px; display: inline-flex; align-items: center; }
.public-shell .public-auth-meta a { color: var(--public-ink); }
.public-shell .public-auth .public-checkbox { font-size: 12px; gap: 9px; line-height: 1.7; }
.public-shell .public-auth .public-checkbox input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--public-gold); }
.public-shell .public-auth .public-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--public-button);
  color: var(--public-on-gold);
  font-size: 15px;
  font-weight: 600;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 1px 1px #0002, inset 0 1px #fff3;
  transition: background 160ms, transform 160ms var(--auth-ease), box-shadow 160ms;
}
.public-shell .public-auth .public-button:hover { background: var(--public-button-hover); box-shadow: 0 10px 26px -12px rgba(197, 164, 109, .7); }
.public-shell .public-auth .public-button svg { width: 16px; height: 16px; transition: transform 180ms var(--auth-ease); }
.public-shell .public-auth .public-button:hover svg { transform: translateX(3px); }
.public-shell .public-auth :is(button, a):focus-visible { outline: 2px solid var(--public-gold); outline-offset: 4px; }
.public-shell .public-auth button:disabled { cursor: not-allowed; opacity: .6; transform: none; }
/* Pending requests keep the label readable and swap the arrow for the NOD mark after 150 ms. */
.public-shell .public-auth button[aria-busy="true"]:disabled { cursor: progress; opacity: 1; }
.public-shell .public-auth .public-button[aria-busy="true"] { background: color-mix(in srgb, var(--public-button) 82%, var(--public-bg)); box-shadow: none; }
.btn-icon { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; font-style: normal; }
.btn-icon > * { grid-area: 1 / 1; }
#auth-screen .btn-icon > svg { width: 16px; height: 16px; transition: opacity 120ms ease, transform 180ms var(--auth-ease); }
#auth-screen .btn-icon .nod-loader { --loader-size: 24px; padding: 4px; border-radius: 50%; background: #16130d; box-shadow: 0 0 0 1px rgba(197, 164, 109, .35); opacity: 0; transform: scale(.86); transition: opacity 200ms ease, transform 320ms var(--auth-ease); }
#auth-screen .btn-icon .nod-loader::after { inset: 4px; }
#auth-screen [aria-busy="true"] > .btn-icon > svg { opacity: 0; transform: scale(.8); transition-delay: 150ms; }
#auth-screen [aria-busy="true"] > .btn-icon .nod-loader { opacity: 1; transform: none; transition-delay: 150ms; animation: nod-loader-breathe 1.8s ease-in-out 600ms infinite; }
#auth-screen [aria-busy="true"] > .btn-icon .nod-loader::after { animation: nod-loader-sweep 1.8s ease-in-out 600ms infinite; }
.public-shell .public-google > .btn-icon-lead > svg { width: 17px; height: 17px; stroke: none; }
#auth-screen .public-auth .public-button:hover .btn-icon > svg { transform: translateX(3px); }
#auth-screen .public-auth .public-button[aria-busy="true"]:hover .btn-icon > svg { transform: scale(.8); }
.public-shell .public-auth-switch { font-size: 12px; margin-top: 26px; }
.public-shell .public-auth-switch a { display: inline-flex; align-items: center; min-height: 44px; color: var(--public-ink); margin-left: 3px; text-decoration-color: color-mix(in srgb, var(--public-ink) 30%, transparent); }
.public-shell .public-auth-switch a:hover { color: var(--public-gold); }
.public-shell .auth-progress { display: flex; align-items: center; gap: 0; list-style: none; padding: 0; margin: 2px 0 28px; width: 100%; }
.public-shell .auth-progress li { display: flex; align-items: center; gap: 7px; flex: 1; color: var(--public-muted); font-size: 11px; white-space: nowrap; }
.public-shell .auth-progress li:last-child { flex: 0; }
.public-shell .auth-progress li:not(:last-child)::after { content: ""; height: 1px; background: var(--public-border); flex: 1; margin: 0 12px; transition: background 200ms; }
.public-shell .auth-progress li > span { width: 23px; height: 23px; border: 1px solid var(--public-border); border-radius: 50%; display: grid; place-items: center; font-size: 10px; transition: background 200ms, border-color 200ms; }
.public-shell .auth-progress li[aria-current="step"] { color: var(--public-ink); }
.public-shell .auth-progress li[aria-current="step"] > span { background: var(--public-button); border-color: var(--public-button); color: #17150f; }
.public-shell .auth-progress li.is-complete { color: var(--public-gold); }
.public-shell .auth-progress li.is-complete > span { border-color: var(--public-gold); }
.public-shell .auth-progress li.is-complete::after { background: var(--public-gold); }
.auth-step > h2 { font: 300 26px/1.18 var(--font-display); letter-spacing: -.03em; margin: 0 0 22px; color: var(--public-ink); }
.auth-step:first-child > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.auth-step[data-auth-step="0"] { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.auth-step [data-auth-email] { display: contents; }
.auth-step:has([data-auth-email][hidden]) > .field-group { grid-column: 1 / -1; }
.auth-step [data-auth-email] > .field-group:last-child, .auth-step .auth-google-note { grid-column: 1 / -1; }
.auth-step.is-entering { animation: auth-step-in 280ms var(--auth-ease) both; }
.auth-step[data-direction="back"] { --auth-step-offset: -10px; }
.auth-step-description { font-size: 13px; color: var(--public-muted); line-height: 1.7; margin: -11px 0 25px; }
.public-shell .auth-step .public-form-grid { grid-template-columns: 1fr 1fr; gap: 0 15px; }
.public-shell .auth-step .public-workspace-choice { gap: 10px; margin: 0 0 20px; }
.public-shell .auth-step .public-workspace-choice label { border-radius: 8px; min-height: 46px; font-size: 13px; }
.public-shell .auth-step .public-workspace-choice label:has(input:checked) { background: color-mix(in srgb, var(--public-gold) 7%, var(--public-bg)); }
.public-shell .auth-step .public-workspace-choice legend { font-size: 12px; font-weight: 500; }
.public-shell .auth-step .public-workspace-choice input { width: 15px; height: 15px; }
#auth-screen.public-shell .public-phone select { flex: 0 0 42%; max-width: 180px; border-radius: 8px 0 0 8px; font-size: 12px; padding-inline: 9px; }
#auth-screen.public-shell .public-phone input { border-radius: 0 8px 8px 0; }
.public-shell .auth-step .public-consent { min-height: 44px; align-items: center; margin: 25px 0 15px; }
.public-shell .auth-step .public-consent button { color: var(--public-ink); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.auth-review { display: flex; align-items: flex-start; gap: 11px; padding: 17px 0 24px; margin: 0 0 12px; border-top: 1px solid var(--public-border); }
.public-shell .auth-review svg { width: 17px; height: 17px; color: var(--public-gold); margin-top: 2px; }
.auth-review p { font-size: 12px; line-height: 1.8; color: var(--public-ink); }
.auth-review p span { color: var(--public-muted); }
.public-shell .public-auth-form .public-form-note { font-size: 11px; text-align: center; line-height: 1.7; margin-top: 15px; }
.auth-step-actions { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.auth-step-back { display: inline-flex; gap: 7px; align-items: center; justify-content: center; color: var(--public-ink); background: transparent; border: 1px solid var(--public-border-strong); border-radius: var(--radius-pill); min-width: 100px; min-height: 48px; font-size: 15px; font-weight: 600; transition: background-color 160ms, border-color 160ms; }
.auth-step-back:hover { background: var(--public-panel); color: var(--public-ink); }
.public-shell .auth-step-back svg { width: 15px; height: 15px; transform: rotate(180deg); }
.public-shell .auth-step-actions .public-button { flex: 1; }
.auth-provider-selected { display: flex; align-items: center; gap: 8px; color: var(--public-muted); font-size: 12px; padding: 0 0 22px; }
.public-shell .auth-provider-selected svg { width: 16px; height: 16px; color: var(--public-gold); }
.auth-provider-selected button { margin-left: auto; min-height: 44px; background: transparent; border: 0; color: var(--public-ink); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.auth-google-note { font-size: 13px; line-height: 1.7; color: var(--public-muted); padding: 0 0 20px; }
.auth-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.public-shell #invite-form .public-eyebrow { text-align: center; }
.public-shell #invite-form .invite-status-line { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; column-gap: 10px; min-height: 28px; margin: 20px 0; }
.public-shell #invite-form .invite-status-line .nod-loader { justify-self: end; }
.public-shell #invite-form #invite-status { margin: 0; font-size: 13px; }
/* The compact mark reserves its space, so the status line never shifts when loading ends. */
.public-shell #invite-form .invite-status-line .nod-loader { --loader-size: 20px; opacity: 0; transition: opacity 200ms ease; }
.public-shell #invite-form.is-loading .invite-status-line .nod-loader { opacity: 1; transition-delay: 150ms; animation: nod-loader-breathe 1.8s ease-in-out 600ms infinite; }
.public-shell #invite-form.is-loading .invite-status-line .nod-loader::after { animation: nod-loader-sweep 1.8s ease-in-out 600ms infinite; }
/* An auth button already shows the mark; the global pill stays available to assistive technology only. */
body[data-page="home"]:has(#auth-screen [aria-busy="true"] > .btn-icon) .backend-loading-pill { opacity: 0 !important; clip-path: inset(50%); }
body:has(.public-shell:not([data-route="landing"]).active) #forgot-modal { border-radius: 16px; font-family: var(--font-sans); }
@keyframes auth-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes auth-step-in { from { opacity: 0; transform: translateX(var(--auth-step-offset, 10px)); } to { opacity: 1; transform: none; } }
@keyframes auth-light-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (min-height: 900px) and (min-width: 701px) { .public-shell[data-route="login"] .public-auth { padding-top: 100px; } }
@media (max-width: 700px) {
  .public-shell:not([data-route="landing"]) .public-header { height: 72px; }
  .public-shell:not([data-route="landing"]) .public-back { font-size: 11px; }
  .public-shell:not([data-route="landing"]) .public-footer { width: calc(100% - 40px); gap: 10px; flex-direction: row; flex-wrap: wrap; padding-block: 16px; font-size: 11px; }
  .public-shell:not([data-route="landing"]) .public-footer nav { gap: 17px; }
  .public-shell .public-auth { padding: 42px 24px 48px; min-height: calc(100svh - 154px); }
  .public-shell[data-route="signup"] .public-auth { padding-top: 18px; }
  .auth-step[data-auth-step="0"] { grid-template-columns: 1fr; }
  .auth-emblem { margin-bottom: 22px; }
  .auth-emblem img { width: 42px; height: 42px; }
  .public-shell .public-auth-form h1 { font-size: 34px; }
  #auth-screen.public-shell .public-auth-form :is(input:not([type="checkbox"]):not([type="radio"]), select) { font-size: 16px; height: 48px; }
  #auth-screen.public-shell .public-phone select { font-size: 12px; }
  .public-shell .public-auth-form .field-hint { font-size: 11px; }
  .public-shell .public-auth-subtitle { font-size: 12px; margin-bottom: 25px; }
  .public-shell .public-auth-switch { margin-top: 18px; }
  .public-shell .auth-progress { margin-bottom: 26px; }
}
@media (max-width: 380px) {
  .public-shell .public-auth { padding-inline: 20px; }
  .public-shell .public-auth-form h1 { font-size: 31px; }
  .public-shell .auth-progress li:not(:last-child)::after { margin-inline: 7px; }
  .public-shell:not([data-route="landing"]) .public-header { gap: 10px; }
  .public-shell:not([data-route="landing"]) .public-header-actions { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .public-shell .public-auth *, .public-shell .public-auth *::before { animation: none !important; transition: none !important; }
  /* Static mark with readable status text; the short delay still prevents a flash. */
  #auth-screen .public-auth .btn-icon > *, #auth-screen .public-auth .btn-icon .nod-loader::after { transition: opacity 0s linear 0s !important; animation: none !important; transform: none !important; }
  #auth-screen .public-auth [aria-busy="true"] > .btn-icon > * { transition-delay: 150ms !important; }
}
.pref-reduced-motion .public-auth *, .pref-reduced-motion .public-auth *::before,
.public-shell:has(.motion-stopped) .public-auth *, .public-shell:has(.motion-stopped) .public-auth *::before { animation: none !important; transition: none !important; }
.pref-reduced-motion .public-auth .btn-icon > *, .public-shell:has(.motion-stopped) .public-auth .btn-icon > * { transition: opacity 0s linear 0s !important; transform: none !important; }
.pref-reduced-motion .public-auth [aria-busy="true"] > .btn-icon > *, .public-shell:has(.motion-stopped) .public-auth [aria-busy="true"] > .btn-icon > * { transition-delay: 150ms !important; }

/* Parts 5/6: neutral age screen gate and the uniform "check your inbox" state. */
.age-gated { display: none !important; }
.auth-email-note { margin: 2px 0 0; }
.auth-sent { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 8px 0 4px; }
.auth-sent h2 { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: -.01em; }
.auth-sent p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--auth-muted); max-width: 36ch; }
#age-screen-unavailable { margin-bottom: 18px; }
