/* Minimal baseline to see the layout quickly */
:root { --gap: 16px; --muted:#6b7280; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji'; }
.header, .footer { padding: var(--gap); border-bottom: 1px solid #eee; display:flex; align-items:center; gap:var(--gap); }
.footer { border-top: 1px solid #eee; border-bottom: none; justify-content:center; }
.logo { font-weight: 700; }
.top-nav a { margin-right: 12px; text-decoration: none; color: inherit; }
.user-block { margin-left: auto; display:flex; align-items:center; gap:8px; }
.layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--gap); padding: var(--gap); }
.sidebar { border-right:1px solid #eee; padding-right:var(--gap); }
.menu { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.menu a { text-decoration:none; color:#111; }
.main-content { padding: 8px; }
.card { border:1px solid #eee; border-radius: 12px; padding: 16px; }
.grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.field { display:flex; flex-direction:column; gap:6px; }
input, select, button { font: inherit; padding: 10px 12px; border:1px solid #d1d5db; border-radius:10px; }
.btn { border:1px solid #111; background:#111; color:#fff; border-radius:10px; padding:10px 14px; text-decoration:none; display:inline-block; }
.btn.outline { background:#fff; color:#111; }
.btn.small { padding:6px 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tag { display:inline-block; padding: 3px 6px; background:#f3f4f6; border-radius: 8px; font-size:12px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; padding-right: 0; }
  .grid { grid-template-columns: 1fr; }
}

/* --- Telegram CTA variant ------------------------------------------------- */
.ui-btn.g-btn--telegram {
  background: linear-gradient(180deg, #2AABEE 0%, #229ED9 100%);
  color: #fff;
  border-color: #229ED9;
}
.ui-btn.g-btn--telegram:hover { filter: brightness(.96); }
.ui-btn.g-btn--telegram:active { transform: translateY(1px); }
.ui-btn.g-btn--telegram:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, #229ED9 25%, transparent);
}
/* увеличенная иконка самолётика */
.ui-btn.g-btn--telegram svg { width: 28px; height: 28px; margin-right: .5rem; flex-shrink: 0; }
.ui-btn.g-btn--telegram svg path { stroke-width: 2; }

/* --- Центрирование экрана / размеры карточки (дефолт для экранов) -------- */
.g-screen-center {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5, 24px);
}
.g-auth-card { width: min(560px, 92vw); } /* Login-экран по умолчанию */

/* --- Типографские мелочи -------------------------------------------------- */
.g-lead-tight { margin-top: -.25rem; }

/* --- QR-блок -------------------------------------------------------------- */
.g-qr a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 .875rem;
  border-radius: var(--radius-2xl, 16px);
  border: 1px solid var(--brand-600, #16a34a);
  color: var(--brand-700, #15803d);
  text-decoration: none;
}
.g-qr a:hover { background: var(--brand-50, #f0fdf4); }

/* --- Consent: ровный левый край + кастомный чекбокс ---------------------- */
.g-consent {
  position: relative;
  padding-left: 40px; /* поле под коробку чекбокса + зазор */
  line-height: 1.6;
}
.g-consent label { line-height: 1.6; cursor: pointer; }
.g-consent a { text-underline-offset: 2px; }
.g-consent a:hover { text-decoration: underline; }

/* Кастомный чекбокс (24px), зелёный брендовый, с ровной ✓ */
.g-check--custom{
  appearance: none;
  inline-size: 24px; block-size: 24px;
  border-radius: 6px;
  border: 2px solid var(--brand-500, #22c55e);
  background: #fff;
  position: absolute; left: 0; top: .15em; /* выровнено по первой строке */
  transition: box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.g-check--custom:hover{ border-color: var(--brand-600, #16a34a); }
.g-check--custom:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600, #16a34a) 25%, transparent);
}
.g-check--custom:checked{
  background: var(--brand-600, #16a34a);
  border-color: var(--brand-600, #16a34a);
}
.g-check--custom:checked::after{
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 7px;               /* пропорции галочки */
  border: 2px solid #fff;
  border-top: 0; border-left: 0;          /* оставляем правую и нижнюю */
  transform: translate(-50%, -58%) rotate(45deg);
  transform-origin: center;
}

/* Видимый фокус для чекбокса и ссылок */
.g-check:focus-visible,
.g-consent a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: .25rem;
}

/* --- CTA-ряд -------------------------------------------------------------- */
.g-cta{ display:flex; }
.g-cta--left{ justify-content:flex-start; }
.g-cta--center{ justify-content:center; }
.g-cta .ui-btn{ min-width:260px; }
@media (max-width:576px){ .g-cta .ui-btn{ width:100%; } }

/* === Activate Code — additions ========================================== */

/* Статус под заголовком */
.g-status { min-height: 22px; margin: .5rem 0 .75rem; }
.text-green { color: var(--brand-700, #15803d); }
.text-red   { color: var(--error, #ef4444); }

/* 8-значный код: 2×4 коробочки с делителем (крупные цифры, 1 строка) */
.g-code { display:flex; align-items:center; gap: var(--space-4, 1rem); user-select:none; flex-wrap: nowrap; }
.g-code__box { display:flex; gap: var(--space-3, .75rem); }
.g-code__sep { color: var(--fg-muted, #6b7280); font-weight: 700; }
.g-code__digit{
  width:56px; height:56px;                 /* 44px+ под палец */
  text-align:center; font-size:24px; font-weight:700;
  background: var(--surface, #fff);
  border:1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-3xl, 24px);
  outline:none; transition:.15s ease;
}
.g-code__digit:focus{
  border-color: var(--brand-600, #16a34a);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600, #16a34a) 25%, transparent);
}

/* Дизейбл для ссылок-кнопок до precheck (покрываем .btn и .ui-btn) */
.btn.is-disabled,
.ui-btn.is-disabled{
  opacity:.55;
  pointer-events:none;
  cursor:not-allowed;
  box-shadow:none;
  filter: grayscale(10%);
}

/* Спиннер */
.g-spinner__ring{
  width:24px; height:24px;
  border:3px solid var(--border, #e5e7eb);
  border-top-color: var(--brand-600, #16a34a);
  border-radius:50%;
  animation:gspin .8s linear infinite;
}
@keyframes gspin{ to{ transform: rotate(360deg); } }

/* Для экрана активации карточку делаем шире, чем на логине */
.g-auth-card.g-auth-card--wide,
body[data-page="activate"] .g-auth-card { width: min(720px, 92vw); }

/* === /Activate Code — additions ========================================= */
