:root {
  --bg: #f6f5f1; --card: #ffffff; --text: #1c1c1a; --muted: #5d5d57; --line: #c9c7bf;
  --accent: #1f4e79; --accent-text: #ffffff; --err: #b3261e; --err-bg: #fdecea;
  --note-bg: #fff6d6; --note-line: #d9b100; --focus: #0b63ce;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --card: #1e1e1c; --text: #ecebe6; --muted: #a9a79e; --line: #4a4943;
    --accent: #8ab8e6; --accent-text: #10202f; --err: #ff8a80; --err-bg: #3a1a18;
    --note-bg: #332b0a; --note-line: #b89600; --focus: #9cc7ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
main {
  max-width: 520px; margin: 0 auto; background: var(--card); min-height: 100vh;
  padding: 20px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.school { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.intro, .lang-note { color: var(--text); }
.lang-note { font-weight: 600; margin-top: 16px; }
.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
label, legend { display: block; font-weight: 600; margin: 0 0 4px; padding: 0; }
.opt { font-weight: 400; color: var(--muted); }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 6px; }
.center { text-align: center; margin-top: 10px; }
input[type=text], select, textarea {
  display: block; width: 100%; min-height: 50px; padding: 12px;
  font: inherit; font-size: 17px; color: var(--text); background: var(--card);
  border: 2px solid var(--line); border-radius: 8px; appearance: none; -webkit-appearance: none;
}
textarea { min-height: 96px; resize: vertical; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 22px, calc(100% - 15px) 22px; background-size: 7px 7px; background-repeat: no-repeat;
  padding-right: 40px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible,
.seg input:focus-visible + label, .choice input:focus-visible + label {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.has-error input[type=text], .has-error select, .has-error textarea { border-color: var(--err); }
.error { color: var(--err); font-weight: 600; margin: 6px 0 0; }
.summary, .notice { border-radius: 8px; padding: 12px; margin: 0 0 16px; }
.summary { background: var(--err-bg); border: 2px solid var(--err); }
.notice { background: var(--note-bg); border: 2px solid var(--note-line); }
.notice ul { margin: 6px 0; padding-left: 20px; }

/* «Да / Нет» — две крупные кнопки */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg input, .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label, .choice label {
  display: flex; align-items: center; min-height: 50px; margin: 0; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 8px; font-weight: 400; cursor: pointer;
}
.seg label { justify-content: center; font-weight: 600; }
.seg input:checked + label, .choice input:checked + label {
  border-color: var(--accent); background: var(--accent); color: var(--accent-text);
}
.choice { margin-bottom: 10px; position: relative; }
.choice label { display: block; }
.dup { border: 2px solid var(--note-line); background: var(--note-bg); border-radius: 8px; padding: 12px; }
.dup legend { padding: 0 6px; }

.check { display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; align-items: start; }
.check input { width: 28px; height: 28px; margin: 2px 0 0; accent-color: var(--accent); }
.check label { font-weight: 400; min-height: 48px; }
.check .error { grid-column: 1 / -1; }

.btn {
  display: block; width: 100%; min-height: 54px; padding: 14px; margin: 8px 0 0;
  font: inherit; font-size: 18px; font-weight: 700; text-align: center; text-decoration: none;
  color: var(--accent-text); background: var(--accent); border: 2px solid var(--accent); border-radius: 10px; cursor: pointer;
}
.btn-secondary { color: var(--accent); background: transparent; margin-top: 12px; }
.btn[disabled] { opacity: .6; }

.review { margin: 0 0 20px; border: 2px solid var(--line); border-radius: 8px; padding: 4px 12px; }
.review dt { color: var(--muted); font-size: 15px; margin-top: 10px; }
.review dd { margin: 0 0 10px; }
.review .big { font-size: 22px; font-weight: 700; line-height: 1.25; }

.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }
