/* Оплата на сайте без входа (webapp/templates/site_buy.html): каталог,
   страница продукта с формой, «Оплачено» со ссылкой получения. Цвета — как у
   страницы программы по ссылке (plan_share.css): тёмная тема, светлая — по
   настройке системы. */

:root {
  color-scheme: dark light;
  --bg: #110B30;
  --card: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .14);
  --ink: #F6F3FF;
  --ink-2: rgba(236, 230, 255, .74);
  --accent: #FF7A59;
  --grad: linear-gradient(110deg, #E24A9B, #FF7A59);
  --ok: #4ADE80;
  --warn: #FBBF24;
  --err: #F87171;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F6F4FB;
    --card: #FFFFFF;
    --line: rgba(17, 11, 48, .14);
    --ink: #17112F;
    --ink-2: rgba(23, 17, 47, .68);
    --accent: #C2336F;
    --ok: #15803D;
    --warn: #A16207;
    --err: #B91C1C;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

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

.brand {
  display: inline-block; text-decoration: none;
  font-size: 15px; font-weight: 800; letter-spacing: .02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1 { margin: 6px 0 12px; font-size: 26px; line-height: 1.2; }
h2 { margin: 24px 0 8px; font-size: 18px; }
.lead { color: var(--ink-2); margin: 0 0 8px; }

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

.text { font-size: 15px; line-height: 1.55; }
.about { margin: 0 0 4px; }
details.about summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
details.about .text { margin-top: 8px; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; min-height: 48px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
}
.row b { white-space: nowrap; }
.row b small { margin-left: 4px; font-weight: 500; color: var(--ink-2); }
.row-line { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }

.form { display: grid; gap: 14px; }
.options { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.options legend { font-weight: 800; margin-bottom: 6px; padding: 0; }
.option {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.option input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); }

.field { display: grid; gap: 6px; font-weight: 700; }
.field input {
  font: inherit; font-weight: 500; color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px; width: 100%;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 800; text-decoration: none; text-align: center;
  padding: 12px 18px; border-radius: 14px; cursor: pointer; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-main { background: var(--grad); color: #12092E; border-color: transparent; }
/* Страница оплаты: пока не отмечены оферта и согласие на ПДн, кнопка оплаты не активна (сервер тоже откажет). */
.pay-form:has(.check input:not(:checked)) .btn-main { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-wide { width: 100%; }

.hint { margin: 0; color: var(--ink-2); font-size: 14px; }
.error { color: var(--err); font-weight: 700; }

.done p { margin: 8px 0; }
.done-title { font-size: 17px; }
.status { font-weight: 800; }
.status.ok { color: var(--ok); }
.status.wait { color: var(--warn); }
.qr-box { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.qr { flex: none; background: #fff; padding: 8px; border-radius: 10px; line-height: 0; }
.qr:empty { display: none; }
.qr img, .qr canvas { display: block; width: 160px; height: 160px; }
.order-id { color: var(--ink-2); font-size: 13px; }

.foot { margin-top: 20px; font-size: 14px; }
.legal { margin-top: 32px; color: var(--ink-2); font-size: 12px; }
.legal a { color: var(--ink-2); }
.legal p { margin: 4px 0; }

@media (max-width: 420px) {
  .qr-box { flex-direction: column; align-items: flex-start; }
}
