:root {
  --bg: #eef3f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --primary-soft: #e8f2fd;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.lang { display: flex; gap: 4px; }
.lang button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.lang button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; }

.progress { display: flex; gap: 6px; margin-bottom: 8px; }
.progress i { flex: 1; height: 6px; border-radius: 3px; background: #cdd8e6; }
.progress i.on { background: var(--primary); }
.stepname { font-size: 14px; color: var(--muted); margin-bottom: 10px; min-height: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px;
  padding: 5px 12px; font-size: 14px; font-weight: 600;
}

.card {
  background: var(--card); border-radius: 18px; padding: 20px 16px;
  box-shadow: 0 6px 24px rgba(15, 40, 80, 0.08);
}
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 16px; text-align: center; }
h2 { font-size: 16px; margin: 18px 0 8px; }

.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; cursor: pointer; min-height: 64px;
}
.opt:hover, .opt:focus-visible { border-color: var(--primary); outline: none; }
.opt .radio {
  flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #aab8ca;
}
.opt b { display: block; font-size: 17px; }
.opt span.sub { display: block; color: var(--muted); font-size: 14px; }

/* календарь */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { text-transform: capitalize; }
.cal-nav {
  width: 40px; height: 40px; border: 1px solid var(--line); background: #fff;
  border-radius: 50%; cursor: pointer; font-size: 18px;
}
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .wd { text-align: center; font-size: 13px; color: var(--muted); padding: 4px 0; }
.day {
  aspect-ratio: 1; min-height: 40px; border: 0; background: transparent; border-radius: 50%;
  cursor: pointer; font-size: 16px;
}
.day:disabled { color: #b4bfcd; cursor: default; }
.day:not(:disabled):hover { background: var(--primary-soft); }
.day.today { box-shadow: inset 0 0 0 1px var(--primary); }
.day.sel { background: var(--primary); color: #fff; font-weight: 700; }
.day.empty { visibility: hidden; }

/* время */
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 4px;
  cursor: pointer; font-weight: 600;
}
.time:not(:disabled):hover { border-color: var(--primary); }
.time:disabled { background: #f1f4f8; color: #a3afbf; cursor: default; font-weight: 400; }
.hint { color: var(--muted); font-size: 14px; margin: 12px 0 0; text-align: center; }

/* форма */
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
input[type="text"], input[type="tel"], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; min-height: 70px; }
.small { color: var(--muted); font-size: 13px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 16px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.check a { color: var(--primary-dark); }
.timer { background: var(--primary-soft); color: var(--primary-dark); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-bottom: 8px; text-align: center; }
input.code {
  font-size: 28px; letter-spacing: 8px; text-align: center; padding: 14px 8px;
}

.actions { display: flex; gap: 10px; margin-top: 22px; justify-content: space-between; align-items: center; }
.btn {
  border: 0; border-radius: 999px; padding: 13px 26px; background: var(--primary); color: #fff;
  font-weight: 700; cursor: pointer; min-height: 48px;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--primary-dark); padding-left: 8px; padding-right: 8px; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: var(--danger); }
.btn.wide { width: 100%; }
.link { background: none; border: 0; color: var(--primary-dark); cursor: pointer; text-decoration: underline; padding: 8px 0; }
.link:disabled { color: var(--muted); text-decoration: none; cursor: default; }

.error {
  background: var(--danger-soft); color: var(--danger); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px; font-size: 15px;
}
.error a { color: inherit; font-weight: 700; }

.ok-mark {
  width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 30px; margin: 0 auto 10px;
}
.facts { margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.facts > div { padding: 12px 14px; }
.facts > div + div { border-top: 1px solid var(--line); }
.facts small { display: block; color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.sr { position: absolute; left: -9999px; }

@media (min-width: 700px) {
  .wrap { padding-top: 28px; }
  .card { padding: 28px 32px; }
  .times { grid-template-columns: repeat(4, 1fr); }
  h1 { font-size: 26px; }
}
