/* Avlory public forms (respond.avlory.com): light, phone first, WCAG 2.2 AA. No inline styles (strict CSP). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin-var.woff2) format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/outfit-latin-var.woff2) format('woff2');
}

:root {
  /* Avlory brand (same names as avlory.com's style.css) */
  --p-base: #C700FF;
  --b-base: #2A65E5;
  --mix: #4942CF;
  /* Light page roles */
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --ink: #15171C;
  --muted: #4B5160; /* 8.0:1 on white */
  --faint: #5F6573; /* 5.9:1 on white */
  --line: #D5D8DE;
  --accent: #2A65E5; /* 5.0:1 with white text */
  --accent-soft: #EAF0FD;
  --ok: #0F7A5C;
  --ok-soft: #E3F4EE;
  --warn: #8A5300;
  --warn-soft: #FFF3DC;
  --error: #B42318;
  --error-soft: #FDECEA;
  --radius: 14px;
  --focus: 0 0 0 3px #FFFFFF, 0 0 0 6px #2A65E5;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.brandline { height: 4px; background: linear-gradient(90deg, var(--p-base), var(--b-base)); }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 640px; width: 100%; margin: 0 auto; padding: 14px 16px;
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; font: 600 18px/1 Outfit, Inter, sans-serif; letter-spacing: .01em; }
.bar-note { font-size: 13px; color: var(--faint); text-align: right; }
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 4px 16px 32px; outline: none; }
.foot { max-width: 640px; width: 100%; margin: 0 auto; padding: 16px; font-size: 13px; color: var(--faint); }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: none; box-shadow: var(--focus); border-radius: 8px;
}

h1 { font: 600 26px/1.2 Outfit, Inter, sans-serif; margin: 12px 0 4px; }
h2 { font: 600 20px/1.3 Outfit, Inter, sans-serif; margin: 8px 0 6px; }
.meta { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px;
}
.card h2, .card h3 { font: 600 16px/1.3 Inter, sans-serif; margin: 0 0 8px; }
.card ul { margin: 0; padding-left: 20px; }
.card p { margin: 6px 0; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--accent-soft); color: #1C4FBF;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }

label.field { display: block; font-weight: 600; margin: 10px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid #8A90A0; border-radius: 12px;
}
textarea { min-height: 140px; resize: vertical; }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true], fieldset[aria-invalid=true] .opt { border-color: var(--error); }
.code-input { letter-spacing: .5em; font: 600 24px/1 Inter, monospace; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 16px/1 Inter, sans-serif; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), opacity .15s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--accent); color: #fff; }
.btn.sec { background: #fff; color: var(--ink); border-color: #8A90A0; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: #fff; color: var(--error); border-color: var(--error); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.full { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.row .btn { flex: 1 1 140px; }

.progress { height: 8px; background: #E4E7EC; border-radius: 99px; overflow: hidden; margin: 6px 0 18px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--p-base), var(--b-base)); border-radius: 99px; }
.step-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .q-title { font: 600 20px/1.35 Inter, sans-serif; margin: 8px 0 4px; padding: 0; }
.req { color: var(--error); margin-left: 4px; }
.q-help { color: var(--muted); margin: 0 0 12px; }
.opt {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; margin: 0 0 8px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
}
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.scale { display: flex; flex-wrap: wrap; gap: 8px; }
.scale .opt { flex: 1 0 52px; justify-content: center; padding: 10px 6px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }
.grid-row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.grid-row legend { font-size: 16px; }
.rank { list-style: none; padding: 0; margin: 0; }
.rank li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; margin: 0 0 8px; min-height: 52px; }
.rank li span { flex: 1; }
.rank button { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 18px; cursor: pointer; }
.error { color: var(--error); font-weight: 600; margin: 8px 0 0; }
.error:empty { display: none; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.notice { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.icon-badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin: 16px 0 8px;
  font: 700 24px/1 Inter, sans-serif; background: var(--ok-soft); color: var(--ok);
}
.icon-badge.wait { background: var(--warn-soft); color: var(--warn); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 2px; }
.steps .done .dot { background: var(--ok); border-color: var(--ok); }
.steps .current .dot { border-color: var(--accent); background: var(--accent-soft); }
.steps .current { font-weight: 600; }
.steps small { display: block; color: var(--muted); font-weight: 400; }
.qa { border-top: 1px solid var(--line); padding: 10px 0; }
.qa small { display: block; color: var(--muted); }
.qa div { white-space: pre-wrap; }
.loading { padding: 40px 0; color: var(--muted); }
.bot { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 720px) {
  h1 { font-size: 30px; }
  main { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:active { transform: none; }
}
