:root {
  --bg: #1e40af;
  --bg2: #3b82f6;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-dark: #1d4ed8;
  --line: #cbd5e1;
  --danger: #b42318;
  --ok: #1a7f37;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  /* бело-синий градиент: сверху белый, к низу насыщенный синий */
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 35%, #93c5fd 70%, #2563eb 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.45;
}

.page { max-width: 1040px; margin: 0 auto; padding: 28px 16px 48px; }

.top { text-align: center; color: var(--bg); margin-bottom: 24px; }
.top .brand { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; color: var(--accent-dark); }
.top h1 { margin: 8px 0 6px; font-size: clamp(22px, 4vw, 34px); }
.top .sub { margin: 0; font-weight: 600; opacity: .9; }

.quiz { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px;
  border: 1px solid rgba(37, 99, 235, .12);
  box-shadow: 0 10px 30px rgba(30, 64, 175, .18);
}

.foot { margin-top: 20px; padding: 18px 24px; text-align: center; font-size: 13px; color: var(--muted); }
.foot p { margin: 0 0 6px; }
.foot p:last-child { margin: 0; }
.foot a { color: var(--accent-dark); }

.side h2 { margin: 0 0 16px; font-size: 20px; text-align: center; }
.hero svg, .hero img { width: 100%; height: auto; display: block; border-radius: 14px; }
.hero img { max-height: 420px; object-fit: cover; }
.muted { color: var(--muted); }
.side .muted { margin: 16px 0 0; text-align: center; }

.bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-bottom: 20px; }
.bar span { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }

.qnum { font-weight: 700; color: var(--accent-dark); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.qtext { margin: 6px 0 18px; font-size: 20px; line-height: 1.3; }
.center { text-align: center; }

.options { display: grid; gap: 10px; }

.opt {
  font: inherit;
  text-align: center;
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  transition: border-color .15s, transform .05s, background .15s;
}
.opt:hover { border-color: var(--accent); }
.opt:active { transform: scale(.99); }
.opt.selected { border-color: var(--accent-dark); background: #e8f0ff; }

.link {
  margin-top: 16px;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 4px 0;
}
.link:hover { color: var(--ink); text-decoration: underline; }

.form { display: grid; gap: 12px; }
.form input[type=text],
.form input[type=email],
.form input[type=tel],
.login input[type=password] {
  font: inherit;
  width: 100%;
  padding: 12px 4px;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: transparent;
  outline: none;
}
.form input:focus, .login input:focus { border-bottom-color: var(--accent-dark); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 4px; }
.consent input { margin-top: 3px; }
.consent a { color: var(--accent-dark); }

.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn:hover { background: #000; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.danger { background: var(--danger); }

.err { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 14px; }

.success { padding: 24px 0; }
.success .check {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 50%; background: var(--ok); color: #fff;
  display: grid; place-items: center; font-size: 34px;
}
.success .ok { color: var(--ok); }

/* Админка */
body.admin { background: #eff4ff; }
.admin-wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-bar h2 { margin: 0; }
.lead { margin-bottom: 14px; padding: 18px 20px; }
.lead-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lead-contacts { margin: 6px 0 10px; }
.lead-answers { margin: 0 0 12px; padding-left: 20px; font-size: 14px; }
.lead-answers li { margin-bottom: 6px; }
.login { max-width: 360px; margin: 15vh auto 0; display: grid; gap: 14px; }
.login h2 { margin: 0; }

@media (max-width: 760px) {
  .quiz { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}