/* ============================================================
   Genesis — application form
   Theme: deep slate / steel gray-blue · liquid glass · strict
   ============================================================ */

:root {
  --bg: #0a0c11;
  --bg-2: #0d1016;
  --ink: #e7eaf0;
  --muted: #98a1b2;
  --faint: #69717f;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);

  /* liquid glass */
  --glass: rgba(255, 255, 255, 0.05);
  --glass-2: rgba(255, 255, 255, 0.08);
  --glass-edge: rgba(255, 255, 255, 0.24);

  /* steel / gray-blue accents */
  --c1: #b8c6e0;
  --c2: #8294b4;
  --c3: #5c6c8a;
  --accent: #8fa1c1;
  --grad: linear-gradient(135deg, #d6e0f2 0%, #aabcdf 28%, #7a8fbd 62%, #515f8a 100%);
  --grad-soft: linear-gradient(135deg, #b6c4e2, #6f82a6);
  --grad-text: linear-gradient(118deg, #f0f4fc 0%, #cbd6ee 36%, #9fb3da 68%, #7589b6 100%);

  --glow: 0 0 0 1px rgba(150, 168, 202, 0.5), 0 0 30px rgba(120, 140, 180, 0.2);
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo", var(--font);
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }

/* film grain (poster texture, like the references) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- loading splash ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 90% at 50% 38%, #12161e 0%, #070a0e 70%);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-inner { text-align: center; padding: 20px; }
.boot-logo {
  width: 86px; height: 86px;
  animation: bootPulse 1.7s var(--ease-io) infinite;
  filter: drop-shadow(0 8px 26px rgba(130, 148, 180, 0.4));
}
.boot-word {
  margin-top: 20px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 25px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.boot-sub {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
}
.boot-bar {
  width: 190px; height: 2px;
  margin: 20px auto 0;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.boot-bar-fill {
  display: block; height: 100%; width: 38%;
  border-radius: 2px;
  background: var(--grad-soft);
  animation: bootLoad 1.15s var(--ease-io) infinite;
}
@keyframes bootLoad { 0% { transform: translateX(-130%); } 100% { transform: translateX(380%); } }
@keyframes bootPulse { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }

/* ---------- animated background ---------- */

#stars {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; display: block;
}
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora .blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
  mix-blend-mode: screen; will-change: transform;
}
.blob.b1 {
  width: 48vmax; height: 48vmax; left: -15vmax; top: -19vmax;
  background: radial-gradient(circle at 30% 30%, #708ac0 0%, #44548014 46%, transparent 66%);
  animation: drift1 26s var(--ease-io) infinite alternate;
}
.blob.b2 {
  width: 42vmax; height: 42vmax; right: -17vmax; top: 4vmax;
  background: radial-gradient(circle at 60% 40%, #8294bf 0%, #4b5b8a18 46%, transparent 64%);
  animation: drift2 32s var(--ease-io) infinite alternate;
}
.blob.b3 {
  width: 36vmax; height: 36vmax; left: 24vmax; bottom: -22vmax;
  background: radial-gradient(circle at 50% 50%, #8d7298 0%, #4c5180 50%, transparent 64%);
  opacity: 0.32;
  animation: drift3 30s var(--ease-io) infinite alternate;
}
.grid-veil {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 74%);
}
@keyframes drift1 { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(-7vmax, 5vmax, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(6vmax, -5vmax, 0) scale(1.15); } }

/* ---------- cosmos: planet, orbits, moons, streaks, horizon ---------- */

.planet-system {
  position: absolute;
  top: -150px; right: -140px;
  width: 560px; height: 560px;
  pointer-events: none;
  animation: floatSlow 18s ease-in-out infinite;
}
@keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(18px); } }

.planet { position: absolute; inset: 0; }
.planet-body, .planet-flare, .planet-atmo, .planet-ring { position: absolute; }

.planet-body {
  inset: 0; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 34% 30%,
    #c8d3ea 0%, #93a4c8 20%, #56668c 46%, #2b3450 70%, #141a2b 100%);
  box-shadow:
    inset -30px -26px 70px rgba(0, 0, 0, 0.6),
    inset 30px 26px 60px rgba(176, 198, 236, 0.16),
    0 0 90px rgba(95, 125, 185, 0.22);
}
.planet-body::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-linear-gradient(86deg, transparent 0 15px, rgba(220, 232, 255, 0.05) 15px 18px);
  mix-blend-mode: overlay; opacity: 0.55;
  animation: planetBands 40s linear infinite;
}
@keyframes planetBands { to { transform: translateX(-18px); } }

.planet-atmo {
  inset: -5%; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, transparent 60%, rgba(150, 180, 235, 0.22) 68%, transparent 73%);
}
.planet-flare {
  width: 62%; height: 62%; left: 4%; top: 2%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 190, 0.26), transparent 68%);
  filter: blur(18px);
}
.planet-ring {
  left: -32%; top: 25%; width: 164%; height: 50%;
  border-radius: 50%;
  border: 2px solid rgba(176, 196, 230, 0.16);
  border-bottom-color: rgba(176, 196, 230, 0.04);
  transform: rotate(-24deg);
}

.orbit {
  position: absolute; left: 50%; top: 50%;
  border-radius: 50%;
  border: 1.5px solid rgba(168, 188, 224, 0.18);
  transform: translate(-50%, -50%) rotate(-18deg);
  animation: orbitBreathe 9s ease-in-out infinite;
}
.o1 { width: 740px; height: 300px; }
.o2 { width: 970px; height: 380px; animation-delay: -3s; border-color: rgba(168, 188, 224, 0.13); }
.o3 { width: 1220px; height: 470px; animation-delay: -6s; border-color: rgba(168, 188, 224, 0.09); }
@keyframes orbitBreathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.moon-orbit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; animation: spin 30s linear infinite; }
.moon-orbit.m2 { animation-duration: 46s; animation-direction: reverse; }
.moon {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: #dce6f6; box-shadow: 0 0 14px 2px rgba(175, 200, 242, 0.8);
}
.moon-orbit.m1 .moon { transform: translate(330px, -54px); }
.moon-orbit.m2 .moon { transform: translate(-280px, 44px); }

.horizon {
  position: absolute; left: 50%; bottom: -34vh;
  width: 130vw; height: 64vh; transform: translateX(-50%);
  background: radial-gradient(58% 100% at 50% 100%, rgba(96, 126, 186, 0.3), rgba(72, 92, 144, 0.12) 46%, transparent 70%);
  filter: blur(22px);
}
.streak {
  position: absolute; height: 1px; border-radius: 1px;
  background: linear-gradient(90deg, transparent, rgba(182, 204, 240, 0.62), transparent);
  filter: blur(0.4px);
}
.streak.s1 { top: 18%; left: -12vw; width: 44vw; animation: streakDrift 16s ease-in-out infinite; }
.streak.s2 { top: 70%; right: -12vw; width: 40vw; animation: streakDrift 21s ease-in-out infinite reverse; }
.streak.s3 { top: 40%; left: -10vw; width: 30vw; animation: streakDrift 19s ease-in-out infinite; animation-delay: -5s; }
.streak.s4 { top: 86%; left: 6vw; width: 32vw; animation: streakDrift 24s ease-in-out infinite reverse; animation-delay: -8s; }
@keyframes streakDrift {
  0%, 100% { opacity: 0.22; transform: translateX(0) rotate(-19deg); }
  50% { opacity: 0.78; transform: translateX(46px) rotate(-19deg); }
}

/* just.gif — faint ambient star behind the content (the gif spins on its own) */
.just-bg {
  position: fixed; left: 50%; top: 45%; z-index: 0;
  width: min(60vmin, 500px); height: min(60vmin, 500px);
  transform: translate(-50%, -50%);
  background: url("/assets/just.gif") center / contain no-repeat;
  opacity: 0.06; mix-blend-mode: screen; pointer-events: none;
  filter: saturate(0.65);
  -webkit-mask: radial-gradient(circle, #000 52%, transparent 72%);
  mask: radial-gradient(circle, #000 52%, transparent 72%);
  animation: justFloat 17s ease-in-out infinite;
}
@keyframes justFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -53%) scale(1.05); }
}

/* ---------- logo mark (gradient via mask) ---------- */

.logo-mark {
  display: inline-block;
  background: var(--grad);
  background-size: 180% 180%;
  -webkit-mask: url(/assets/genesis-logo.png) center / contain no-repeat;
  mask: url(/assets/genesis-logo.png) center / contain no-repeat;
  animation: shimmer 8s var(--ease-io) infinite alternate;
}
.logo-mark.sm { width: 30px; height: 30px; }
.logo-mark.lg {
  width: 104px; height: 104px;
  filter: drop-shadow(0 6px 24px rgba(130, 150, 185, 0.42));
  animation: shimmer 8s var(--ease-io) infinite alternate, floaty 6.5s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: 100% 100%; } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-9px) rotate(-2deg); } }

/* ---------- topbar ---------- */

.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 40px);
}
.brand-mini {
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none;
  font-family: var(--display); font-weight: 800;
  letter-spacing: 0.16em; font-size: 14px; text-transform: uppercase;
}
.brand-word {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* liquid-glass language switch */
.lang-switch {
  position: relative; display: inline-flex; padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-edge);
}
.lang-opt {
  position: relative; z-index: 2;
  border: 0; background: transparent; color: var(--muted);
  font: 600 12px/1 var(--mono); letter-spacing: 0.08em;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  transition: color 0.3s var(--ease);
}
.lang-opt.is-active { color: #0b0e13; }
.lang-pill {
  position: absolute; z-index: 1; top: 4px; left: 4px;
  width: calc(50% - 4px); height: calc(100% - 8px);
  border-radius: 999px; background: var(--grad-soft);
  box-shadow: 0 4px 14px rgba(110, 126, 157, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.4s var(--ease);
}
.lang-switch[data-active="en"] .lang-pill { transform: translateX(100%); }

/* ---------- stage / card (liquid glass) ---------- */

.stage {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(8px, 3vw, 28px) clamp(14px, 4vw, 40px) 40px;
}
.card {
  position: relative;
  width: min(980px, 100%);
  display: grid; grid-template-columns: 340px 1fr;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow:
    0 34px 90px -34px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 var(--glass-edge),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  opacity: 0; transform: translateY(18px) scale(0.99);
  animation: cardIn 0.9s var(--ease) forwards;
}
/* specular highlight (liquid glass sheen) */
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(80% 50% at 12% -6%, rgba(255, 255, 255, 0.14), transparent 60%),
    radial-gradient(60% 40% at 108% 0%, rgba(174, 191, 218, 0.1), transparent 55%);
}
@keyframes cardIn { to { opacity: 1; transform: none; } }

/* ---------- aside ---------- */

.card-aside {
  position: relative; z-index: 1;
  padding: 38px 30px 28px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(130, 148, 180, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(120, 138, 170, 0.05), rgba(70, 85, 115, 0.03));
}
.aside-top { display: flex; flex-direction: column; }
.brand-title {
  margin: 18px 0 0;
  font-family: var(--display); font-weight: 900;
  font-size: 34px; letter-spacing: 0.07em; text-indent: 0.07em; text-transform: uppercase;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { margin: 13px 0 0; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.5; max-width: 32ch; }

.steps { position: relative; list-style: none; margin: 36px 0 0; padding: 0; flex: 1; }
.steps-track {
  position: absolute; left: 15px; top: 12px;
  width: 2px; height: calc(100% - 60px);
  background: var(--line); border-radius: 2px;
}
.steps-fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 0%;
  border-radius: 2px;
  background: linear-gradient(180deg, #cdd8ef 0%, #8194b8 45%, #cdd8ef 100%);
  background-size: 100% 220%;
  box-shadow: 0 0 10px rgba(140, 160, 195, 0.55);
  transition: height 0.6s var(--ease);
  animation: stepsFlow 2.8s linear infinite;
}
/* rising energy sparks — shown only once there's progress (.flowing) so they ride the filled segment, never the dots */
.steps-fill.flowing::before, .steps-fill.flowing::after {
  content: ""; position: absolute; left: 50%; width: 3px; height: 3px;
  margin-left: -1.5px; border-radius: 50%;
  background: #eaf1fc; box-shadow: 0 0 6px 1.5px rgba(190, 210, 245, 0.85);
  animation: stepsSpark 2.8s var(--ease-io) infinite;
}
.steps-fill.flowing::after { animation-delay: 1.4s; opacity: 0.7; }
@keyframes stepsFlow { from { background-position: 0 0; } to { background-position: 0 -220%; } }
@keyframes stepsSpark {
  0% { top: 100%; opacity: 0; }
  14% { opacity: 1; }
  82% { opacity: 0.9; }
  100% { top: -4px; opacity: 0; }
}
.step { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 9px 0; margin-bottom: 14px; }
.step-dot {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--bg-2);
  border: 1.5px solid var(--line); color: var(--faint);
  font: 600 12px var(--mono);
  transition: all 0.4s var(--ease);
}
.step-label { color: var(--faint); font-size: 13.5px; font-weight: 500; transition: color 0.4s var(--ease); }
.step.is-active .step-dot {
  border-color: transparent; background: var(--grad-soft); color: #0b0e13;
  box-shadow: 0 0 0 4px rgba(130, 148, 180, 0.15), 0 6px 16px rgba(110, 126, 157, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: scale(1.06);
}
.step.is-active .step-label { color: var(--ink); }
.step.is-done .step-dot { border-color: transparent; background: linear-gradient(rgba(140, 159, 192, 0.24), rgba(140, 159, 192, 0.14)), var(--bg-2); color: var(--c1); }
.step.is-done .step-num { display: none; }
.step.is-done .step-dot::after { content: "✓"; font-size: 14px; color: var(--c1); }
.step-num { line-height: 1; }

.aside-foot { display: flex; align-items: center; gap: 9px; margin-top: 22px; color: var(--faint); font: 500 11px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #6fce9f; box-shadow: 0 0 0 0 rgba(111, 206, 159, 0.6); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(111, 206, 159, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(111, 206, 159, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 206, 159, 0); } }

/* ---------- main / panels ---------- */

.card-main { position: relative; z-index: 1; padding: 40px clamp(26px, 3.4vw, 44px) 30px; min-height: 520px; display: flex; flex-direction: column; }
.progress-mobile { display: none; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 26px; }
.pm-fill { display: block; height: 100%; width: 25%; border-radius: 4px; background: var(--grad-soft); transition: width 0.5s var(--ease); }

.panel { flex: 1; }
.panel[hidden] { display: none; }
.panel.anim { animation: panelIn 0.5s var(--ease) both; }
.panel.anim-back { animation: panelInBack 0.5s var(--ease) both; }
@keyframes panelIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes panelInBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* staggered child entrance — the section "assembles" instead of snapping in */
.panel.anim > *, .panel.anim-back > * { animation: fieldRise 0.5s var(--ease) both; }
.panel.anim > :nth-child(1), .panel.anim-back > :nth-child(1) { animation-delay: 0.03s; }
.panel.anim > :nth-child(2), .panel.anim-back > :nth-child(2) { animation-delay: 0.09s; }
.panel.anim > :nth-child(3), .panel.anim-back > :nth-child(3) { animation-delay: 0.15s; }
.panel.anim > :nth-child(4), .panel.anim-back > :nth-child(4) { animation-delay: 0.21s; }
.panel.anim > :nth-child(5), .panel.anim-back > :nth-child(5) { animation-delay: 0.27s; }
@keyframes fieldRise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.panel-head { margin-bottom: 26px; }
.panel-kicker {
  display: inline-block; font: 700 11px var(--mono);
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(23px, 3vw, 28px); letter-spacing: -0.015em; }
.panel-head p { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ---------- fields ---------- */

.field { position: relative; margin-bottom: 22px; }
.field:last-of-type { margin-bottom: 0; }
.control {
  width: 100%; font: 450 15px var(--font); color: var(--ink);
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px 16px 9px; outline: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
  resize: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
textarea.control { padding-top: 26px; line-height: 1.5; min-height: 92px; }
.control::placeholder { color: transparent; }
.control:hover { border-color: rgba(255, 255, 255, 0.18); }
.control:focus { border-color: transparent; background: rgba(140, 159, 192, 0.08); box-shadow: var(--glow); }

.field > label { position: absolute; left: 17px; top: 16px; color: var(--muted); font-size: 15px; pointer-events: none; transition: all 0.22s var(--ease); }
.control:focus + label, .control:not(:placeholder-shown) + label { top: 8px; font-size: 11px; letter-spacing: 0.03em; color: var(--accent); font-family: var(--mono); }
.control:not(:placeholder-shown):not(:focus) + label { color: var(--faint); }
.opt-tag { margin-left: 6px; font: 400 10px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; vertical-align: middle; }
.bar { display: none; }
.hint { display: block; margin-top: 7px; color: var(--faint); font-size: 12px; line-height: 1.4; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.counter { color: var(--faint); font: 400 11px var(--mono); }
.err { display: none; margin-top: 7px; color: #e6a4a4; font-size: 12px; }
.field.invalid .control { border-color: rgba(224, 138, 138, 0.6); box-shadow: 0 0 0 3px rgba(224, 138, 138, 0.12); }
.field.invalid .err { display: block; }
.field.invalid { animation: shake 0.4s var(--ease-io); }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }

.field-static .field-title { display: block; font: 600 13px var(--font); color: var(--ink); margin-bottom: 4px; }
.field-static .hint { margin-bottom: 13px; margin-top: 2px; }

/* ---------- chips (software) ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1px solid var(--line); background: var(--glass); color: var(--muted);
  font: 500 13px var(--font); padding: 9px 14px; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: all 0.22s var(--ease);
}
.chip:hover { border-color: rgba(143, 161, 193, 0.55); color: var(--ink); transform: translateY(-1px); }
.chip.is-active {
  border-color: transparent; background: var(--grad-soft); color: #0b0e13; font-weight: 600;
  box-shadow: 0 6px 16px rgba(110, 126, 157, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.control-inline { margin-top: 13px; padding-top: 13px; padding-bottom: 13px; }
.control-inline::placeholder { color: var(--faint); }
.inline-label { display: none; }
.chips.at-limit { animation: chipsLimit 0.42s var(--ease); }
@keyframes chipsLimit { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }

/* ---------- nav buttons ---------- */

.form-nav { display: flex; align-items: center; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.nav-spacer { flex: 1; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  border: 0; border-radius: 12px; padding: 13px 22px;
  font: 700 14.5px var(--font); cursor: pointer; overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn .ico { font-size: 16px; line-height: 1; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.primary {
  color: #0b0e13; background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 10px 28px -10px rgba(110, 126, 157, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn.primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-120%); transition: transform 0.7s var(--ease);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -12px rgba(110, 126, 157, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn.primary:hover::before { transform: translateX(120%); }
.btn.ghost {
  background: var(--glass); color: var(--muted); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--glass-edge);
}
.btn.ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.22); background: var(--glass-2); }
.btn[hidden] { display: none; }
.btn.submit { min-width: 168px; justify-content: center; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: 0.55; }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(11, 14, 19, 0.35); border-top-color: #0b0e13; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error { margin: 16px 0 0; padding: 11px 14px; border-radius: 11px; background: rgba(224, 138, 138, 0.1); border: 1px solid rgba(224, 138, 138, 0.3); color: #e6a4a4; font-size: 13px; }
.form-error[hidden] { display: none; }

/* ---------- review ---------- */

.review { margin: 0; display: grid; gap: 12px; }
.review .row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 13px;
  background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: panelIn 0.5s var(--ease) both;
}
.review .row dt { font: 600 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 5px; }
.review .row dd { margin: 0; font-size: 14px; color: var(--ink); word-break: break-word; line-height: 1.45; }
.review .row dd.empty { color: var(--faint); font-style: italic; }
.review .row dd a { color: var(--c1); text-decoration: none; }
.review .row dd a:hover { text-decoration: underline; }
.review .edit { align-self: center; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 12px var(--font); padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all 0.2s var(--ease); }
.review .edit:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- success ---------- */

.done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 10px; position: relative; animation: panelIn 0.6s var(--ease) both; }
.done[hidden] { display: none; }
.done h2 { margin: 22px 0 0; font-family: var(--display); font-size: 27px; font-weight: 800; letter-spacing: -0.015em; }
.done p { margin: 11px 0 26px; color: var(--muted); font-size: 14.5px; max-width: 36ch; line-height: 1.55; }
.check { position: relative; }
.check-ring { stroke: var(--c1); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 0.7s var(--ease) forwards; }
.check-mark { stroke: var(--c1); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 0.45s var(--ease) 0.55s forwards; filter: drop-shadow(0 0 6px rgba(174, 191, 218, 0.7)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-burst { position: absolute; top: 18%; left: 50%; width: 0; height: 0; }
.done-burst::before, .done-burst::after {
  content: "✦ ✧ ✦ ✧ ✦ ✧"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); letter-spacing: 30px; font-size: 14px; color: var(--c2); opacity: 0;
  animation: burst 1.1s var(--ease) 0.5s both;
}
.done-burst::after { color: var(--c1); animation-delay: 0.62s; letter-spacing: 44px; }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 40% { opacity: 0.9; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }

/* ---------- footer ---------- */

.site-foot {
  position: relative; z-index: 2;
  width: min(980px, 100%);
  margin: 26px auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.foot-link {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass); color: var(--muted);
  font: 500 12.5px var(--font); padding: 9px 16px; cursor: pointer; text-decoration: none;
  backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-edge);
  transition: all 0.22s var(--ease);
}
.foot-link:hover { color: var(--ink); border-color: rgba(143, 161, 193, 0.55); transform: translateY(-1px); }
.foot-ico { color: var(--accent); font-size: 10px; }
.foot-contact { margin: 0; font: 400 12.5px var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.foot-contact b { color: var(--ink); font-weight: 700; }
.legal { margin: 0; color: var(--faint); font-family: var(--serif); font-style: italic; font-size: 12.5px; line-height: 1.55; max-width: 58ch; }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ---------- modal (liquid glass) ---------- */

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 22px; }
.modal[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(6, 8, 12, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 0.3s var(--ease) both; }
.modal-card {
  position: relative; z-index: 1;
  width: min(540px, 100%); max-height: 82vh; overflow-y: auto;
  padding: 30px 30px 28px;
  border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85), inset 0 1px 0 var(--glass-edge);
  animation: modalIn 0.4s var(--ease) both;
}
.modal-card h2 { margin: 10px 0 14px; font-family: var(--display); font-weight: 800; font-size: 23px; }
.modal-x { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); cursor: pointer; font-size: 13px; transition: all 0.2s var(--ease); }
.modal-x:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.25); }
.modal-body { color: var(--muted); font-size: 14px; line-height: 1.65; }
.modal-body h3 { color: var(--ink); font: 600 14px var(--font); margin: 18px 0 8px; }
.modal-body p { margin: 0 0 10px; }
.modal-body ul { margin: 0 0 10px; padding-left: 18px; }
.modal-body li { margin: 4px 0; }
.modal-body .todo { color: var(--faint); font-style: italic; }
.modal-body a { color: var(--c1); }
.modal-body .rules { margin: 0 0 14px; padding-left: 22px; }
.modal-body .rules li { margin: 0 0 9px; color: var(--muted); line-height: 1.5; }
.modal-body .rules li:last-child { margin-bottom: 0; }
.modal-body .rules li::marker { color: var(--accent); font-weight: 700; }
.modal-gif {
  display: block; width: 112px; height: auto; margin: 6px auto 0;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.6);
  animation: gifBob 3.4s ease-in-out infinite;
}
@keyframes gifBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .card { grid-template-columns: 1fr; }
  .card-aside { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 30px 26px 24px; }
  .aside-top { align-items: center; text-align: center; }
  .tagline { max-width: 38ch; }
  .steps { display: none; }
  .aside-foot { justify-content: center; margin-top: 18px; }
  .logo-mark.lg { width: 84px; height: 84px; }
  .progress-mobile { display: block; }
  .card-main { min-height: 0; padding: 28px 22px 26px; }
  .planet-system { width: 360px; height: 360px; top: -90px; right: -80px; }
  .streak.s3, .streak.s4 { display: none; }
}
@media (max-width: 460px) {
  .topbar { padding: 16px; }
  .form-nav { gap: 8px; }
  .btn { padding: 12px 16px; font-size: 14px; }
  .btn.ghost .ico { display: none; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .card, .panel.anim, .panel.anim-back, .panel.anim > *, .panel.anim-back > *, .done { opacity: 1 !important; transform: none !important; }
  .logo-mark { animation: none; }
  .boot { transition: opacity 0.2s linear; }
}
