:root {
  color-scheme: dark;
  --ink: #18231c;
  --ink-2: #202e25;
  --panel: #233328;
  --line: rgba(250, 248, 242, 0.14);
  --line-strong: rgba(250, 248, 242, 0.26);
  --cream: #faf8f2;
  --sage: #c3d0c4;
  --muted: #93a596;
  --accent: #cfe3c8;
  --accent-ink: #17241b;
  --danger: #e8a1a1;
  --radius: 18px;
  --bar-height: 54px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

/* ---------------------------------------------------------------- верхняя панель */
.bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--bar-height);
  padding: max(6px, env(safe-area-inset-top)) 14px 6px;
  background: var(--ink);
  border-bottom: 1px solid rgba(250, 248, 242, 0.10);
  position: relative;
  z-index: 5;
}
.wordmark { text-decoration: none; color: inherit; display: grid; gap: 0; line-height: 1.15; }
.wordmark-line {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark-sub {
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}
.bar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(250, 248, 242, 0.04);
  color: var(--cream);
}
.icon-btn:active { background: rgba(250, 248, 242, 0.12); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--ink);
}
.pill-btn {
  height: 38px;
  padding: 0 17px;
  border: 0;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pill-btn:active { transform: scale(0.97); }

/* -------------------------------------------------------------------------- сайт */
.stage { position: relative; flex: 1 1 auto; min-height: 0; background: #202822; }
.site { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #202822; }

.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--ink);
  transition: opacity 320ms ease;
  z-index: 3;
}
.loader.is-hidden { opacity: 0; pointer-events: none; }
.loader-mark {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.loader-line { width: 128px; height: 2px; border-radius: 99px; background: rgba(250, 248, 242, 0.16); overflow: hidden; }
.loader-line span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--cream);
  animation: load 1.1s ease-in-out infinite;
}
.loader-note { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
@keyframes load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* --------------------------------------------------------------------- шторка */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(8, 12, 9, 0.58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 240ms ease;
}
.backdrop.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 21;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: var(--ink-2);
  box-shadow: 0 -24px 60px -20px #000;
  transform: translate(-50%, 104%);
  transition: transform 300ms cubic-bezier(0.22, 0.8, 0.28, 1);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet-grab {
  width: 42px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: rgba(250, 248, 242, 0.24);
}
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--sage);
  font-size: 14px;
  line-height: 1;
}
.sheet-body { padding-top: 2px; }
.sheet h1 { font-size: 22px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -0.02em; }
.sheet h2 { font-size: 20px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.015em; }
.sheet .lead { margin: 0 0 18px; color: var(--sage); font-size: 14.5px; }
.sheet .fine { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
.sheet .fine a { color: var(--sage); }

.choice { display: grid; gap: 10px; }
.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  padding: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(250, 248, 242, 0.035);
  color: var(--cream);
}
.choice-card:active { background: rgba(250, 248, 242, 0.09); }
.choice-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(207, 227, 200, 0.13);
  color: var(--accent);
}
.choice-icon svg { width: 19px; height: 19px; }
.choice-text { display: grid; gap: 2px; }
.choice-text b { font-size: 15px; font-weight: 600; }
.choice-text span { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* ---------------------------------------------------------------------- формы */
.form { display: grid; gap: 12px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(10, 16, 12, 0.45);
  color: var(--cream);
  font-size: 16px;
  outline: none;
  appearance: none;
}
.field textarea { min-height: 84px; resize: vertical; }
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--sage) 50%), linear-gradient(135deg, var(--sage) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--line-strong); background-color: rgba(0, 0, 0, 0.25); }
.field input::placeholder, .field textarea::placeholder { color: #6f8174; }
.field-row { display: grid; gap: 12px; }
@media (min-width: 430px) { .field-row { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.btn:active { transform: scale(0.99); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary[disabled] { opacity: 0.55; transform: none; }
.btn-ghost { color: var(--sage); }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }

.consent { display: flex; align-items: flex-start; gap: 10px; color: var(--sage); font-size: 13px; line-height: 1.4; }
.consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.consent a { color: var(--accent); }

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #46604b;
  border-radius: 14px;
  background: rgba(70, 96, 75, 0.18);
  color: #dcefd8;
  font-size: 14px;
  margin-bottom: 14px;
}
.status-card .badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
}

.notice {
  padding: 12px 14px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(250, 248, 242, 0.04);
  color: var(--sage);
  font-size: 13.5px;
}
.notice b { color: var(--cream); font-weight: 600; }
.error-text { margin: 0; color: var(--danger); font-size: 13.5px; }
.error-text:empty { display: none; }

.success { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 22px 0 8px; }
.success-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(207, 227, 200, 0.14);
  color: var(--accent);
  font-size: 26px;
}
.success h2 { margin: 4px 0 0; }
.success p { margin: 0; color: var(--sage); font-size: 14px; max-width: 32ch; }
.success .btn { margin-top: 10px; width: 100%; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translate(-50%, 16px);
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #2c3e31;
  color: var(--cream);
  font-size: 13.5px;
  box-shadow: 0 10px 30px -10px #000;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .loader-line span { animation: none; width: 100%; }
  .sheet, .backdrop, .toast, .loader { transition-duration: 1ms; }
}
