:root {
  --blue: #1b4ba3;
  --blue-deep: #12357a;
  --blue-soft: #e6f1fc;
  --sky: #cfe7fb;
  --red: #e3262e;
  --red-soft: #fde8e9;
  --ink: #15233f;
  --muted: #5d6b85;
  --line: #d3e1f2;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(18, 53, 122, .06), 0 10px 30px -12px rgba(18, 53, 122, .25);
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.5;
  background:
    radial-gradient(1200px 600px at 50% -200px, #ffffff 0%, transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, #eaf4fd 40%, #f6faff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

.page { max-width: 920px; margin: 0 auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); }

/* --- шапка с названием --- */
.hero { text-align: center; padding: 34px 12px 30px; margin-bottom: 8px; }
.hero__kicker { margin: 0 0 14px; color: var(--blue-deep); font-weight: 700; font-size: clamp(.95rem, 2.4vw, 1.15rem); line-height: 1.35; }
.hero__kicker::after { content: ""; display: block; width: 90px; height: 4px; margin: 14px auto 0; border-radius: 4px; background: linear-gradient(90deg, var(--red) 0 50%, var(--blue) 50% 100%); }
.hero__title { margin: 0; line-height: 1; }
.hero__main { display: block; color: var(--blue); font-weight: 900; font-style: italic; letter-spacing: -.03em; font-size: clamp(2.4rem, 9vw, 4.6rem); }
.hero__sub { display: block; margin-top: .25em; color: var(--blue); font-weight: 800; font-style: italic; letter-spacing: -.02em; font-size: clamp(1.4rem, 5vw, 2.6rem); }
.hero__sub::before { content: ""; display: block; width: min(70%, 420px); height: 6px; margin: 0 auto .35em; border-radius: 50%; background: var(--red); transform: rotate(-2deg); }
.hero__place { margin: 18px 0 0; color: var(--muted); font-weight: 600; }

/* --- два окна --- */
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.switch__card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px 20px; border-radius: var(--radius); border: 2px solid transparent;
  background: rgba(255, 255, 255, .75); box-shadow: var(--shadow); cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.switch__card:hover { transform: translateY(-2px); background: #fff; }
.switch__card:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.switch__card[aria-selected="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.switch__icon {
  flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--blue-soft);
}
.switch__icon svg { width: 30px; height: 30px; fill: var(--blue); }
.switch__icon .ink { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.switch__icon .dot { fill: #fff; }
.switch__card[aria-selected="true"] .switch__icon { background: rgba(255, 255, 255, .16); }
.switch__card[aria-selected="true"] .switch__icon svg { fill: #fff; }
.switch__card[aria-selected="true"] .switch__icon .ink { stroke: var(--red); }
.switch__card[aria-selected="true"] .switch__icon .dot { fill: var(--red); }
.switch__text strong { display: block; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.switch__text span { display: block; font-size: .9rem; opacity: .8; }

/* --- панель --- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; position: relative; overflow: hidden; }
.panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--blue) 0 50%, var(--red) 50% 100%);
}
.panel__head h2 { margin: 0 0 6px; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.15; color: var(--blue); font-weight: 800; letter-spacing: -.02em; }
.panel__head p { margin: 0 0 20px; color: var(--muted); max-width: 62ch; }
.req { color: var(--red); font-weight: 700; }

/* --- анонимный вопрос --- */
.ask textarea {
  width: 100%; min-height: 160px; resize: vertical; padding: 16px 18px; border-radius: 16px;
  border: 2px solid var(--line); background: #f8fbff; font-size: 1.05rem; line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.ask textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.ask__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ask__count { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.trap { position: absolute; left: -9999px; }

/* --- кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border: 0; border-radius: 999px; background: var(--red); color: #fff;
  font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(227, 38, 46, .7);
  transition: transform .12s ease, background .15s ease;
}
.btn:hover { background: #c81d25; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn--big { padding: 16px 34px; font-size: 1.1rem; }
.btn--ghost { background: transparent; color: var(--blue); border: 2px solid var(--blue); box-shadow: none; }
.btn--ghost:hover { background: var(--blue-soft); }

.form-msg { margin: 12px 0 0; min-height: 1.5em; font-weight: 600; }
.form-msg.ok { color: #1a7f4b; }
.form-msg.err { color: var(--red); }

/* --- опрос --- */
.q { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
.q legend { padding: 0; font-weight: 700; font-size: 1.08rem; margin-bottom: 4px; }
.q__hint { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.q legend + .q__opts { margin-top: 10px; }
.q.invalid legend { color: var(--red); }
.q.invalid .opt, .q.invalid select { border-color: #f3a7aa; }

.q__opts { display: grid; gap: 8px; }
.q__opts--row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.q__opts--emoji { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.q__opts--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.opt { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 2px solid var(--line); border-radius: 14px; background: #f8fbff; cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover { border-color: #9dbbe3; background: #fff; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__box { flex: none; width: 22px; height: 22px; border: 2px solid #9fb3d1; border-radius: 6px; display: grid; place-items: center; background: #fff; transition: all .12s; }
.opt--radio .opt__box { border-radius: 50%; }
.opt__box::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.opt--radio .opt__box::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.opt:has(input:checked) .opt__box { background: var(--blue); border-color: var(--blue); }
.opt:has(input:checked) .opt__box::after { opacity: 1; }
.opt:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.opt:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* кнопочные варианты (без галочки) */
.opt--chip { justify-content: center; text-align: center; padding: 14px 10px; font-weight: 600; }
.opt--chip .opt__box { display: none; }
.opt--chip:has(input:checked) { background: var(--blue); color: #fff; }
.opt--emoji { flex-direction: column; gap: 2px; padding: 12px 6px; }
.opt__emoji { font-size: 2rem; line-height: 1.1; }
.opt__name { font-size: .8rem; color: var(--muted); font-weight: 600; }
.opt--chip:has(input:checked) .opt__name { color: rgba(255, 255, 255, .85); }

.other-input { margin: 8px 0 0 34px; width: calc(100% - 34px); padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.other-input:focus { outline: none; border-color: var(--blue); }

.select-wrap { position: relative; max-width: 520px; }
.select-wrap select {
  width: 100%; appearance: none; padding: 14px 44px 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: #f8fbff; cursor: pointer;
}
.select-wrap select:focus { outline: none; border-color: var(--blue); }
.select-wrap::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border: solid var(--blue); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }

.survey__submit { border-top: 1px solid var(--line); padding-top: 22px; }

.thanks { text-align: center; padding: 30px 10px 10px; }
.thanks__heart svg { width: 64px; height: 64px; fill: var(--red); animation: beat 1.6s ease-in-out infinite; }
.thanks h2 { margin: 10px 0 4px; color: var(--blue); font-size: 1.8rem; }
.thanks p { color: var(--muted); margin: 0 0 20px; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } }

.foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 22px; }
.foot p { margin: 0; }

@media (max-width: 640px) {
  .page { padding: 12px 12px 28px; }
  .hero { padding: 22px 6px 20px; }
  .switch { gap: 10px; }
  .switch__card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .switch__icon { width: 44px; height: 44px; border-radius: 13px; }
  .switch__icon svg { width: 26px; height: 26px; }
  .switch__text strong { font-size: 1.05rem; }
  .switch__text span { font-size: .8rem; }
  .panel { padding: 22px 16px; border-radius: 16px; }
  .q__opts--grid { grid-template-columns: repeat(2, 1fr); }
  .q__opts--row { grid-template-columns: 1fr; }
  .opt__emoji { font-size: 1.7rem; }
  .q__opts--emoji { gap: 6px; }
  .opt--emoji { padding: 10px 2px; }
  .opt__name { font-size: .7rem; line-height: 1.2; }
  .ask__row .btn, .survey__submit .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.other-input--full { margin-left: 0; width: 100%; }
.q__opts > div { min-width: 0; }
.opt__name { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
@media (max-width: 380px) { .opt__name { font-size: .64rem; } }
.nowrap { white-space: nowrap; }
