/* Страница формы. Компоновка повторяет привычную по Google Формам: шапка с цветной
   полосой, вопрос — отдельная карточка, отправка внизу слева. */
:root {
  --accent: #673ab7;
  --page: color-mix(in srgb, var(--accent) 10%, #fff);
  --card: #fff;
  --ink: #202124;
  --ink-2: #5f6368;
  --line: #dadce0;
  --error: #d93025;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 14px/1.45 Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
.wrap { max-width: 770px; margin: 0 auto; padding: 12px 16px 96px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-top: 12px; position: relative;
}
.head { border-top: 10px solid var(--accent); padding-top: 22px; }
.head h1 { font-size: 30px; line-height: 1.25; font-weight: 400; margin: 0 0 12px; overflow-wrap: anywhere; }
.head p { margin: 0; white-space: pre-line; }
.head .legend { color: var(--error); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.q-title { font-size: 16px; line-height: 1.5; margin: 0 0 4px; overflow-wrap: anywhere; }
.q-help { color: var(--ink-2); font-size: 12px; margin: 0 0 4px; }
.req { color: var(--error); padding-left: 4px; }
.opts { margin-top: 12px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 9px 8px; margin: 0 -8px;
  border-radius: 4px; cursor: pointer; overflow-wrap: anywhere;
}
.opt:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.opt input {
  appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0;
  border: 2px solid var(--ink-2); border-radius: 50%; display: grid; place-content: center; cursor: pointer;
}
.opt input::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  transform: scale(0); transition: transform .12s;
}
.opt input:checked { border-color: var(--accent); }
.opt input:checked::before { transform: scale(1); }
.opt input:focus-visible, .field:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.field {
  width: 100%; max-width: 420px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  font: inherit; color: inherit; padding: 8px 0; margin-top: 12px; border-radius: 0;
}
.field:focus { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 7px; }
textarea.field { max-width: none; resize: none; overflow: hidden; min-height: 38px; }
select.field {
  border: 1px solid var(--line); border-radius: 4px; padding: 11px 12px; background: var(--card);
  max-width: 320px; cursor: pointer;
}
select.field:focus { border: 2px solid var(--accent); padding: 10px 11px; }
.card.bad { border-color: var(--error); }
.err { display: none; color: var(--error); font-size: 12px; margin-top: 12px; align-items: center; gap: 8px; }
.card.bad .err { display: flex; }
.err::before {
  content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--error);
  color: #fff; font-weight: 700; display: grid; place-content: center; font-size: 12px;
}
.actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 4px; padding: 10px 24px;
  font: 500 14px/1.2 inherit; font-family: inherit; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: default; }
.link { background: none; border: 0; color: var(--accent); font: 500 14px/1.2 inherit; font-family: inherit;
  cursor: pointer; padding: 10px 8px; border-radius: 4px; text-decoration: none; }
.link:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.progress { flex: 1 1 180px; display: flex; align-items: center; gap: 12px; justify-content: flex-end;
  color: var(--ink-2); font-size: 12px; min-width: 180px; }
.progress .track { flex: 1; max-width: 180px; height: 8px; border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 22%, #fff); overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.foot { color: var(--ink-2); font-size: 12px; text-align: center; margin-top: 20px; }
.foot p { margin: 4px 0; }
.banner { background: #fef7e0; border: 1px solid #f9ab00; border-radius: var(--radius); padding: 10px 16px;
  margin-top: 12px; }
.result { font-size: 16px; margin: 12px 0 0; }
.wrong { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.wrong h3 { font-size: 14px; font-weight: 500; margin: 0 0 6px; }
.wrong p { margin: 2px 0; color: var(--ink-2); }
.list a { display: block; padding: 12px 0; border-top: 1px solid var(--line); color: var(--accent);
  text-decoration: none; font-size: 16px; }
.list a:first-of-type { border-top: 0; }
.list h2 { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 16px 0 0; text-transform: none; }

/* Текст для программ, читающих страницу. Не display:none — иначе он выпал бы из
   текстового слоя страницы и из выделения при копировании. */
.sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
body.reveal .sr {
  position: static !important; width: auto; height: auto; margin: 6px 0 0; padding: 3px 6px; clip: auto;
  clip-path: none; white-space: normal; display: block; background: #fff3c4; border-radius: 4px;
  font-size: 12px; color: #5f370e; overflow: visible;
}
body.reveal .opt .sr { display: inline; margin: 0 0 0 6px; }
body.noselect .wrap { -webkit-user-select: none; user-select: none; }
body.noselect .field { -webkit-user-select: text; user-select: text; }

@media (max-width: 520px) {
  .wrap { padding: 8px 8px 80px; }
  .card { padding: 18px 16px; }
  .head h1 { font-size: 24px; }
  .field { font-size: 16px; }   /* мельче — и iOS увеличивает страницу при входе в поле */
  .progress { justify-content: flex-start; flex-basis: 100%; }
}
