/* Fijman.tech — внутренние страницы (политика, города, 404, ошибка) и общий футер.
   Опирается только на токены главной (--bg, --surface, --line, --text, --muted, --blue,
   --mono, --radius, --gutter, --max-width, --nav-clear): те же имена заданы в
   base.css и в constructor/style.css, поэтому файл работает на любом домене. */

.page-container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: calc(var(--nav-clear) + clamp(24px, 6svh, 64px)) 0 clamp(48px, 8svh, 96px);
}

.page-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 6svh, 64px); }
.page-meta { color: var(--muted); font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.page-meta a { text-decoration: underline; text-underline-offset: 3px; }
.page-meta a:hover { color: var(--text); }
.page-title { max-width: 16ch; font-size: clamp(38px, 6.2vw, 92px); font-weight: 650; line-height: .94; letter-spacing: -.06em; }
.page-title--long { max-width: 22ch; font-size: clamp(34px, 4.6vw, 68px); line-height: .98; }
.page-lead { max-width: 56ch; margin-top: 6px; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.6; }

.page-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 22px; border: 1px solid transparent; border-radius: 12px;
  background: var(--text); color: #fff; font-weight: 600;
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}
.page-btn:hover { background: var(--blue); }
.page-btn--ghost { border-color: var(--line-strong); background: transparent; color: var(--text); font-weight: 500; }
.page-btn--ghost:hover { background: rgba(15, 26, 43, .04); border-color: rgba(79, 117, 120, .45); }
@media (hover: hover) { .page-btn:hover { transform: translateY(-2px); } }
.page-btn:focus-visible, .page a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---- политика: оглавление слева, разделы справа ---- */
.legal { display: grid; gap: 24px; align-items: start; }
.legal-toc { display: none; }
.legal-body { display: grid; gap: 14px; }
.legal-card { padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: var(--nav-clear); }
.legal-card h2 { margin-bottom: 14px; font-size: clamp(19px, 2vw, 24px); font-weight: 600; letter-spacing: -.03em; line-height: 1.25; }
.legal-card p { max-width: 74ch; color: var(--muted); font-size: 15px; line-height: 1.7; }
.legal-card p + p { margin-top: 12px; }
.legal-card strong { color: var(--text); }
.legal-card a, .legal-contact a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.legal-card--note { border-color: rgba(79, 117, 120, .4); background: rgba(79, 117, 120, .05); }
.legal-contact { margin-top: 8px; color: var(--muted); font-size: 14px; }

@media (min-width: 992px) {
  .legal { grid-template-columns: 260px minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); }
  .legal-toc { position: sticky; top: calc(var(--nav-clear) + 8px); display: grid; gap: 2px; }
  .legal-toc a { padding: 9px 12px; border-radius: 10px; color: var(--muted); font-size: 14px; line-height: 1.35; transition: background .25s var(--ease), color .25s var(--ease); }
  .legal-toc a:hover { background: rgba(15, 26, 43, .06); color: var(--text); }
}

/* ---- города ---- */
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--gap, 16px); }
.city-card {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.city-card:hover { border-color: rgba(79, 117, 120, .45); }
@media (hover: hover) { .city-card:hover { transform: translateY(-2px); } }
.city-name { font-size: 18px; font-weight: 600; letter-spacing: -.03em; }
.city-host { grid-column: 1; color: var(--muted); font: 500 11px/1.3 var(--mono); letter-spacing: .04em; }
.city-card .bi { grid-row: 1 / span 2; grid-column: 2; color: var(--blue); }
.page-section { margin-top: clamp(40px, 7svh, 72px); padding-top: clamp(28px, 4svh, 40px); border-top: 1px solid var(--line); }
.page-section h2 { margin-bottom: 20px; font-size: clamp(24px, 3vw, 36px); font-weight: 650; letter-spacing: -.05em; line-height: 1.1; }

/* ---- 404 и ошибка ---- */
.page { position: relative; overflow: clip; }
.state-page { position: relative; z-index: 1; flex: 1; display: grid; align-content: center; justify-items: start; gap: 14px; }
.state-code {
  font: 700 clamp(72px, 15vw, 188px)/.86 var(--mono); letter-spacing: -.07em;
  background: linear-gradient(100deg, var(--blue) 10%, rgba(79, 117, 120, .35) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.state-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: clamp(20px, 4svh, 40px); }
.state-links-label { margin-right: 6px; color: var(--muted); font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.state-links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.state-links a .bi { color: var(--blue); }
.state-links a:hover { border-color: rgba(79, 117, 120, .5); }
@media (hover: hover) { .state-links a:hover { transform: translateY(-2px); } }

/* крупная иконка и кольца на фоне */
.state-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.state-icon {
  position: absolute; right: clamp(-120px, -4vw, -20px); top: 50%;
  font-size: clamp(300px, 52vw, 760px); line-height: 1; color: var(--blue); opacity: .11;
  transform: translateY(-46%) rotate(-14deg);
}
.state-ring {
  position: absolute; right: clamp(-120px, -4vw, -20px); top: 50%; aspect-ratio: 1; border: 1px solid var(--blue); border-radius: 50%; opacity: .16;
  transform: translate(calc(-1 * clamp(0px, 2vw, 40px)), -46%);
}
.state-ring--1 { width: clamp(320px, 56vw, 820px); }
.state-ring--2 { width: clamp(440px, 76vw, 1100px); opacity: .1; }
.state-ring--3 { width: clamp(580px, 100vw, 1440px); opacity: .06; }
@media (prefers-reduced-motion: no-preference) {
  .state-icon { animation: state-sway 14s ease-in-out infinite alternate; }
  .state-ring { animation: state-pulse 9s ease-in-out infinite alternate; }
  .state-ring--2 { animation-delay: -3s; } .state-ring--3 { animation-delay: -6s; }
}
@keyframes state-sway { from { transform: translateY(-46%) rotate(-20deg); } to { transform: translateY(-46%) rotate(-6deg); } }
@keyframes state-pulse { from { opacity: .05; } to { opacity: .2; } }
@media (max-width: 640px) { .state-icon { right: -22%; opacity: .09; } }

/* ---- проверка на робота ---- */
.gate-panel {
  display: grid; gap: 16px; width: min(100%, 520px); margin-top: clamp(14px, 3svh, 28px); padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 60px -36px rgba(15, 26, 43, .28);
}
.gate-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.gate-status .bi { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(79, 117, 120, .12); color: var(--blue); font-size: 17px; }
.gate-panel .turnstile-container:empty { display: none; }
.gate-panel .page-btn { width: 100%; }
.gate-panel .page-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.gate-panel .privacy-note { margin: 0; }
.gate-panel .form-error { color: var(--danger, #c2412b); font-size: 14px; }

/* ---- общий футер ---- */
.site-footer { padding: 24px 0 calc(35px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--faint); font: 11px var(--mono); }
.site-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-footer a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--text); }
@media (max-width: 640px) { .site-footer-inner { flex-direction: column; align-items: flex-start; } }

/* примечание под формами (конфигуратор, проверка) */
.privacy-note { margin: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.privacy-note a { color: var(--blue); text-underline-offset: 3px; }

h1, h2, h3, p { overflow-wrap: break-word; }
