/* ——— Окно входа и регистрации ——— */

.auth-modal .auth-card {
  width: min(calc(480px * var(--ui-scale)), 100%);
  padding: calc(24px * var(--ui-scale)) calc(24px * var(--ui-scale)) calc(18px * var(--ui-scale));
  border-radius: calc(20px * var(--ui-scale));
  background:
    radial-gradient(600px 220px at 100% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--panel-solid);
}

.auth-head {
  margin-bottom: calc(14px * var(--ui-scale));
}

.auth-eyebrow {
  margin: 0 0 4px;
  font-size: calc(11px * var(--fs));
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}

.auth-head h2 {
  margin: 0 0 6px;
  font-size: calc(28px * var(--fs));
  line-height: 1.15;
}

.auth-lead {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.auth-form {
  display: block;
}

.auth-form[hidden],
.auth-grid[hidden] {
  display: none !important;
}

.auth-form label {
  font-weight: 600;
  color: var(--ink);
  margin: calc(8px * var(--ui-scale)) 0;
}

.auth-form input {
  font-weight: 400;
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
}

.auth-form input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.check-row {
  margin: calc(6px * var(--ui-scale)) 0 !important;
}

/* Ссылки на документы внутри согласий: подчёркиваем, чтобы было видно, что это ссылка. */
.check-row a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.check-row a:hover { text-decoration-thickness: 2px; }

.auth-submit {
  width: 100%;
  margin-top: calc(12px * var(--ui-scale));
  padding: calc(12px * var(--ui-scale));
  font-size: calc(16px * var(--fs));
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}

/* Логин — на всю ширину, два пароля — в ряд. */
.auth-grid > label:first-child {
  grid-column: 1 / -1;
}

@media (max-width: 420px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

.auth-plans {
  margin: calc(10px * var(--ui-scale)) 0 0;
  padding: 0;
  border: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}

.auth-plans legend {
  grid-column: 1 / -1;
  padding: 0;
  margin-bottom: 4px;
  font-size: var(--text-sm);
  color: var(--muted);
}

@media (max-width: 420px) {
  .auth-plans {
    grid-template-columns: 1fr;
  }
}

.auth-plan {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px !important;
  padding: calc(9px * var(--ui-scale)) calc(11px * var(--ui-scale));
  border: 1px solid var(--line);
  border-radius: calc(12px * var(--ui-scale));
  background: color-mix(in srgb, var(--panel-soft) 60%, transparent);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-plan:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.auth-plan:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.auth-plan input {
  width: auto !important;
  margin: 3px 0 0 !important;
  accent-color: var(--accent);
}

.auth-plan span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.auth-plan b {
  font-size: var(--text);
  color: var(--ink);
}

.auth-plan em {
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--muted);
}

.auth-seats {
  margin: calc(8px * var(--ui-scale)) 0 !important;
}

.auth-seats[hidden] {
  display: none !important;
}

/* Пояснение к «одновременно»: покупатель должен понять, за что платит. */
.auth-seats-hint {
  display: block;
  margin-top: 6px;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--muted);
}

.auth-total {
  margin: calc(10px * var(--ui-scale)) 0 0;
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  border-radius: calc(10px * var(--ui-scale));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: var(--text-sm);
  color: var(--muted);
}

.auth-total b {
  color: var(--ink);
  font-size: var(--text-md);
}

.auth-fine {
  margin: 10px 0 0;
  font-size: calc(11px * var(--fs));
  line-height: 1.45;
  color: var(--muted);
}

.auth-captcha-q {
  margin: 10px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.auth-error {
  margin: calc(10px * var(--ui-scale)) 0 0;
  padding: calc(9px * var(--ui-scale)) calc(11px * var(--ui-scale));
  border-radius: calc(10px * var(--ui-scale));
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  font-size: var(--text-sm);
}

.auth-error[hidden] {
  display: none !important;
}

.auth-switch {
  margin-top: calc(14px * var(--ui-scale));
  padding-top: calc(12px * var(--ui-scale));
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.linkish {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: color-mix(in srgb, var(--accent) 85%, var(--ink));
  font-weight: 700;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.linkish:hover {
  color: var(--accent);
}

#cabinet-captcha-wrap[hidden],
#cabinet-captcha-wrap-reg[hidden] {
  display: none !important;
}

/* ——— Чёрный подвал сайта: полоса в самом низу страницы ——— */

/* Страница целиком прокручивается: подвал стоит ниже экрана, за ползунком. */
html {
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

body {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Один ползунок на странице — у окна. */
html {
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Рабочая область растёт по содержимому: высоту задаёт документ, а не экран.
   Так на странице один ползунок — у окна, а подвал стоит в самом низу. */
#app {
  min-height: 100dvh;
  height: auto;
  overflow: visible;
}

/* Внутренняя прокрутка экрана доводит до подвала: без «стоп-крана» на границе. */
#app .screen,
#app .home-scroll {
  overscroll-behavior-y: auto;
}

.site-footer {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: calc(28px * var(--ui-scale)) calc(22px * var(--ui-scale)) calc(16px * var(--ui-scale));
  background: #07080b;
  color: #cfd6df;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(3, minmax(100px, 1fr));
  gap: calc(14px * var(--ui-scale));
  width: 100%;
  max-width: calc(1120px * var(--ui-scale));
  margin: 0 auto;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: calc(18px * var(--fs));
  font-weight: 700;
  color: #ffffff;
}

.site-footer-note {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: #9aa5b4;
}

.site-footer-col h4 {
  margin: 0 0 6px;
  font-size: calc(12px * var(--fs));
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f8b9b;
}

.site-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px 12px;
}

.site-footer-col li {
  font-size: calc(12px * var(--fs));
  line-height: 1.4;
  color: #b8c2cf;
  /* Документы длинные — переносим строки, а не обрезаем названия. */
  overflow-wrap: break-word;
}

/* У контактов длинные строки — они в один столбец. */
.site-footer-col:nth-child(3) ul {
  grid-template-columns: 1fr;
}

.site-footer-col a {
  color: #cfd6df;
  text-decoration: none;
}

.site-footer-col a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  max-width: calc(1120px * var(--ui-scale));
  margin: calc(12px * var(--ui-scale)) auto 0;
  padding-top: calc(9px * var(--ui-scale));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: calc(12px * var(--fs));
  color: #8a95a4;
}

/* Реквизиты ИП: место под данные, которые требует закон о защите прав
   потребителей — наименование, ИНН, ОГРНИП, адрес и банковские счета. */
.site-footer-req {
  width: 100%;
  max-width: calc(1120px * var(--ui-scale));
  margin: calc(18px * var(--ui-scale)) auto 0;
  padding-top: calc(12px * var(--ui-scale));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer-req h4 {
  margin: 0 0 8px;
  font-size: calc(12px * var(--fs));
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa5b4;
}
.site-footer-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: calc(6px * var(--ui-scale)) calc(20px * var(--ui-scale));
}
.site-footer-req-grid p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: calc(12px * var(--fs));
  line-height: 1.45;
}
.site-footer-req-grid p > span {
  color: #7d8899;
  min-width: 96px;
  flex: 0 0 auto;
}
.site-footer-req-grid p > b {
  color: #cfd6df;
  font-weight: 600;
  word-break: break-word;
}

@media (max-width: 900px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* В игре подвал не нужен: там экран на всю высоту без прокрутки страницы. */
body.in-play .site-footer,
body[data-screen="play"] .site-footer {
  display: none;
}

body.in-play,
body[data-screen="play"] {
  overflow: hidden;
}

@media (max-width: 560px) {
  .site-footer {
    padding: calc(20px * var(--ui-scale)) calc(16px * var(--ui-scale)) calc(12px * var(--ui-scale));
  }
  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .auth-card {
    width: 100% !important;
    max-height: min(92dvh, 100%);
  }
  .auth-grid,
  .auth-plans {
    grid-template-columns: 1fr;
  }
}

/* ===== Промокод в регистрации и шаг оплаты ===== */
.auth-promo { display: grid; gap: 6px; }
.auth-promo > label { font-weight: 600; }
.auth-promo-opt { font-weight: 400; color: var(--muted); }
.auth-promo-row { display: flex; gap: 8px; }
.auth-promo-row input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.auth-promo-row button { width: auto; flex: 0 0 auto; margin: 0; }
.auth-promo-status { margin: 0; min-height: 1.1em; font-size: 0.88rem; }
.auth-promo-status.good { color: #2b8a3e; }
.auth-promo-status.bad { color: #c92a2a; }
.auth-promo-hint { margin: 0; font-size: 0.82rem; color: var(--muted); }
#reg-total-old { color: var(--muted); font-weight: 400; margin-right: 4px; }
.auth-pay-sum { display: grid; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.auth-pay-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.auth-pay-sum > div:first-child { border-top: 0; }
.auth-pay-sum dt { color: var(--muted); }
.auth-pay-sum dd { margin: 0; text-align: right; font-weight: 600; }
#pay-discount { color: #2b8a3e; }
.auth-pay-total { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.auth-pay-total dd { font-size: 1.2rem; }
.auth-pay .linkish { justify-self: center; }

/* ===== Профиль: личный промокод и награды ===== */
.profile-ref {
  display: grid; gap: 10px; margin: 14px 0; padding: 16px 18px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.profile-ref h3 { margin: 0 0 4px; font-size: 1.05rem; }
.profile-ref p { margin: 0; }
.profile-ref-head { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: flex-start; }
.profile-ref-head > div:first-child { flex: 1 1 320px; }
.profile-ref-code { display: flex; gap: 8px; align-items: center; }
.profile-ref-code code {
  padding: 8px 14px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--line));
  background: var(--card, #fff); font-size: 1.15rem; font-weight: 800; letter-spacing: 0.08em; user-select: all;
}
.profile-ref-code button { width: auto; margin: 0; }
.profile-ref-copied { color: #2b8a3e; min-height: 1em; }
.profile-ref-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.profile-ref-stats > div { padding: 8px 12px; border-radius: 12px; background: var(--card, #fff); border: 1px solid var(--line); }
.profile-ref-stats dt { font-size: 0.8rem; color: var(--muted); }
.profile-ref-stats dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 800; }
.profile-ref-sub { font-weight: 600; font-size: 0.9rem; }
.profile-ref-list { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.profile-ref-list th, .profile-ref-list td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.profile-ref-list th { font-weight: 600; color: var(--muted); }
.profile-ref-list td:last-child, .profile-ref-list th:last-child { text-align: right; white-space: nowrap; }
@media (max-width: 560px) {
  .profile-ref-stats { grid-template-columns: 1fr; }
  .profile-ref-code { width: 100%; }
  .profile-ref-code code { flex: 1; text-align: center; }
}

/* Две отдельные галочки перед оплатой: оферта и согласие на ПД */
.auth-consents {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line, rgba(127, 127, 127, 0.25));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #6a5cff) 5%, transparent);
}
.auth-consents .check-row { align-items: flex-start; line-height: 1.4; }
.auth-consents .check-row input { margin-top: 3px; flex: none; }
.auth-consent-hint { margin: 0; }
.auth-consent-hint[hidden] { display: none; }
#cabinet-reg-form .auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.site-footer-req-grid a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
