/* ============================================================
   Инсандык Тест KG — общий стиль
   Палитра: чернильный индиго + шафран (солнце флага КР)
   ============================================================ */
:root {
  --ink: #23255a;
  --ink-soft: #4a4c7d;
  --paper: #f6f5f2;
  --card: #ffffff;
  --saffron: #e8a13d;
  --saffron-deep: #c9821b;
  --line: #e3e1da;
  --ok: #2f9e6e;
  --err: #d0453e;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3, .display {
  font-family: 'Rubik', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.015em;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 6px;
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-soft);
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--saffron);
}

/* --- Axis pairs: signature element --- */
.axes { display: grid; gap: 10px; margin: 26px 0; }
.axis {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
}
.axis b {
  font-family: 'Rubik', sans-serif;
  font-size: 17px;
  text-align: center;
  color: var(--ink);
}
.axis .bar {
  height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 50%, var(--saffron) 50%, var(--saffron) 100%);
  background-size: 200% 100%;
  animation: tug 5s ease-in-out infinite alternate;
}
.axis:nth-child(2) .bar { animation-delay: .7s; }
.axis:nth-child(3) .bar { animation-delay: 1.4s; }
.axis:nth-child(4) .bar { animation-delay: 2.1s; }
@keyframes tug {
  from { background-position: 12% 0; }
  to   { background-position: 88% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .axis .bar { animation: none; }
}

.hero h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.18;
  margin-top: 18px;
}
.hero h1 em { font-style: normal; color: var(--saffron-deep); }
.hero p.lead {
  margin-top: 12px;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.benefits { margin: 22px 0; display: grid; gap: 10px; }
.benefit {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 14.5px;
  display: flex; gap: 10px; align-items: flex-start;
}
.benefit .n {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  color: var(--saffron-deep);
  min-width: 20px;
}

.price-tag {
  display: flex; align-items: baseline; gap: 8px;
  margin: 6px 0 14px;
}
.price-tag .sum { font-family: 'Rubik', sans-serif; font-size: 26px; font-weight: 800; }
.price-tag .cur { color: var(--ink-soft); font-size: 14px; }

/* --- Buttons --- */
.btn {
  display: block;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 16.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.985); }
.btn.gold { background: var(--saffron); color: var(--ink); }
.btn.gold:active { background: var(--saffron-deep); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }

/* --- Forms --- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px; /* prevents iOS zoom */
  font-family: inherit;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--saffron);
  outline-offset: 1px;
  border-color: transparent;
}
.seg { display: flex; gap: 8px; }
.seg label {
  flex: 1; margin: 0;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: center;
  font-size: 15px; font-weight: 500; color: var(--ink);
  cursor: pointer;
}
.seg input { display: none; }
.seg input:checked + span { font-weight: 700; }
.seg label:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-top: 18px;
}

.msg-err { color: var(--err); font-size: 14px; margin-top: 10px; display: none; }
.msg-err.show { display: block; }

/* --- Quiz --- */
.progress-wrap { margin: 14px 0 6px; }
.progress-track {
  height: 8px; border-radius: 99px; background: var(--line);
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--ink), var(--saffron));
  border-radius: 99px;
  transition: width .3s ease;
}
.progress-label {
  font-size: 12.5px; color: var(--ink-soft);
  margin-top: 6px; text-align: right;
  font-variant-numeric: tabular-nums;
}

.q-text {
  font-family: 'Rubik', sans-serif;
  font-size: 20px; font-weight: 600;
  margin: 22px 0 18px;
  min-height: 60px;
}

.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  font-size: 15.5px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.choice .tag {
  display: inline-block;
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  color: var(--saffron-deep);
  margin-right: 8px;
}
.choice:active, .choice.picked {
  border-color: var(--saffron);
  background: #fdf6ea;
}

/* --- Pay page --- */
.qr-box {
  display: flex; justify-content: center;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 18px 0;
}
.pay-status {
  text-align: center; font-size: 14.5px; color: var(--ink-soft);
  margin: 12px 0;
}
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2.5px solid var(--line); border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  vertical-align: -3px; margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Thanks --- */
.big-check {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--ok); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; margin: 40px auto 20px;
}

/* --- Admin --- */
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin th, table.admin td {
  padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left;
}
table.admin th { color: var(--ink-soft); font-weight: 600; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
}
.pill.ok { background: #e2f4ec; color: var(--ok); }
.pill.no { background: #fbe9e8; color: var(--err); }
/* --- File picker (admin) --- */
.file-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 14px;
}
.file-pick:hover, .file-pick.drag { border-color: var(--saffron); background: #fdf7ee; }
.file-pick.has-file { border-style: solid; border-color: var(--saffron); }
.file-pick .fp-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #efeef6; color: var(--ink-soft);
}
.file-pick.has-file .fp-icon { background: #faeed8; color: var(--saffron-deep); }
.file-pick .fp-title { font-weight: 600; font-size: 14px; }
.file-pick .fp-sub { font-size: 12px; color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .v { font-family: 'Rubik', sans-serif; font-size: 22px; font-weight: 700; }
.stat .k { font-size: 12px; color: var(--ink-soft); }

@media (min-width: 720px) {
  .wrap.wide { max-width: 1000px; }
}
