/* Песочница: тихая тёмная сцена, как в приложении NURA; цвет посетителя — в --accent. */
:root {
  color-scheme: dark;
  --accent: #ffffff;
  --bg: #08080a;
  --surface: #121215;
  --line: #ffffff1f;
  --text: #f4f4f6;
  --muted: #a9a9b2;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(70rem 40rem at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.page {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px) 64px;
  align-items: start;
}
h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  text-wrap: balance;
}
h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 32px; max-width: 38ch; }
.muted { color: var(--muted); }

/* Анкета */
#config { display: grid; gap: 26px; }
.field { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, legend { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); padding: 0; margin-bottom: 10px; }
input:not([type]), input[name="business"], input[name="contact"], input[autocomplete="name"], textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s;
}
input::placeholder, textarea::placeholder { color: #75757e; }
input:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
textarea { resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { border-color: #ffffff4d; }
.chip[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: #fff;
}

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 11px 4px;
  cursor: pointer;
  border-radius: 10px;
}
.feature input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff24;
  position: relative;
  margin-top: 2px;
  transition: background 0.18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0006;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.feature input:checked + .switch { background: var(--accent); }
.feature input:checked + .switch::after { transform: translateX(16px); background: #0b0b0d; box-shadow: none; }
.feature input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 3px; }
.feature-text b { display: block; font-weight: 600; font-size: 15px; }
.feature-text small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.is-off .feature { cursor: not-allowed; opacity: 0.42; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  box-shadow: inset 0 0 0 1px #0003;
  padding: 0;
  position: relative;
}
.swatch[aria-pressed="true"], .swatch.custom.is-on { border-color: var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.swatch.custom { background: conic-gradient(#ff7a6b, #f5d36d, #8fd6a8, #7fb2ff, #c4a7ff, #ff7a6b); display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch.custom span { font-weight: 700; color: #111; pointer-events: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: #0b0b0d; border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }
.btn.quiet { color: var(--muted); }
.btn.quiet:hover { color: var(--text); border-color: #ffffff4d; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: progress; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }

.request { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
#request-form { display: grid; gap: 18px; margin-top: 18px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: 14px; color: var(--muted); }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 2px 0 0; }
.error { color: #ff9b91; margin: 0; min-height: 0; }
.error:empty { display: none; }
.sent { margin-top: 18px; }
.sent-title { font-size: 20px; margin: 0 0 6px; }

/* Телефоны */
.preview { position: sticky; top: 24px; display: grid; gap: 16px; justify-items: center; }
.roles {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.roles button { border: 0; background: transparent; border-radius: 999px; padding: 8px 18px; font-size: 14px; color: var(--muted); }
.roles button[aria-selected="true"] { background: #ffffff1c; color: #fff; }
.phones { display: flex; gap: 28px; justify-content: center; width: 100%; }
.phone { margin: 0; display: grid; gap: 10px; justify-items: center; }
.phone iframe {
  display: block;
  width: 360px;
  height: min(760px, calc(100vh - 120px));
  border: 0;
  border-radius: 34px;
  background: #000;
  box-shadow: 0 0 0 9px #1b1b1f, 0 0 0 10px #ffffff1a, 0 30px 80px #000c;
}
.phone figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.outside { max-width: 460px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.outside p { color: var(--muted); }
.status { min-height: 1.5em; margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.to-preview { display: none; }

/* Одно окно с переключателем, когда два не помещаются. */
@media (max-width: 1279px) {
  .roles { display: inline-flex; }
  .phones[data-show="client"] .phone[data-role="admin"], .phones[data-show="admin"] .phone[data-role="client"] { display: none; }
  .phone figcaption { display: none; }
}
@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; padding-bottom: 96px; }
  .preview { position: static; scroll-margin-top: 12px; }
  .phone, .phones { width: 100%; }
  .phone iframe { width: 100%; max-width: 420px; height: min(780px, calc(100svh - 90px)); border-radius: 28px; box-shadow: 0 0 0 1px #ffffff1f, 0 20px 50px #000a; }
  .to-preview {
    display: block;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    text-align: center;
    padding: 14px;
    border-radius: 999px;
    background: var(--accent);
    color: #0b0b0d;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 30px #000a;
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Страница заявок владельца */
.owner main { max-width: 760px; margin: 0 auto; padding: 40px 16px; }
.owner article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; margin: 16px 0; }
.owner article p { margin: 6px 0; }
.owner a { color: var(--text); }
