:root {
  --night: #08090d;
  --night-soft: #11121a;
  --ink: #f3efe7;
  --muted: #a3a0a8;
  --ember: #c84d38;
  --gold: #c9a96d;
  --card: #15161e;
  --line: #30303a;
  --field: #1b1c25;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% -10%, #302028 0, #12131a 32%, var(--night) 68%);
  color: var(--ink);
  font: 16px/1.58 Inter, Arial, sans-serif;
}

header {
  width: 100%;
  max-width: 540px;
  height: 58px;
  margin: auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ffffff12;
}
.brand { color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-decoration: none; }
#saveState { color: var(--muted); font-size: 13px; }
main { width: 100%; max-width: 540px; margin: auto; padding: 22px 20px 72px; }

.landing { text-align: center; }
.sigil {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 2px auto 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #d5b77d, #6d392f 48%, #15151c 50%);
  box-shadow: 0 0 0 1px #d3ad6855, 0 0 48px #b8473438;
}
.sigil::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #090a0e;
  box-shadow: inset -12px -4px 22px #bd46352d;
}
.sigil span {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--gold), transparent);
}
.small-sigil { width: 82px; height: 82px; margin-top: 18px; }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

h1 {
  margin: 18px 0 26px;
  font: 400 clamp(44px, 13vw, 68px)/.92 Georgia, serif;
  letter-spacing: -.045em;
}
.landing h1 { margin: 24px 0 28px; font-size: clamp(58px, 18vw, 82px); line-height: .74; }
.landing h1 em { color: var(--ember); font-weight: 400; }
h2 { margin: 12px 0 20px; font: 400 clamp(30px, 9vw, 44px)/1.05 Georgia, serif; }
.lead { max-width: 440px; margin: 0 auto 24px; color: #cfccd0; font-size: 18px; line-height: 1.52; }

button {
  appearance: none;
  width: 100%;
  min-height: 56px;
  padding: 17px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--ember);
  box-shadow: 0 14px 34px #8e2d243b;
  color: #fff;
  cursor: pointer;
  font: 700 16px/1.3 Inter, Arial, sans-serif;
}
.primary { display: flex; align-items: center; justify-content: space-between; }
.primary span { font-size: 23px; font-weight: 400; }
button.secondary { border: 1px solid #4a4951; background: transparent; box-shadow: none; color: var(--ink); }
.duration { margin: 13px 0 34px; color: var(--muted); font-size: 12px; letter-spacing: .06em; }

.method {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 15px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.method-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font: 20px Georgia, serif;
}
.method h2 { margin: 2px 0 10px; color: var(--gold); font: 800 11px Inter, Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.method p { margin: 0 0 10px; color: #b8b5bb; font-size: 14px; }
.method p:last-child { margin: 0; }
.author { margin-top: 22px; color: var(--muted); font-size: 13px; }

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #191a23, #12131a);
  box-shadow: 0 18px 50px #0005;
  text-align: left;
}
.card > label { display: block; margin-top: 18px; }
.actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 25px; }
.actions button { width: 100%; }

.path { display: grid; grid-template-columns: 1fr; gap: 9px; }
.module { padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #111219; color: var(--muted); }
.module b { width: 26px; height: 26px; margin-right: 8px; display: inline-grid; place-items: center; border: 1px solid #44434b; border-radius: 50%; font-size: 12px; }
.module.done { background: #25222a; color: #fff; }
.module.current { border-color: var(--ember); box-shadow: inset 3px 0 var(--ember); color: #fff; }
.progress { height: 4px; margin: 13px 0 30px; overflow: hidden; border-radius: 10px; background: #282832; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); }

textarea, input, select {
  width: 100%;
  margin-top: 6px;
  padding: 14px 15px;
  border: 1px solid #3a3942;
  border-radius: 8px;
  outline: none;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}
textarea:focus, input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #c9a96d18; }
textarea { min-height: 170px; resize: vertical; }
.options { display: grid; gap: 9px; }
.option { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #13141b; }
.option input { width: auto; margin-top: 5px; accent-color: var(--ember); }
.meta { color: var(--muted); font-size: 13px; }
.question { width: 100%; }
.projects { display: grid; gap: 16px; }
.project h3 { margin: 0 0 16px; font-size: 22px; }
.project label { display: block; margin-top: 13px; }
.project textarea { min-height: 96px; }
.consent { margin-top: 20px !important; }
.question > .card h2 { font-size: 31px; }

@media (min-width: 700px) {
  body { padding: 20px 0; }
  header, main { border-left: 1px solid #ffffff0c; border-right: 1px solid #ffffff0c; }
  main { min-height: calc(100vh - 98px); }
}

/* Messenger-first entry flow */
.channel-card { margin: 28px 0 20px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #12131a; text-align: left; }
.channel-card h2 { margin: 0 0 8px; font-size: 23px; }
.channel-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.channel-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; margin-top: 10px; padding: 14px 16px; border: 1px solid #3b3b45; border-radius: 10px; text-decoration: none; font-weight: 800; text-align: center; }
.channel-button.telegram { background: #eaeaf0; color: #111219; }
.channel-button.max { background: #1b1c25; color: #eee; }
.channel-button:disabled { opacity: .48; cursor: not-allowed; }
.channel-button small { margin-left: 8px; font-weight: 500; opacity: .75; }
.consent-list { display: grid; gap: 10px; }
.consent-list .option { margin: 0 !important; }
.consent-list .optional { opacity: .78; }
