/* ───────────────────────────────────────────────────────────────
   1991 — Dark Neomorphism (90% Black & White)
─────────────────────────────────────────────────────────────── */
:root {
  --base: #1a1a1c;
  
  --ink: #eeeeee;
  --ink-soft: #a0a0a5;
  --ink-faint: #606066;

  --radius: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  /* Neomorphic Shadows */
  /* Extruded (pops out) */
  --neo-out: 
    -6px -6px 14px rgba(255, 255, 255, 0.03),
     6px  6px 14px rgba(0, 0, 0, 0.6);
  --neo-out-hover: 
    -4px -4px 10px rgba(255, 255, 255, 0.04),
     4px  4px 10px rgba(0, 0, 0, 0.7);
  
  /* Recessed (carved in) */
  --neo-in: 
    inset  4px  4px 8px rgba(0, 0, 0, 0.6),
    inset -4px -4px 8px rgba(255, 255, 255, 0.02);
    
  --neo-in-focus: 
    inset  2px  2px 4px rgba(0, 0, 0, 0.7),
    inset -2px -2px 4px rgba(255, 255, 255, 0.03);

  /* Dropdown/Panel (deep float) */
  --neo-float:
    0 16px 32px rgba(0, 0, 0, 0.8),
    -2px -2px 8px rgba(255, 255, 255, 0.02);

  --font: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--base); }

body {
  font-family: var(--font);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background ── */
.bg { position: fixed; inset: 0; z-index: 0; background: var(--base); overflow: hidden; }

/* Large Neomorphic Sculpting */
.bg-shape {
  position: absolute;
  background: var(--base);
}
.shape-1 {
  width: 150vw; height: 150vw;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  top: -100vw; left: -50vw;
  box-shadow: var(--neo-out);
  animation: slow-morph 35s infinite alternate ease-in-out;
}
.shape-2 {
  width: 120vw; height: 120vw;
  border-radius: 50% 40% 60% 40% / 50% 60% 40% 50%;
  bottom: -70vw; right: -40vw;
  box-shadow: var(--neo-in);
  animation: slow-morph-2 40s infinite alternate ease-in-out;
}
.shape-3 {
  width: 80vw; height: 120vh;
  border-radius: 50%;
  top: -10vh; left: -40vw;
  box-shadow: var(--neo-out);
}
.shape-4 {
  width: 90vw; height: 90vw;
  border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
  top: -40vw; right: -30vw;
  box-shadow: var(--neo-in);
  animation: slow-morph 30s infinite alternate-reverse ease-in-out;
}
.shape-5 {
  width: 40vw; height: 40vw;
  border-radius: 20%;
  bottom: -10vw; left: -10vw;
  box-shadow: var(--neo-out);
  transform: rotate(25deg);
}

/* Floating 3D Elements */
.bg-float {
  position: absolute;
  background: var(--base);
  border-radius: 50%;
}
.float-1 {
  width: 120px; height: 120px;
  top: 15%; right: 8%;
  box-shadow: var(--neo-out);
  animation: float-y 12s infinite alternate ease-in-out;
}
.float-2 {
  width: 80px; height: 200px;
  border-radius: 999px;
  bottom: 20%; left: 6%;
  box-shadow: var(--neo-in);
  animation: float-y 16s infinite alternate-reverse ease-in-out;
}
.float-3 {
  width: 60px; height: 60px;
  bottom: 30%; right: 12%;
  box-shadow: var(--neo-out);
  animation: float-y 9s infinite alternate ease-in-out;
}
.float-4 {
  width: 40px; height: 100px;
  border-radius: 999px;
  top: 25%; left: 10%;
  box-shadow: var(--neo-in);
  animation: float-y 11s infinite alternate-reverse ease-in-out;
}
.float-5 {
  width: 90px; height: 90px;
  top: 45%; right: 5%;
  background: transparent;
  border: 15px solid var(--base);
  box-shadow: var(--neo-out), inset 6px 6px 14px rgba(0, 0, 0, 0.6), inset -6px -6px 14px rgba(255, 255, 255, 0.03);
  animation: float-y 15s infinite alternate ease-in-out;
}

@keyframes slow-morph {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; transform: rotate(0deg); }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 40% 60%; transform: rotate(10deg); }
}
@keyframes slow-morph-2 {
  0% { border-radius: 50% 40% 60% 40% / 50% 60% 40% 50%; transform: rotate(0deg) scale(1); }
  100% { border-radius: 40% 60% 40% 60% / 60% 40% 60% 40%; transform: rotate(-15deg) scale(1.05); }
}
@keyframes float-y {
  0% { transform: translateY(0); }
  100% { transform: translateY(-40px); }
}

.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ── Layout ── */
.app {
  position: relative;
  z-index: 3;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 20px 56px;
}

/* ── Boot spinner ── */
.boot { display: grid; place-items: center; min-height: 40vh; }
.boot-ring {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--base);
  box-shadow: var(--neo-out);
  position: relative;
  animation: pulse-ring 2s infinite ease-in-out;
}
.boot-ring::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 4px solid transparent; border-top-color: #fff;
  animation: spin 1s linear infinite;
}
@keyframes pulse-ring { 0%,100% { box-shadow: var(--neo-out); } 50% { box-shadow: var(--neo-in); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Neomorphic Card ── */
.card {
  width: min(560px, 100%);
  background: var(--base);
  border-radius: var(--radius);
  box-shadow: var(--neo-out);
  padding: 44px 48px;
  position: relative;
  overflow: hidden;
  animation: rise 0.7s var(--ease) both;
}
.card.wide { width: min(620px, 100%); }
@keyframes rise {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: none; }
}

/* ── Brand header ── */
.brand {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 36px; padding-bottom: 28px;
  border-bottom: 2px solid rgba(0,0,0,0.2);
  box-shadow: 0 2px 2px rgba(255,255,255,0.01);
}
.brand img {
  width: 60px; height: 60px; border-radius: 18px;
  background: var(--base);
  box-shadow: var(--neo-out);
  padding: 4px;
  filter: grayscale(1) contrast(1.1);
}
.brand .titles { line-height: 1.2; }
.brand h1 {
  margin: 0; font-family: var(--display); font-weight: 700;
  font-size: 26px; letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5), -1px -1px 2px rgba(255,255,255,0.05);
}
.brand p {
  margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em;
}

/* "1991" accent - Chrome styling */
.holo {
  color: #fff;
}
.hero .holo, .success .holo {
  background: var(--base);
  color: #fff;
  padding: 2px 10px; border-radius: 6px;
  box-shadow: var(--neo-in);
  display: inline-block;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--ink-faint); box-shadow: var(--neo-in); }

/* ── Hero / login ── */
.hero h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(28px, 5vw, 40px);
  margin: 0 0 16px; line-height: 1.15;
}
.hero p.lead { color: var(--ink-soft); font-size: 15px; line-height: 1.6; margin: 0 0 36px; }

.perks { list-style: none; padding: 0; margin: 0 0 36px; display: grid; gap: 18px; }
.perks li {
  display: flex; gap: 16px; align-items: center;
  font-size: 14px; color: var(--ink-soft); font-weight: 500;
}
.perks li svg {
  flex: none; padding: 6px; border-radius: 50%;
  background: var(--base); color: var(--ink); width: 30px; height: 30px;
  box-shadow: var(--neo-out);
}

/* ── User chip ── */
.userchip {
  display: flex; align-items: center; gap: 16px;
  background: var(--base);
  border-radius: 999px; padding: 6px 16px 6px 6px;
  margin-bottom: 32px; width: fit-content; max-width: 100%;
  box-shadow: var(--neo-in);
}
.userchip img {
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: var(--neo-out);
  object-fit: cover;
  filter: grayscale(1);
}
.userchip .meta { line-height: 1.3; }
.userchip .meta b { font-size: 14px; font-weight: 600; color: var(--ink); }
.userchip .meta span { display: block; font-size: 12px; color: var(--ink-soft); }
.userchip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; margin-left: 6px;
  box-shadow: 0 0 6px #fff;
}
.signout {
  appearance: none; cursor: pointer; margin-left: auto;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--ink-faint); background: var(--base); border: none;
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  box-shadow: var(--neo-out);
  transition: all 0.2s var(--ease);
}
.signout:hover { color: var(--ink); box-shadow: var(--neo-out-hover); }
.signout:active { box-shadow: var(--neo-in); }

/* ── Buttons ── */
.btn {
  appearance: none; cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: 14px; letter-spacing: 0.02em;
  color: var(--ink); background: var(--base); border: none;
  padding: 18px 24px; border-radius: var(--radius-md);
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  text-decoration: none; position: relative;
  box-shadow: var(--neo-out);
  transition: all 0.2s var(--ease);
}
.btn:hover { box-shadow: var(--neo-out-hover); color: #fff; }
.btn:active { box-shadow: var(--neo-in); color: var(--ink-soft); transform: scale(0.99); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: var(--neo-in) !important; color: var(--ink-faint); transform: none !important; }

/* Subvert discord blue to stay 90% B&W */
.btn.discord { color: #fff; }
.btn.discord svg { color: #fff; }

.btn.ghost { box-shadow: var(--neo-in); color: var(--ink-soft); }
.btn.ghost:hover { box-shadow: var(--neo-out); color: var(--ink); }
.btn.ghost:active { box-shadow: var(--neo-in-focus); }

.btn.sm { width: auto; padding: 12px 20px; font-size: 13px; }

/* ── Form ── */
.field { margin-bottom: 28px; }
.field > label {
  display: flex; align-items: baseline; font-size: 13px; font-weight: 600;
  margin-bottom: 12px; color: var(--ink-soft);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.field .hint { color: var(--ink-faint); font-weight: 500; font-size: 11px; margin-left: auto; text-transform: uppercase; letter-spacing: 0.05em; }
.req { color: #fff; margin-left: 4px; }

.input, textarea.input {
  width: 100%;
  background: var(--base); border: none;
  border-radius: var(--radius-md);
  color: var(--ink); font-family: inherit; font-size: 14px;
  padding: 16px 20px; outline: none;
  box-shadow: var(--neo-in);
  transition: all 0.2s var(--ease);
}
.input::placeholder { color: var(--ink-faint); }
.input:focus, textarea.input:focus {
  box-shadow: var(--neo-in-focus);
  color: #fff;
}
textarea.input { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ── Custom multi-select dropdown ── */
.select { position: relative; }
.select-trigger {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--base); border: none;
  border-radius: var(--radius-md);
  color: var(--ink); font-family: inherit; font-size: 14px;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--neo-in);
  transition: all 0.2s var(--ease);
}
.select.open .select-trigger { box-shadow: var(--neo-in-focus); }
.select-trigger .placeholder { color: var(--ink-faint); }
.select-trigger .chev { transition: transform 0.3s var(--ease); flex: none; color: var(--ink-soft); }
.select.open .select-trigger .chev { transform: rotate(180deg); color: #fff; }

.select-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
  color: #fff; background: var(--base);
  box-shadow: var(--neo-out);
}

.select-panel {
  position: absolute; top: calc(100% + 16px); left: 0; right: 0; z-index: 30;
  background: var(--base);
  border-radius: var(--radius-md);
  box-shadow: var(--neo-float);
  padding: 12px; display: none;
  animation: popDown 0.2s var(--ease) both;
  transform-origin: top center;
}
.select.open .select-panel { display: block; }
@keyframes popDown { 
  0% { opacity: 0; transform: scaleY(0.95) translateY(-5px); } 
  100% { opacity: 1; transform: none; } 
}

.option {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  transition: all 0.2s var(--ease);
}
.option:hover { color: var(--ink); background: rgba(255,255,255,0.02); }
.option .box {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--base);
  box-shadow: var(--neo-in);
  color: #fff;
  display: grid; place-items: center; flex: none;
  transition: all 0.2s var(--ease);
}
.option .box svg { opacity: 0; transform: scale(0.5); transition: all 0.2s var(--ease); }
.option.checked { color: #fff; }
.option.checked .box { box-shadow: var(--neo-out); }
.option.checked .box svg { opacity: 1; transform: scale(1); }

/* ── Segmented yes/no ── */
.segment { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.seg-opt {
  cursor: pointer; text-align: center; padding: 18px;
  border-radius: var(--radius-md);
  background: var(--base);
  font-weight: 600; font-size: 14px; color: var(--ink-soft);
  box-shadow: var(--neo-out);
  transition: all 0.2s var(--ease);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.seg-opt:hover { box-shadow: var(--neo-out-hover); color: var(--ink); }
.seg-opt.active {
  color: #fff; box-shadow: var(--neo-in);
}

/* ── Alerts ── */
.alert {
  border-radius: var(--radius-md);
  padding: 18px 22px; font-size: 13.5px; line-height: 1.6; margin-bottom: 28px;
  background: var(--base);
  box-shadow: var(--neo-in);
  color: var(--ink-soft);
  display: flex; gap: 16px; align-items: flex-start;
}
.alert b { color: #fff; font-weight: 600; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert svg { flex: none; margin-top: 2px; color: #fff; }
.alert code, .subtle code {
  font-family: monospace; font-size: 0.9em;
  background: var(--base); padding: 4px 8px; border-radius: 6px; color: #fff;
  box-shadow: var(--neo-out);
}

.fieldnote { font-size: 12px; color: #fff; margin-top: 10px; font-weight: 600; text-shadow: 0 0 4px rgba(255,255,255,0.2); }

.divider { height: 2px; background: rgba(0,0,0,0.3); box-shadow: 0 1px 1px rgba(255,255,255,0.03); margin: 36px 0; border: none; }

/* ── Success ── */
.success { text-align: center; padding: 24px 0 16px; }
.success .badge {
  width: 88px; height: 88px; margin: 0 auto 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: var(--base);
  box-shadow: var(--neo-out);
  position: relative;
}
.success .badge::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  box-shadow: var(--neo-in); pointer-events: none;
}
.success h2 { margin: 0 0 12px; font-family: var(--display); font-weight: 700; font-size: 30px; }
.success p { color: var(--ink-soft); font-size: 15px; line-height: 1.7; margin: 0 auto 36px; max-width: 440px; }

/* Helper text */
.subtle { font-size: 13px; color: var(--ink-faint); text-align: center; margin-top: 24px; line-height: 1.6; font-weight: 500; }
.subtle a { color: var(--ink-soft); text-decoration: none; box-shadow: 0 1px 0 var(--ink-soft); }
.subtle a:hover { color: #fff; box-shadow: 0 1px 0 #fff; }

.spin-sm {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--base);
  box-shadow: var(--neo-out);
  position: relative;
  animation: pulse-ring 2s infinite ease-in-out;
}
.spin-sm::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: #fff;
  animation: spin 1s linear infinite;
}

@media (max-width: 600px) {
  .app { padding: 24px 16px 32px; }
  .card { padding: 36px 24px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
