/* Phenomenalone - sign-in and terms pages. Glass, floating characters,
   a cursor-following ghost, preloader and sign-in animation. */

/* ---- tokens: Red Ghost (default) ----------------------------------------- */
:root {
  color-scheme: dark;
  --canvas: #0d090b;
  --surface: #181014;
  --surface-alt: #20141a;
  --text: #fff5f7;
  --text-muted: #c6a8b0;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #ff2d4a;
  --accent-hover: #ff5a72;
  --accent-subtle: rgba(255, 45, 74, 0.14);
  --focus: #ff7a8d;
  --on-accent: #ffffff;
  --accent-grad: linear-gradient(180deg, #ff5068 0%, #ff2d4a 50%, #d9132f 100%);
  --btn-edge: #a50d23;
  --btn-glow: 0 0 30px -6px rgba(255, 45, 74, 0.75);
  --glass: rgba(26, 16, 21, 0.58);
  --glass-strong: rgba(30, 19, 25, 0.82);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-shine: rgba(255, 255, 255, 0.07);
  --field: rgba(255, 255, 255, 0.04);
  --blob-a: rgba(255, 45, 74, 0.55);
  --blob-b: rgba(59, 130, 246, 0.35);
  --blob-c: rgba(255, 159, 67, 0.3);
  --tile-bg: rgba(255, 255, 255, 0.06);
  --radius: 22px;
  --font: "Plus Jakarta Sans", ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", "Plus Jakarta Sans", ui-sans-serif, "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[data-theme-mode="light"] {
  color-scheme: light;
  --canvas: #f6f6fb;
  --surface: #ffffff;
  --surface-alt: #fbf4f5;
  --text: #1c0a0f;
  --text-muted: #6d5a5f;
  --border: rgba(28, 10, 15, 0.08);
  --border-strong: rgba(28, 10, 15, 0.16);
  --accent: #e0112b;
  --accent-hover: #b80d23;
  --accent-subtle: #fde7ea;
  --accent-grad: linear-gradient(180deg, #ff3b55 0%, #e0112b 55%, #b80d23 100%);
  --btn-edge: #9c0b1e;
  --btn-glow: 0 12px 26px -12px rgba(224, 17, 43, 0.85);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-shine: rgba(255, 255, 255, 0.9);
  --field: rgba(28, 10, 15, 0.035);
  --blob-a: rgba(255, 59, 85, 0.35);
  --blob-b: rgba(59, 130, 246, 0.28);
  --blob-c: rgba(52, 199, 89, 0.28);
  --tile-bg: rgba(255, 255, 255, 0.55);
}

html[data-theme-id="neon"] {
  --canvas: #0f212e;
  --surface: #1a2c38;
  --surface-alt: #213743;
  --text: #ffffff;
  --text-muted: #b1bad3;
  --accent: #00e701;
  --accent-hover: #1fff20;
  --accent-subtle: rgba(0, 231, 1, 0.12);
  --on-accent: #05250c;
  --accent-grad: linear-gradient(180deg, #1fff20 0%, #00e701 55%, #00c201 100%);
  --btn-edge: #008a01;
  --btn-glow: 0 0 26px -6px rgba(0, 231, 1, 0.6);
  --glass: rgba(26, 44, 56, 0.6);
  --glass-strong: rgba(33, 55, 67, 0.86);
  --blob-a: rgba(0, 231, 1, 0.35);
  --blob-b: rgba(20, 117, 225, 0.45);
  --blob-c: rgba(0, 231, 1, 0.18);
}
html[data-theme-id="neon"][data-theme-mode="light"] {
  --canvas: #eef2f6;
  --surface: #ffffff;
  --text: #0f212e;
  --text-muted: #557086;
  --accent: #0a8f16;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.88);
}
html[data-theme-id="spectre"] {
  --canvas: #0b0f1e;
  --surface: #141a2b;
  --text: #eef2ff;
  --text-muted: #a3acd1;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-subtle: rgba(167, 139, 250, 0.16);
  --on-accent: #120a2e;
  --accent-grad: linear-gradient(135deg, #e0d7ff 0%, #a78bfa 50%, #7c5cf0 100%);
  --btn-edge: #5b3fc4;
  --btn-glow: 0 0 28px -6px rgba(167, 139, 250, 0.7);
  --glass: rgba(20, 26, 43, 0.58);
  --glass-strong: rgba(27, 34, 56, 0.84);
  --blob-a: rgba(139, 92, 246, 0.5);
  --blob-b: rgba(8, 145, 178, 0.4);
  --blob-c: rgba(196, 181, 253, 0.25);
}
html[data-theme-id="spectre"][data-theme-mode="light"] {
  --canvas: #f5f6ff;
  --surface: #ffffff;
  --text: #17123a;
  --text-muted: #5d5a86;
  --accent: #6d28d9;
  --on-accent: #ffffff;
  --accent-grad: linear-gradient(135deg, #8b5cf6, #6d28d9 55%, #5b21b6);
  --glass: rgba(255, 255, 255, 0.64);
  --glass-strong: rgba(255, 255, 255, 0.88);
}
html[data-theme-id="phantom"][data-theme-mode="dark"] {
  --canvas: #0e0709;
  --surface: #170c10;
}

/* ---- base ----------------------------------------------------------------- */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
}
body {
  background: var(--canvas);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent);
  outline-offset: 2px;
}
#ghostFx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ---- preloader ------------------------------------------------------------ */
.pl {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(40rem 30rem at 50% 45%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--canvas);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.is-ready .pl {
  opacity: 0;
  visibility: hidden;
}
.pl-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.pl-ghost {
  position: relative;
  width: 96px;
  height: 96px;
}
.pl-ghost svg {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  animation: float 1.8s ease-in-out infinite;
  filter: drop-shadow(0 14px 22px color-mix(in srgb, var(--accent) 50%, transparent));
}
.pl-halo {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  animation: halo 1.6s ease-out infinite;
}
.pl-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.pl-word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  animation: letter 0.5s var(--ease) forwards;
  animation-delay: calc(var(--i) * 45ms + 150ms);
}
.pl-bar {
  width: 180px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
}
.pl-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent-grad);
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.25s ease;
}

/* ---- cursor ghost ------------------------------------------------------------ */
.cg {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 60px;
  height: 70px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}
.has-cursor-ghost.is-ready .cg {
  opacity: 1;
}
.cg-body {
  width: 60px;
  height: 60px;
  transition: transform 0.12s linear;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 35%, transparent));
}
.cg-body svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.cg-eyes {
  transition: transform 0.15s ease-out;
}
.cg-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.2s infinite;
}
.cg-shut,
.cg-sad {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cg-blush {
  opacity: 0.35;
  transition: opacity 0.2s ease;
}
.cg-mouth {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}
.cg[data-mood="shy"] .cg-eyes {
  opacity: 0;
}
.cg[data-mood="shy"] .cg-shut {
  opacity: 1;
}
.cg[data-mood="shy"] .cg-blush {
  opacity: 0.9;
}
.cg[data-mood="shy"] .cg-mouth {
  transform: scale(0.6);
}
.cg[data-mood="sad"] .cg-mouth {
  opacity: 0;
}
.cg[data-mood="sad"] .cg-sad {
  opacity: 1;
}
.cg[data-mood="cheer"] .cg-mouth {
  transform: scale(1.5, 1.2);
}
.cg[data-mood="cheer"] .cg-blush {
  opacity: 0.9;
}
.cg-shadow {
  width: 30px;
  height: 6px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  filter: blur(3px);
}
.cg.cg-shake .cg-body {
  animation: gshake 0.5s ease;
}

/* ---- layout ------------------------------------------------------------------ */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  align-items: center;
  gap: 24px;
  padding: 24px clamp(20px, 4vw, 64px);
}

/* the iOS-style floating composition */
.auth-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}
.stage-blob {
  position: absolute;
  border-radius: 38%;
  filter: blur(60px);
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}
.stage-blob--a {
  width: 280px;
  height: 280px;
  left: -8%;
  top: 18%;
  background: var(--blob-b);
}
.stage-blob--b {
  width: 260px;
  height: 260px;
  right: -4%;
  top: 28%;
  background: var(--blob-a);
  animation-delay: -6s;
}
.stage-blob--c {
  width: 200px;
  height: 200px;
  left: 40%;
  top: 4%;
  background: var(--blob-c);
  animation-delay: -11s;
}
.orbit {
  position: relative;
  width: min(560px, 92%);
  aspect-ratio: 1.25;
  perspective: 900px;
}
.orbit-tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  height: 190px;
  border-radius: 48px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(80% 80% at 80% 90%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--tile-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 30px 70px -30px color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease-out;
  z-index: 3;
  opacity: 0;
}
.is-ready .orbit-tile {
  animation: tile-in 0.9s var(--ease) 0.1s forwards;
}
.tile-ghost {
  width: 118px;
  height: 118px;
  filter: drop-shadow(0 16px 24px color-mix(in srgb, var(--accent) 55%, transparent));
  animation: float 4.5s ease-in-out infinite;
}
.orbit-av {
  position: absolute;
  width: var(--size);
  height: var(--size);
  transform: translate(-50%, -50%);
  z-index: calc(10 - var(--depth) * 10);
  filter: blur(calc(var(--depth) * var(--depth) * 7px));
  opacity: 0;
  transition: transform 0.25s ease-out;
}
.is-ready .orbit-av {
  animation: av-in 0.8s var(--ease) forwards;
  animation-delay: calc(0.25s + var(--delay) * 0.12s);
}
.orbit-av-float {
  width: 100%;
  height: 100%;
  animation: float 5s ease-in-out infinite;
  animation-delay: calc(var(--delay) * -1s);
}
.orbit-av .pa-av {
  width: 100%;
  height: 100%;
  background: none;
  box-shadow: none;
}
.orbit-av .avatar-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
}
.stage-copy {
  position: relative;
  z-index: 4;
  max-width: 520px;
  margin-top: -6px;
  opacity: 0;
}
.is-ready .stage-copy {
  animation: rise 0.8s var(--ease) 0.55s forwards;
}
.stage-kicker {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--text-muted);
}
.stage-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.stage-title span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stage-lede {
  margin: 0 auto;
  max-width: 440px;
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* ---- glass card ------------------------------------------------------------ */
.auth-panel {
  display: flex;
  justify-content: center;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 34px 32px 26px;
  border-radius: 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 40px 90px -40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  opacity: 0;
}
.is-ready .auth-card {
  animation: card-in 0.9s var(--ease) 0.2s forwards;
}
.auth-card.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  opacity: 1;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 60%, transparent), transparent 35%, transparent 65%, color-mix(in srgb, var(--accent) 35%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  box-shadow: var(--btn-glow);
}
.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}
.brand-ghost {
  width: 34px;
  height: 34px;
  animation: float 4.2s ease-in-out infinite;
}
.brand-ghost path {
  fill: var(--accent);
}
.brand-ghost .eye {
  fill: var(--surface);
}
.auth-card h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.auth-lede {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---- form ------------------------------------------------------------------ */
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-field {
  position: relative;
}
.auth-ico {
  position: absolute;
  left: 16px;
  top: 19px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}
.auth-ico svg,
.auth-eye svg,
.auth-btn-arrow {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-field input {
  width: 100%;
  height: 58px;
  padding: 22px 16px 6px 46px;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  background: var(--field);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-field--password input {
  padding-right: 52px;
}
.auth-field input:hover {
  border-color: var(--border-strong);
}
.auth-field input:focus {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--field));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.auth-field input:focus ~ .auth-ico,
.auth-field:focus-within .auth-ico {
  color: var(--accent);
}
.auth-field label {
  position: absolute;
  left: 47px;
  top: 18px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.2s var(--ease), color 0.2s ease;
}
.auth-field input:focus + label,
.auth-field input:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(0.74);
  color: var(--accent);
  font-weight: 700;
}
.auth-eye {
  position: absolute;
  right: 8px;
  top: 9px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.auth-eye:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}
.auth-eye[aria-pressed="true"] {
  color: var(--accent);
}
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}
.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: var(--text-muted);
  font-weight: 600;
}
.auth-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.auth-check-box {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--field);
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.auth-check input:checked + .auth-check-box {
  background: var(--accent-grad);
  border-color: transparent;
  transform: scale(1.05);
}
.auth-check input:checked + .auth-check-box::after {
  content: "";
  width: 5px;
  height: 10px;
  margin-top: -2px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.auth-check input:focus-visible + .auth-check-box {
  outline: 3px solid color-mix(in srgb, var(--focus) 70%, transparent);
  outline-offset: 2px;
}
.auth-caps {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
}
.auth-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, #ff2d4a 14%, transparent);
  color: color-mix(in srgb, #ff2d4a 70%, var(--text));
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, #ff2d4a 40%, transparent);
  animation: rise 0.3s var(--ease);
}
.auth-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 180, 0, 0.14);
  border: 1px solid rgba(255, 180, 0, 0.5);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-btn {
  position: relative;
  height: 56px;
  margin-top: 4px;
  border: none;
  border-radius: 16px;
  font: inherit;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-accent);
  cursor: pointer;
  background: var(--accent-grad);
  box-shadow: 0 4px 0 var(--btn-edge), var(--btn-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  transition: transform 0.15s var(--ease), box-shadow 0.2s ease, filter 0.2s ease;
}
.auth-btn::after {
  content: "";
  position: absolute;
  left: var(--rx, 50%);
  top: var(--ry, 50%);
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  opacity: 0;
}
.auth-btn.rippling::after {
  animation: ripple 0.6s ease-out;
}
.auth-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.auth-btn:hover .auth-btn-arrow {
  transform: translateX(4px);
}
.auth-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--btn-edge), var(--btn-glow);
}
.auth-btn:disabled {
  cursor: progress;
}
.auth-btn-arrow {
  transition: transform 0.2s var(--ease);
}
.auth-spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
  border-top-color: var(--on-accent);
  animation: spin 0.7s linear infinite;
}
.auth-btn.is-loading .auth-btn-label,
.auth-btn.is-loading .auth-btn-arrow {
  visibility: hidden;
}
.auth-btn.is-loading .auth-spinner {
  display: block;
}
.auth-btn.is-done {
  animation: btn-done 0.5s var(--ease) forwards;
}
.auth-foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.auth-foot--muted {
  margin-top: 8px;
  font-size: 0.8rem;
  opacity: 0.85;
}

/* ---- success sweep ----------------------------------------------------------- */
.auth-success {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60rem 40rem at 50% 40%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    var(--canvas);
  clip-path: circle(0 at var(--ox, 50%) var(--oy, 50%));
  pointer-events: none;
  transition: clip-path 0.9s cubic-bezier(0.7, 0, 0.2, 1);
}
.auth-success.is-on {
  clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 50%));
  pointer-events: auto;
}
.auth-success-inner {
  text-align: center;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.5s ease 0.45s, transform 0.6s var(--ease) 0.45s;
}
.auth-success.is-on .auth-success-inner {
  opacity: 1;
  transform: none;
}
.auth-success-av {
  width: 120px;
  height: 120px;
  margin: 0 auto 14px;
  animation: float 2.6s ease-in-out infinite;
}
.auth-success-av .pa-av,
.auth-success-av .avatar-svg {
  width: 100%;
  height: 100%;
}
.auth-success-hi {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.auth-success-sub {
  margin: 6px 0 0;
  color: var(--text-muted);
}
.auth-leaving .auth-card {
  transition: transform 0.6s var(--ease), opacity 0.6s ease;
  transform: scale(0.96) translateY(-8px);
}

/* ---- avatars (shared with the app) --------------------------------------------- */
.pa-av {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}
.pa-av--initials {
  width: 100%;
  height: 100%;
  font-weight: 800;
  background: var(--accent-grad);
  color: var(--on-accent);
}

/* ---- terms page ------------------------------------------------------------ */

.terms-page {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}
.terms-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}
.terms-top .auth-brand {
  margin: 0;
}
.terms-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px clamp(20px, 5vw, 48px);
  box-shadow: 0 24px 60px -30px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: rise-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.terms-card h1 {
  margin: 0 0 4px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
}
.terms-meta {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.terms-body h2 {
  font-size: 1.08rem;
  margin: 30px 0 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.terms-body h2 .num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
}
.terms-body p,
.terms-body li {
  color: color-mix(in srgb, var(--text) 86%, var(--text-muted));
  font-size: 0.97rem;
}
.terms-body ul {
  padding-left: 1.2rem;
}
.terms-body li {
  margin: 4px 0;
}
.terms-callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-subtle);
  padding: 14px 18px;
  border-radius: 0 14px 14px 0;
  margin: 18px 0;
  font-weight: 600;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.92rem;
}



/* ---- motion ------------------------------------------------------------------ */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}
@keyframes halo {
  from { transform: scale(0.7); opacity: 0.9; }
  to { transform: scale(1.3); opacity: 0; }
}
@keyframes letter {
  to { opacity: 1; transform: none; }
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
@keyframes gshake {
  20%, 60% { transform: translateX(-6px) rotate(-8deg); }
  40%, 80% { transform: translateX(6px) rotate(8deg); }
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, -30px) scale(1.15); }
}
@keyframes tile-in {
  from { opacity: 0; transform: translate(-50%, -40%) scale(0.8) rotateX(20deg); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes av-in {
  from { opacity: 0; scale: 0.4; }
  to { opacity: 1; scale: 1; }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes ripple {
  from { transform: scale(0); opacity: 1; }
  to { transform: scale(60); opacity: 0; }
}
@keyframes btn-done {
  50% { transform: scale(0.96); }
  to { transform: scale(1); filter: brightness(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- small screens ------------------------------------------------------------ */
@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 12px 16px 28px;
  }
  .auth-stage {
    padding: 0;
  }
  .orbit {
    width: min(420px, 100%);
    aspect-ratio: 1.5;
  }
  .orbit-tile {
    width: 120px;
    height: 120px;
    border-radius: 34px;
  }
  .tile-ghost {
    width: 76px;
    height: 76px;
  }
  .orbit-av {
    width: calc(var(--size) * 0.62);
    height: calc(var(--size) * 0.62);
  }
  .stage-lede {
    display: none;
  }
  .stage-kicker {
    display: none;
  }
  .stage-title {
    font-size: 1.9rem;
    margin-bottom: 18px;
  }
  .auth-card {
    padding: 26px 20px 20px;
  }
  .auth-brand {
    display: none;
  }
}
