/* Стиль Flora de Luxe: монохром, класичний антиквенний шрифт, тонкі лінії */
:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --text: #141414;
  --muted: #77726b;
  --line: #e4ddd3;
  --accent: #141414;
  --accent-ink: #ffffff;
  --gold: #b0915a;
  --star-off: #ddd6cb;
  --danger: #9b2c2c;
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="light"] { color-scheme: light; }
/* Темна тема: за налаштуванням пристрою або примусово через ?theme=dark (?theme=light вимикає) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0d;
    --surface: #171716;
    --text: #f2eee7;
    --muted: #a39d94;
    --line: #2f2d2a;
    --accent: #f2eee7;
    --accent-ink: #141414;
    --gold: #c9ab74;
    --star-off: #3a3733;
    --danger: #e08a8a;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .brand img { filter: invert(1); }
}
:root[data-theme="dark"] {
  --bg: #0e0e0d;
  --surface: #171716;
  --text: #f2eee7;
  --muted: #a39d94;
  --line: #2f2d2a;
  --accent: #f2eee7;
  --accent-ink: #141414;
  --gold: #c9ab74;
  --star-off: #3a3733;
  --danger: #e08a8a;
  color-scheme: dark;
}
:root[data-theme="dark"] .brand img { filter: invert(1); }

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 16px 56px;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 36px 24px 32px;
}
@media (min-width: 560px) { .card { padding: 44px 40px 40px; } }

/* Логотип */
.brand {
  display: block;
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.brand img { width: min(260px, 78%); height: auto; display: inline-block; }

h1 {
  font: 500 30px/1.15 var(--serif);
  letter-spacing: .01em;
  text-align: center;
  margin: 0 0 10px;
}
.muted { color: var(--muted); }
#subtitle { margin: 0 0 32px; text-align: center; }

/* Питання */
.q { border: 0; margin: 0 0 30px; padding: 0; min-width: 0; }
.q legend, .label {
  display: block;
  padding: 0;
  margin-bottom: 12px;
  font: 500 19px/1.3 var(--serif);
}
.req { color: var(--gold); }

/* Зірки: інпути в зворотному порядку, щоб ~ підсвічував лівіші */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  font-size: 34px; line-height: 1; color: var(--star-off);
  cursor: pointer; padding: 0 2px; user-select: none;
  transition: transform .1s, color .15s;
}
.stars label:hover, .stars label:hover ~ label,
.stars input:checked ~ label { color: var(--gold); }
.stars label:active { transform: scale(.9); }
.stars input:focus-visible + label { outline: 1px solid var(--accent); outline-offset: 2px; }
.stars__hint {
  display: block; min-height: 1.6em; margin-top: 2px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}

/* Шкала 0–10 і варіанти відповіді: радіокнопки, стилізовані як кнопки */
.scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.scale input, .choices input { position: absolute; opacity: 0; pointer-events: none; }
.scale label, .choices label {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.scale label { padding: 10px 0; text-align: center; font-size: 14px; font-weight: 500; }
@media (max-width: 380px) { .scale label { font-size: 13px; padding: 9px 0; } }
.choices label { padding: 12px 16px; }
.scale label:hover, .choices label:hover { border-color: var(--accent); }
.scale input:checked + label, .choices input:checked + label {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.scale input:focus-visible + label, .choices input:focus-visible + label { outline: 1px solid var(--accent); outline-offset: 2px; }
.scale__ends { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }

.demo-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 16px;
  padding: 4px 12px;
  border: 1px solid var(--gold);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}

textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  resize: vertical;
}
textarea::placeholder { color: var(--muted); }
textarea:focus { outline: none; border-color: var(--accent); }

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 13px/1 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn--ghost { background: transparent; color: var(--accent); }
.error { color: var(--danger); margin: 0 0 14px; text-align: center; }

/* Повідомлення (подяка, помилки) */
.message { text-align: center; padding: 8px 0 4px; }
.message__ornament { display: block; width: 48px; height: 1px; margin: 0 auto 22px; background: var(--gold); }
.message p { margin: 0; }
.message #msgExtra { margin-top: 28px; }
.signature { margin-top: 28px; font: italic 400 20px/1.2 var(--serif); color: var(--muted); }

/* Демо на головній: SMS як у телефоні + посилання на анкети */
.demo { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.demo h2 { font: 500 22px/1.2 var(--serif); text-align: center; margin: 0 0 6px; }
.demo > p { text-align: center; }
.tabs { display: flex; margin: 18px 0 14px; border: 1px solid var(--line); }
.tabs button {
  flex: 1;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.sms {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 2px;
  padding: 14px 16px;
  margin: 0 0 18px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.sms a { color: var(--text); text-underline-offset: 3px; }
