:root {
  color-scheme: dark;
  --void: #10081f;
  --panel: #1b112b;
  --cyan: #a8ffff;
  --ember: #ff4fa3;
  --muted: #d8c9e7;
  --line: rgba(204, 169, 238, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--void);
  color: #fff2fb;
  font-family: "Inter", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

::selection {
  color: var(--void);
  background: var(--cyan);
}

.ambient {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at 8% 17%,
      rgba(49, 23, 92, 0.4),
      transparent 38%
    ),
    radial-gradient(
      ellipse at 91% 27%,
      rgba(157, 31, 112, 0.19),
      transparent 35%
    ),
    radial-gradient(
      ellipse at 52% 100%,
      rgba(44, 25, 78, 0.32),
      transparent 42%
    ),
    var(--void);
}

.ambient::before,
.ambient::after {
  position: absolute;
  inset: -35%;
  content: "";
  opacity: 0.28;
  filter: blur(85px);
  transform: translate3d(0, 0, 0);
  animation: drift 22s ease-in-out infinite alternate;
  background: radial-gradient(
    ellipse at 42% 47%,
    rgba(102, 252, 241, 0.13),
    transparent 34%
  );
}

.ambient::after {
  animation-delay: -9s;
  animation-duration: 27s;
  background: radial-gradient(
    ellipse at 70% 43%,
    rgba(255, 79, 163, 0.12),
    transparent 32%
  );
}

.grain {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
}

.retro-grid {
  position: fixed;
  z-index: -1;
  right: -25%;
  bottom: -24vh;
  left: -25%;
  height: 70vh;
  pointer-events: none;
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(102, 252, 241, 0.17) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 79, 163, 0.13) 1px, transparent 1px);
  background-size: 100% 48px, 68px 100%;
  transform: perspective(430px) rotateX(59deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent 78%);
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.display-font {
  font-family: "Montserrat", sans-serif;
}

h1,
h2 {
  font-family: "Montserrat", sans-serif;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  line-height: 1.18 !important;
}

.glass {
  border: 1px solid rgba(210, 177, 244, 0.16);
  background: linear-gradient(
    145deg,
    rgba(45, 27, 68, 0.82),
    rgba(20, 11, 34, 0.78)
  );
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.eyebrow {
  color: var(--ember);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-title {
  max-width: 820px;
  font-size: clamp(2.8rem, 7.1vw, 5.7rem);
}

.hero-title-accent {
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.6px #66fcf1;
  text-shadow: none;
}

.form-step-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 1rem;
  color: #fff5ff;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.35;
}

.form-step-heading--project {
  margin-bottom: 1.25rem;
}

.step-number {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(168, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(168, 255, 255, 0.06);
  color: var(--cyan);
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.form-step-title {
  margin: 0;
  color: #fff5ff;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.35;
}

.text-glow {
  color: var(--ember);
  text-shadow:
    0 0 24px rgba(255, 79, 163, 0.28),
    0 0 58px rgba(255, 79, 163, 0.14);
}

.hero-synth-field {
  position: absolute;
  z-index: 0;
  inset-block: 0;
  left: 50%;
  overflow: hidden;
  width: 100vw;
  pointer-events: none;
  transform: translateX(-50%);
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 10%,
    #000 88%,
    transparent 100%
  );
}

.hero-synth-field::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(16, 8, 31, 0.62) 0%,
    rgba(16, 8, 31, 0.34) 42%,
    rgba(16, 8, 31, 0.06) 100%
  );
}

.hero-synth-field canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.72;
  pointer-events: none;
  touch-action: pan-y;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 79, 163, 0.22);
  border-radius: 999px;
  background: rgba(36, 17, 54, 0.72);
  padding: 11px 15px;
  color: #f2e6fb;
  font-size: 0.82rem;
  letter-spacing: 0.035em;
}

.text-slate-300 {
  color: #f1e7f8 !important;
}

.text-slate-400 {
  color: #cbbbdc !important;
}

.text-slate-500 {
  color: #a997bb !important;
}

.text-slate-600 {
  color: #927fa5 !important;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(102, 252, 241, 0.9);
  animation: pulse 1.8s ease-in-out infinite;
}

.panel-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(
    145deg,
    rgba(34, 20, 52, 0.88),
    rgba(19, 11, 33, 0.9)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 26px 80px rgba(4, 1, 12, 0.32);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.field-control {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(201, 169, 240, 0.2);
  border-radius: 13px;
  outline: none;
  background: rgba(14, 8, 27, 0.72);
  padding: 14px 15px;
  color: #fff2fb;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease,
    transform 220ms ease;
}

.field-control::placeholder {
  color: #a18db5;
}

.field-control:hover {
  border-color: rgba(102, 252, 241, 0.48);
}

.field-control:focus {
  border-color: var(--cyan);
  background: rgba(18, 11, 32, 0.94);
  box-shadow:
    0 0 0 3px rgba(102, 252, 241, 0.11),
    0 0 26px rgba(102, 252, 241, 0.14);
  transform: translateY(-1px);
}

.field-control[aria-invalid="true"] {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(255, 79, 163, 0.18);
}

select.field-control {
  color: #f7eefe;
}

select.field-control:invalid {
  color: #a18db5;
}

select.field-control option {
  background: #1b112b;
  color: #fff2fb;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #fff5ff;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.field-hint {
  margin-top: 7px;
  color: #c3b1d3;
  font-size: 0.7rem;
  line-height: 1.5;
}

.role-choice {
  position: relative;
  display: flex;
  min-height: 155px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 240, 0.16);
  border-radius: 19px;
  background: rgba(18, 9, 31, 0.68);
  padding: 18px;
  transition:
    border-color 240ms ease,
    transform 240ms ease,
    background 240ms ease,
    box-shadow 240ms ease;
}

.role-choice:hover {
  border-color: rgba(102, 252, 241, 0.43);
  transform: translateY(-3px);
}

.role-choice:has(input:checked) {
  border-color: rgba(102, 252, 241, 0.74);
  background: linear-gradient(
    145deg,
    rgba(102, 252, 241, 0.1),
    rgba(11, 15, 20, 0.75) 70%
  );
  box-shadow:
    0 0 0 1px rgba(102, 252, 241, 0.1),
    0 0 34px rgba(102, 252, 241, 0.1);
}

.role-choice[data-tone="ember"]:has(input:checked) {
  border-color: rgba(255, 107, 187, 0.82);
  background: linear-gradient(
    145deg,
    rgba(255, 79, 163, 0.15),
    rgba(18, 9, 31, 0.86) 70%
  );
  box-shadow:
    0 0 0 1px rgba(255, 79, 163, 0.12),
    0 0 34px rgba(255, 79, 163, 0.14);
}

.role-choice:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.role-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.role-choice:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.52;
}

.role-counter {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.role-counter[data-tone="ember"] {
  color: #ff72c0;
}

.role-counter.is-critical {
  animation: counter-flash 1.2s ease-in-out infinite;
}

.checklist-item input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.checklist-item > span {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(201, 169, 240, 0.17);
  border-radius: 999px;
  background: rgba(18, 9, 31, 0.68);
  padding: 8px 12px;
  color: #d8c9e7;
  font-size: 0.72rem;
  transition: 180ms ease;
}

.checklist-item > span::before {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid rgba(201, 169, 240, 0.42);
  border-radius: 4px;
  content: "";
  transition: 180ms ease;
}

.checklist-item:has(input:checked) > span {
  border-color: rgba(102, 252, 241, 0.48);
  background: rgba(102, 252, 241, 0.08);
  color: #e8fffd;
}

.checklist-item:has(input:checked) > span::before {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: inset 0 0 0 3px #142127;
}

.checklist-item:focus-within > span {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.url-wrap {
  position: relative;
}

.url-wrap .field-control {
  padding-right: 48px;
}

.url-check {
  position: absolute;
  top: 50%;
  right: 15px;
  color: var(--cyan);
  font-size: 1rem;
  opacity: 0;
  transform: translateY(-50%) scale(0.7);
  transition: 180ms ease;
}

.url-wrap.is-valid .url-check {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  text-shadow: 0 0 12px rgba(102, 252, 241, 0.6);
}

.branch-panel {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 280ms ease,
    margin 280ms ease;
}

.branch-panel[hidden] {
  display: grid;
  grid-template-rows: 0fr;
  margin-block: 0;
  opacity: 0;
  pointer-events: none;
}

.branch-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.cta-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition:
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease;
  will-change: transform;
}

.cta-button::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 12%,
    rgba(255, 255, 255, 0.2),
    transparent 82%
  );
  content: "";
  opacity: 0;
  transform: translateX(-90%);
  transition:
    transform 650ms ease,
    opacity 250ms ease;
}

.cta-button:hover::before {
  opacity: 1;
  transform: translateX(90%);
}

.cta-button:focus-visible,
.community-link:focus-visible,
.faq-trigger:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.cta-button:disabled {
  cursor: wait;
  opacity: 0.77;
}

/* Увеличенная зона нажатия для текстовых ссылок навигации */
.nav-link {
  padding-block: 10px;
}

.faq-item {
  border-top: 1px solid rgba(204, 169, 238, 0.16);
}

.faq-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 0;
  background: transparent;
  padding: 20px 0;
  color: #fff2fb;
  text-align: left;
  cursor: pointer;
}

.faq-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(102, 252, 241, 0.26);
  border-radius: 50%;
  color: var(--cyan);
  transition:
    transform 260ms ease,
    background-color 260ms ease;
}

.faq-trigger[aria-expanded="true"] .faq-icon {
  background: rgba(102, 252, 241, 0.1);
  transform: rotate(45deg);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 320ms ease,
    opacity 220ms ease;
}

.faq-answer.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.faq-answer > div {
  overflow: hidden;
}

.faq-answer p {
  margin: 0;
  padding: 0 42px 19px 0;
  color: #cbbbdc;
  font-size: 0.88rem;
  line-height: 1.7;
}

.community-link {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    filter 220ms ease;
}

.community-link:hover {
  filter: brightness(1.13);
  transform: translateY(-3px);
}

.telegram-link {
  border-color: rgba(42, 171, 238, 0.55);
  background: linear-gradient(135deg, #2aabee, #168acb);
  color: #fff;
  box-shadow: 0 10px 30px rgba(42, 171, 238, 0.2);
}

.telegram-link:hover {
  box-shadow: 0 12px 34px rgba(42, 171, 238, 0.38);
}

.vk-link {
  border-color: rgba(39, 135, 245, 0.48);
  background: linear-gradient(135deg, #2787f5, #1765c4);
  color: #fff;
  box-shadow: 0 10px 28px rgba(39, 135, 245, 0.18);
}

.vk-link:hover {
  box-shadow: 0 12px 34px rgba(39, 135, 245, 0.34);
}

.toast {
  position: fixed;
  z-index: 50;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 40px));
  border: 1px solid rgba(102, 252, 241, 0.42);
  border-radius: 20px;
  background: rgba(25, 13, 40, 0.94);
  padding: 18px;
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.45),
    0 0 42px rgba(102, 252, 241, 0.12);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 280ms ease,
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.toast-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(205, 219, 231, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #f0e4f7;
  cursor: pointer;
}

.section-rule {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 252, 241, 0.3),
    rgba(255, 79, 163, 0.34),
    transparent
  );
}

.scroll-cue {
  writing-mode: vertical-rl;
}

@keyframes drift {
  from {
    transform: translate3d(-2%, -1%, 0) rotate(0deg);
  }
  to {
    transform: translate3d(2%, 2%, 0) rotate(8deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.72);
  }
}

@keyframes counter-flash {
  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 16px rgba(255, 79, 163, 0.45);
  }
  50% {
    opacity: 0.62;
    text-shadow: 0 0 4px rgba(255, 79, 163, 0.18);
  }
}

@media (max-width: 767px) {
  .page-shell {
    width: min(100% - 28px, 600px);
  }

  .hero-title {
    font-size: clamp(2.5rem, 12.4vw, 4.5rem);
  }

  .role-choice {
    min-height: 138px;
    padding: 15px;
  }

  /* Размытие подложки на больших панелях дорого при скролле,
     а фон панелей и так почти непрозрачный — визуально почти незаметно. */
  .panel-card,
  .toast,
  .glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Фоновые слои фиксированы и анимируются постоянно:
     уменьшаем радиус размытия и останавливаем дрейф. */
  .ambient::before,
  .ambient::after {
    filter: blur(40px);
    animation: none;
  }
}

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