/* =========================================================================
   NexT SysteM Mail — base, theme tokens and the landing experience.
   Tokens mirror the official nextsystem.site design system 1:1, so dark and
   light themes are literally the Next palette. Dark is the brand default.
   ========================================================================= */

@font-face {
  font-family: 'Fredoka';
  src: url('/assets/fonts/Fredoka.ttf') format('truetype-variations');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('/assets/fonts/NunitoSans.ttf') format('truetype-variations');
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: 'Lilita One';
  src: url('/assets/fonts/LilitaOne.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* ---- Dark theme = brand default -------------------------------------- */
:root {
  color-scheme: dark;

  --green: #28F969;
  --green-hover: #5CFF8D;
  --green-press: #1FD95A;
  --green-rgb: 40 249 105;
  --green-soft: rgb(40 249 105 / .1);
  --green-line: rgb(40 249 105 / .32);
  --green-ink: #28F969;
  --on-green: #0C0D0E;

  --purple: #740ABC;
  --purple-hover: #8517D4;
  --purple-rgb: 116 10 188;
  --purple-soft: rgb(116 10 188 / .18);
  --purple-line: rgb(116 10 188 / .55);
  --accent-ink: #C690FF;

  --bg: #0C0D0E;
  --surface-1: #131416;
  --surface-2: #181A1D;
  --surface-3: #1F2125;
  --surface-4: #282B30;

  --text: #FFFFFF;
  --text-2: #B7BAC1;
  --text-3: #9195A0;
  --on-accent: #FFFFFF;

  --line: rgb(255 255 255 / .08);
  --line-2: rgb(255 255 255 / .14);
  --line-3: rgb(255 255 255 / .24);

  --glass: rgb(12 13 14 / .82);
  --scrim: rgb(0 0 0 / .66);

  --danger: #FF6B6B;
  --danger-rgb: 255 107 107;

  --shadow-1: inset 0 1px 0 rgb(255 255 255 / .04), 0 14px 30px -20px rgb(0 0 0 / .9);
  --shadow-2: inset 0 1px 0 rgb(255 255 255 / .05), 0 30px 60px -32px rgb(0 0 0 / .95);
  --shadow-pop: 0 28px 60px -18px rgb(0 0 0 / .85);
  --glow: 0 14px 34px -14px rgb(40 249 105 / .6);
  --glow-lg: 0 40px 90px -40px rgb(40 249 105 / .55);

  --logo-ink: #FFFFFF;
  --logo-next: #28F969;

  /* shape + motion (shared across themes) */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 999px;

  --font: 'Nunito Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fredoka', 'Nunito Sans', ui-sans-serif, system-ui, sans-serif;
  --font-score: 'Lilita One', 'Fredoka', ui-sans-serif, sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --fast: .16s;
  --mid: .28s;
  --slow: .6s;

  --track-caps: .14em;

  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='%2328F969'%3E%3Cpath d='M46 22l5 19 19 5-19 5-5 19-5-19-19-5 19-5z'/%3E%3Cpath d='M168 132l3 12 12 3-12 3-3 12-3-12-12-3 12-3z'/%3E%3C/g%3E%3Cg fill='%23740ABC'%3E%3Ccircle cx='150' cy='46' r='5'/%3E%3Ccircle cx='62' cy='168' r='4'/%3E%3Cpath d='M110 96l2 8 8 2-8 2-2 8-2-8-8-2 8-2z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- Light theme ----------------------------------------------------- */
:root[data-theme='light'] {
  color-scheme: light;

  --green-soft: rgb(40 249 105 / .2);
  --green-line: rgb(7 122 51 / .42);
  --green-ink: #077A33;

  --purple-soft: rgb(116 10 188 / .12);
  --purple-line: rgb(116 10 188 / .55);
  --accent-ink: #6A0AAE;

  --bg: #F3F4F6;
  --surface-1: #FFFFFF;
  --surface-2: #F5F6F8;
  --surface-3: #E9EBEF;
  --surface-4: #DCDFE5;

  --text: #0C0D0E;
  --text-2: #454A54;
  --text-3: #5D636F;

  --line: rgb(12 13 14 / .09);
  --line-2: rgb(12 13 14 / .15);
  --line-3: rgb(12 13 14 / .26);

  --glass: rgb(255 255 255 / .86);
  --scrim: rgb(12 13 14 / .45);

  --danger: #C62828;
  --danger-rgb: 198 40 40;

  --shadow-1: 0 1px 2px rgb(12 13 14 / .05), 0 12px 26px -20px rgb(12 13 14 / .3);
  --shadow-2: 0 26px 50px -32px rgb(12 13 14 / .35);
  --shadow-pop: 0 26px 56px -20px rgb(12 13 14 / .3);
  --glow: 0 14px 34px -14px rgb(40 249 105 / .55);
  --glow-lg: 0 40px 90px -40px rgb(40 249 105 / .4);

  --logo-ink: #0C0D0E;
  --logo-next: #0C0D0E;
}

/* First-visit users with no stored choice follow their system preference. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --green-soft: rgb(40 249 105 / .2);
    --green-line: rgb(7 122 51 / .42);
    --green-ink: #077A33;
    --purple-soft: rgb(116 10 188 / .12);
    --accent-ink: #6A0AAE;
    --bg: #F3F4F6;
    --surface-1: #FFFFFF;
    --surface-2: #F5F6F8;
    --surface-3: #E9EBEF;
    --surface-4: #DCDFE5;
    --text: #0C0D0E;
    --text-2: #454A54;
    --text-3: #5D636F;
    --line: rgb(12 13 14 / .09);
    --line-2: rgb(12 13 14 / .15);
    --line-3: rgb(12 13 14 / .26);
    --glass: rgb(255 255 255 / .86);
    --scrim: rgb(12 13 14 / .45);
    --danger: #C62828;
    --danger-rgb: 198 40 40;
    --shadow-1: 0 1px 2px rgb(12 13 14 / .05), 0 12px 26px -20px rgb(12 13 14 / .3);
    --shadow-2: 0 26px 50px -32px rgb(12 13 14 / .35);
    --shadow-pop: 0 26px 56px -20px rgb(12 13 14 / .3);
    --glow: 0 14px 34px -14px rgb(40 249 105 / .55);
    --glow-lg: 0 40px 90px -40px rgb(40 249 105 / .4);
    --logo-ink: #0C0D0E;
    --logo-next: #0C0D0E;
  }
}

/* ---- Reset + base ---------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--mid) var(--ease), color var(--mid) var(--ease);
}

:root[data-theme='light'] body,
.theme-ready body {
  background-blend-mode: normal;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -.01em;
  margin: 0;
  line-height: 1.04;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--green);
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--green);
  color: var(--on-green);
  font-weight: 800;
  transition: top var(--fast) var(--ease);
}
.skip-link:focus {
  top: 16px;
}

.desktop-break {
  display: none;
}

/* ---- Background flourishes (kept subtle, behind everything) ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bg-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .5;
}
.bg-glow--green {
  top: -14vw;
  left: -10vw;
  background: rgb(var(--green-rgb) / .3);
}
.bg-glow--purple {
  bottom: -18vw;
  right: -12vw;
  background: rgb(var(--purple-rgb) / .45);
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image: var(--pattern);
  background-size: 360px 360px;
  opacity: .32;
  -webkit-mask-image: radial-gradient(130% 120% at 50% 0, #000 40%, transparent 92%);
  mask-image: radial-gradient(130% 120% at 50% 0, #000 40%, transparent 92%);
}
:root[data-theme='light'] .bg-grid { opacity: .5; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .bg-grid { opacity: .5; }
}

/* ---- Toasts ---------------------------------------------------------- */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: min(92vw, 420px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-pop);
  animation: toast-in var(--mid) var(--ease);
}
.toast svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--green);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast--error {
  border-color: rgb(var(--danger-rgb) / .5);
}
.toast--error svg {
  stroke: var(--danger);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Shared chrome bits ---------------------------------------------- */
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(var(--green-rgb) / .18);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgb(var(--green-rgb) / .18); }
  50% { box-shadow: 0 0 0 7px rgb(var(--green-rgb) / .05); }
}

.section-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--green-ink);
}

.demo-badge {
  align-self: center;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--purple-soft);
  border: 1px solid var(--purple-line);
}

/* ---- Theme + sound toggles ------------------------------------------ */
.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.theme-toggle:hover {
  border-color: var(--green-line);
  transform: translateY(-1px);
}
.theme-toggle svg {
  position: absolute;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity var(--fast) var(--ease), transform var(--mid) var(--ease);
}
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
/* Dark theme shows the sun (tap to go light); light theme shows the moon. */
.theme-toggle .icon-sun { opacity: 1; transform: rotate(0); }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-40deg); }
:root[data-theme='light'] .theme-toggle .icon-sun { opacity: 0; transform: rotate(40deg); }
:root[data-theme='light'] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .icon-sun { opacity: 0; transform: rotate(40deg); }
  :root:not([data-theme]) .theme-toggle .icon-moon { opacity: 1; transform: rotate(0); }
}

.sound-toggle {
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.sound-toggle[aria-pressed='true'] {
  color: var(--green-ink);
  border-color: var(--green-line);
  background: var(--green-soft);
}

/* =========================================================================
   LANDING
   ========================================================================= */
.auth-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 80px;
}

.announcement {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: center;
  margin: 0 calc(clamp(16px, 4vw, 40px) * -1);
  padding: 9px 20px;
  background: var(--green);
  color: var(--on-green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-align: center;
}
.announcement a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 10px;
  backdrop-filter: blur(12px);
  background: linear-gradient(var(--bg), rgb(0 0 0 / 0));
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.official-logo {
  height: 28px;
  width: auto;
}
.mail-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .32em;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  color: var(--on-green);
  background: var(--green);
}
.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}
.landing-nav-links > a {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  transition: color var(--fast) var(--ease);
}
.landing-nav-links > a:hover {
  color: var(--text);
}
.store-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text) !important;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
}
.store-link:hover {
  border-color: var(--green-line);
}

/* ---- Hero ------------------------------------------------------------ */
.login-stage {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(20px, 5vw, 64px) 0;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-2);
  padding: 7px 14px 7px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
}
.hero h1 {
  position: relative;
  margin: 22px 0 18px;
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 600;
}
.hero h1 span {
  color: var(--green-ink);
}
.title-spark {
  display: inline-block;
  width: clamp(26px, 3.4vw, 42px);
  margin-left: 8px;
  vertical-align: 12%;
  animation: spin-slow 10s linear infinite;
}
.hero p {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--text-2);
  max-width: 44ch;
  margin: 0;
}

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  max-width: 460px;
  margin-inline: auto;
}
.art-orbit {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgb(var(--purple-rgb) / .9), rgb(var(--purple-rgb) / .35) 58%, transparent 72%);
  box-shadow: var(--glow-lg);
}
.art-orbit::after {
  content: '';
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  border: 2px solid var(--green);
  border-right-color: transparent;
  border-bottom-color: transparent;
  animation: spin-slow 14s linear infinite;
}
.art-star {
  position: absolute;
  color: var(--green);
  font-size: 30px;
  filter: drop-shadow(0 0 10px rgb(var(--green-rgb) / .6));
}
.art-star--one { top: 6%; right: 16%; animation: twinkle 3.2s var(--ease) infinite; }
.art-star--two { bottom: 14%; left: 8%; font-size: 20px; color: #fff; animation: twinkle 2.6s var(--ease) .6s infinite; }
.hero-fox {
  position: relative;
  width: 82%;
  filter: drop-shadow(0 24px 40px rgb(0 0 0 / .45));
}
.floating-mail {
  position: absolute;
  right: -2%;
  bottom: 12%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 15px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  animation: float 4.5s var(--ease) infinite;
}
.floating-mail-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--green-soft);
}
.floating-mail-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--green-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floating-mail strong {
  display: block;
  font-size: 14px;
}
.floating-mail small {
  color: var(--text-3);
  font-size: 12px;
}
.mail-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
  font-weight: 900;
  font-size: 13px;
}
.art-caption {
  position: absolute;
  left: 2%;
  top: 14%;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--glass);
  padding: 6px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.78); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ---- Auth card ------------------------------------------------------- */
.auth-shell {
  width: 100%;
}
.auth-panel {
  position: relative;
  border-radius: var(--r-2xl);
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.auth-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--purple));
}
.auth-panel-inner {
  padding: clamp(22px, 3vw, 34px);
}
.card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-2);
}
.access-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--green-soft);
}
.access-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--green-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 6px;
}
.auth-heading h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
}
.auth-heading > p {
  margin: 0 0 20px;
  color: var(--text-2);
}

.config-notice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 15px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  background: var(--purple-soft);
  border: 1px solid var(--purple-line);
  color: var(--text);
  font-size: 14px;
}
.config-notice svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.config-notice strong {
  display: block;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-2);
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.field-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-ink);
}
.field-note svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 54px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1.5px solid var(--line-2);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input-shell:focus-within {
  border-color: var(--green);
  background: var(--surface-1);
  box-shadow: 0 0 0 4px var(--green-soft);
}
.input-shell > svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.input-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
}
.input-shell input::placeholder {
  color: var(--text-3);
  font-weight: 500;
}
.input-shell input:focus {
  outline: none;
}
.password-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.password-toggle:hover {
  color: var(--text);
  background: var(--surface-3);
}
.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed='true'] .eye-open { display: none; }
.password-toggle[aria-pressed='true'] .eye-closed { display: block; }

.field-error {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  min-height: 0;
}
.field-error:empty {
  display: none;
}
.paste-hint {
  font-size: 12px;
  color: var(--text-3);
}

.form-alert {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgb(var(--danger-rgb) / .12);
  border: 1px solid rgb(var(--danger-rgb) / .4);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.form-alert svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--danger);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Queue card (waiting room) */
.queue-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'icon copy position' 'cancel cancel cancel';
  gap: 12px;
  align-items: center;
  padding: 15px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--purple-line);
}
.queue-card.is-processing {
  border-color: var(--green-line);
  background: var(--green-soft);
}
.queue-card-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--purple-soft);
}
.queue-card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.queue-card.is-processing .queue-card-icon svg {
  stroke: var(--green-ink);
  animation: spin-slow 1.4s linear infinite;
}
.queue-card-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.queue-card-copy > span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
.queue-card-copy strong {
  font-size: 15px;
}
.queue-card-copy small {
  font-size: 12px;
  color: var(--text-3);
}
.queue-position {
  grid-area: position;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-ink);
}
.queue-card.is-processing .queue-position {
  color: var(--green-ink);
}
.queue-cancel {
  grid-area: cancel;
  padding: 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.queue-cancel:hover {
  color: var(--text);
  border-color: var(--line-3);
}

/* Primary button */
.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--green);
  color: var(--on-green);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  box-shadow: var(--glow);
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.primary-button:hover:not(:disabled) {
  background: var(--green-hover);
  transform: translateY(-2px);
  box-shadow: var(--glow-lg);
}
.primary-button:active:not(:disabled) {
  transform: translateY(0);
  background: var(--green-press);
}
.primary-button:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}
.primary-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--fast) var(--ease);
}
.primary-button:hover:not(:disabled) svg {
  transform: translateX(3px);
}
.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgb(12 13 14 / .25);
  border-top-color: var(--on-green);
  animation: spin-slow .7s linear infinite;
}
.is-loading .button-spinner {
  display: inline-block;
}
.primary-button.is-loading svg {
  display: none;
}

.privacy-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
}
.privacy-note svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--green-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.privacy-note strong {
  color: var(--text-2);
}
.auth-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-3);
  font-weight: 600;
}

/* ---- Feature cards --------------------------------------------------- */
.quick-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: clamp(32px, 6vw, 72px);
}
.feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: transform var(--mid) var(--ease), border-color var(--mid) var(--ease);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--green-line);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--green-soft);
}
.feature-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--green-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.feature p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

/* ---- How it works ---------------------------------------------------- */
.how-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
  margin-top: clamp(48px, 8vw, 96px);
  padding-top: clamp(36px, 6vw, 64px);
  border-top: 1px solid var(--line);
}
.how-intro h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 600;
  margin: 12px 0 14px;
}
.how-intro h2 span { color: var(--green-ink); }
.how-intro p {
  color: var(--text-2);
  margin: 0 0 18px;
}
.how-intro > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--green-ink);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: step;
}
.steps li {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.step-number {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--green-ink);
  min-width: 34px;
}
.steps h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 3px;
}
.steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

/* ---- Help / FAQ ------------------------------------------------------ */
.help-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(24px, 5vw, 56px);
  margin-top: clamp(40px, 7vw, 80px);
  padding-top: clamp(36px, 6vw, 64px);
  border-top: 1px solid var(--line);
}
.help-section h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  margin: 12px 0 14px;
}
.help-section > div:first-child > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--green-ink);
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-list details {
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  overflow: hidden;
}
.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--green-ink);
  transition: transform var(--fast) var(--ease);
}
.faq-list details[open] summary::after {
  transform: rotate(45deg);
}
.faq-list p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--text-2);
  font-size: 14px;
}

/* ---- Cookie banner --------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  width: min(94vw, 640px);
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
}
.cookie-banner div {
  flex: 1;
  min-width: 220px;
}
.cookie-banner strong { font-size: 15px; }
.cookie-banner p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.cookie-banner button {
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 13px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  transition: all var(--fast) var(--ease);
}
.cookie-banner button:hover { color: var(--text); }
#cookie-accept {
  background: var(--green);
  color: var(--on-green);
  border-color: transparent;
}

/* ---- Footer ---------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}
.site-footer .wordmark .official-logo { height: 24px; }
.site-footer > span {
  display: flex;
  flex-direction: column;
  text-align: center;
  font-weight: 600;
  color: var(--text-2);
}
.site-footer small { color: var(--text-3); font-weight: 500; }
.site-footer > button {
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  font-size: 13px;
}
.site-footer > button:hover { color: var(--text); }

/* ---- Scroll reveal --------------------------------------------------- */
.motion-enabled .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.motion-enabled .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 980px) {
  .login-stage { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 360px; }
  .quick-features { grid-template-columns: 1fr; }
  .how-section,
  .help-section { grid-template-columns: 1fr; }
}
@media (min-width: 981px) {
  .desktop-break { display: inline; }
}
@media (max-width: 620px) {
  .landing-nav { gap: 10px; }
  .landing-nav-links { gap: 8px; }
  .landing-nav-links > a:not(.store-link),
  .sound-toggle { display: none; }
  .store-link { padding: 9px 14px; }
  .hero-art { max-width: 280px; }
  .floating-mail { right: -6px; padding: 9px 12px; }
  .site-footer { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .motion-enabled .reveal { opacity: 1; transform: none; }
}
