/* Единственный стиль-файл сайта. Никакого JS, никаких внешних CDN/шрифтов —
   см. CSP (app/security.py): script-src 'none'. */

:root {
  --ink: #1c2230;
  --muted: #6b7280;
  --line: #e3e6ec;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --accent: #2f5eea;
  --accent-ink: #ffffff;
  --ok: #1a7f4b;
  --ok-bg: #e6f6ec;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --draft: #8a6d00;
  --draft-bg: #fff6da;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef0f4; padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }

/* ---------- Публичная часть ---------- */

/* Главная вдохновлена исходной визуальной концепцией: тёмная кинематографичная
   сцена, светлая арка, орбиты и тёплый горизонт. Графика целиком на CSS —
   исходное изображение не используется и не загружается на сайт. */
.landing-shell {
  --night: #111215;
  --night-soft: #19191b;
  --cream: #f3eee6;
  --cream-soft: #c9c0b5;
  --amber: #d49a68;
  --amber-light: #f0c28f;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-line: rgba(255, 255, 255, 0.13);
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 28%, rgba(148, 115, 95, 0.14), transparent 34rem),
    linear-gradient(180deg, #121316 0%, #161514 62%, #0e0f11 100%);
  color: var(--cream);
  overflow: hidden;
}

.landing-shell a { color: inherit; }
.landing-shell a:hover { text-decoration: none; }

.landing-nav {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.landing-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 0.92rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.landing-brand-mark { color: var(--amber-light); font-size: 1.05rem; }
.nav-cta { border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 10px 18px; font-size: .86rem; transition: background .2s ease, border-color .2s ease; }
.nav-cta:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.4); }

.hero {
  width: min(1180px, calc(100% - 40px));
  min-height: 760px;
  margin: 0 auto;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  padding: 90px 0 110px;
}
.hero::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 100vw; height: 36%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(219, 158, 104, .07));
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 10; width: min(920px, 100%); text-align: center; }
.hero-kicker, .section-label {
  margin: 0 0 24px;
  text-transform: uppercase;
  letter-spacing: .42em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--cream-soft);
}
.hero h1 {
  margin: 0;
  font-size: clamp(4.4rem, 11.5vw, 9.7rem);
  line-height: .86;
  letter-spacing: -.065em;
  text-transform: uppercase;
  font-weight: 800;
  color: #f7f2ea;
  text-shadow: 0 4px 40px rgba(0,0,0,.22);
}
.hero-lead { width: min(610px, 100%); margin: 38px auto 0; font-size: clamp(1rem, 1.8vw, 1.23rem); line-height: 1.7; color: #d5cec5; }
.hero-actions { margin-top: 34px; }
.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  background: #f2ece3;
  color: #171719 !important;
  font-weight: 750;
  box-shadow: 0 15px 50px rgba(0,0,0,.24), 0 0 45px rgba(224,168,116,.08);
  transition: transform .2s ease, background .2s ease;
}
.primary-cta:hover { transform: translateY(-2px); background: #fffaf2; }
.primary-cta.is-disabled { opacity: .58; cursor: default; }
.primary-cta.is-disabled:hover { transform: none; }
.hero-note { width: min(620px, 100%); margin: 20px auto 0; color: #8e8982; font-size: .78rem; }

.hero-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.orbit { position: absolute; left: 50%; top: 47%; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; transform: translate(-50%, -50%); }
.orbit-one { width: min(690px, 68vw); aspect-ratio: 1; }
.orbit-two { width: min(930px, 90vw); aspect-ratio: 1; opacity: .35; }
.portal {
  position: absolute;
  left: 50%; bottom: 52px;
  width: min(340px, 38vw);
  height: min(500px, 58vw);
  transform: translateX(-50%);
  border: 1px solid rgba(235, 189, 147, .52);
  border-bottom: 0;
  border-radius: 180px 180px 0 0;
  background: linear-gradient(180deg, rgba(177, 111, 74, .08), rgba(214, 137, 78, .22) 66%, rgba(250, 174, 95, .1));
  box-shadow: inset 0 0 55px rgba(225, 149, 92, .09), 0 0 65px rgba(212, 143, 90, .06);
  overflow: hidden;
}
.portal::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 56px;
  width: 120%; height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255,213,167,.58), transparent);
  box-shadow: 0 18px 30px rgba(239,168,99,.15);
}
.portal-sun { position: absolute; left: 50%; bottom: 44px; width: 18px; height: 18px; transform: translateX(-50%); border-radius: 50%; background: #f6c17f; box-shadow: 0 0 22px #efae66, 0 0 60px rgba(239,174,102,.85); }
.portal-glow { position: absolute; left: 50%; bottom: -90px; width: 270px; height: 200px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(225,142,78,.3), transparent 68%); }
.crescent {
  position: absolute;
  top: 82px; right: 4%;
  width: min(390px, 38vw); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 48%, transparent 0 50%, rgba(218,174,137,.2) 51%, rgba(238,193,151,.42) 70%, rgba(248,211,176,.67) 100%);
  filter: drop-shadow(0 0 30px rgba(212,161,117,.1));
  opacity: .72;
}
.crescent::after { content: ""; position: absolute; inset: 7% 2% 2% 18%; border-radius: 50%; background: #131417; }
.star-line { position: absolute; left: 50%; top: 26px; width: 1px; height: 182px; transform: translateX(-50%); background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,.08)); }
.star-line span { position: absolute; top: 78px; left: 50%; transform: translate(-50%, -50%); color: #f7eee2; font-size: 2.4rem; text-shadow: 0 0 22px rgba(255,230,200,.65); }

.how, .about-card, .final-cta, .landing-footer { width: min(1180px, calc(100% - 40px)); margin-left: auto; margin-right: auto; }
.how { padding: 118px 0 54px; }
.section-heading { display: grid; grid-template-columns: .72fr 1.28fr; gap: 60px; align-items: end; margin-bottom: 44px; }
.section-heading .section-label { margin: 0; }
.section-heading h2, .about-card h2, .final-cta h2 { margin: 0; font-size: clamp(2rem, 5vw, 4.25rem); line-height: 1.03; letter-spacing: -.045em; font-weight: 650; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step-card { min-height: 270px; display: flex; flex-direction: column; padding: 28px; border: 1px solid var(--glass-line); border-radius: 24px; background: var(--glass); backdrop-filter: blur(6px); }
.step-number { color: var(--amber-light); font-size: .73rem; letter-spacing: .12em; }
.step-card h3 { margin: auto 0 12px; font-size: 1.25rem; }
.step-card p { margin: 0; color: #aaa49d; line-height: 1.65; }

.about-card { margin-top: 68px; padding: 58px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 70px; border: 1px solid rgba(255,255,255,.1); border-radius: 30px; background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(209,146,92,.045)); }
.about-card .section-label { margin-bottom: 18px; }
.about-copy { align-self: end; }
.about-copy p { margin: 0 0 22px; color: #bdb6ae; font-size: 1.04rem; line-height: 1.75; }
.text-link { display: inline-flex; gap: 10px; align-items: center; font-weight: 650; color: var(--cream) !important; border-bottom: 1px solid rgba(255,255,255,.25); padding-bottom: 4px; }

.final-cta { position: relative; text-align: center; padding: 155px 20px 150px; overflow: hidden; }
.final-cta .section-label { margin-bottom: 18px; }
.final-cta h2 { font-size: clamp(4rem, 10vw, 8rem); text-transform: uppercase; margin-bottom: 34px; }
.final-orb { position: absolute; z-index: 0; left: 50%; top: 51%; width: 620px; height: 260px; transform: translate(-50%, -50%); background: radial-gradient(ellipse, rgba(213,143,86,.17), transparent 67%); pointer-events: none; }
.final-cta > *:not(.final-orb) { position: relative; z-index: 1; }

.landing-footer { padding: 38px 0 44px; border-top: 1px solid rgba(255,255,255,.1); }
.footer-top { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; }
.footer-top strong { font-size: 1rem; letter-spacing: .09em; text-transform: uppercase; }
.footer-top p { margin: 7px 0 0; color: #77736e; font-size: .8rem; }
.footer-top > a { color: #bbb4ac; font-size: .88rem; }
.legal-links { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.legal-links a { color: #9a958f; font-size: .82rem; }
.legal-links a:hover, .footer-top > a:hover { color: #f0ebe4; }
.footer-meta { margin: 28px 0 0; color: #5f5c58; font-size: .76rem; }

/* Документы */
.pub-wrap { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.pub-header h1 { font-size: clamp(1.8rem, 4vw, 2.45rem); margin-bottom: .5rem; letter-spacing: -.025em; }
.doc-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.doc-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.doc-list li a { font-size: 1.05rem; }
.doc-body { margin-top: 1.5rem; }
.doc-body h1, .doc-body h2, .doc-body h3 { margin-top: 1.6em; }
.doc-body p { margin: 1em 0; }
.pub-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.error-box { text-align: center; padding: 4rem 1rem; }
.error-box h1 { font-size: 3rem; margin: 0; }

@media (max-width: 800px) {
  .landing-nav, .hero, .how, .about-card, .final-cta, .landing-footer { width: min(100% - 28px, 1180px); }
  .landing-nav { min-height: 70px; }
  .landing-brand { font-size: .78rem; }
  .nav-cta { padding: 8px 13px; font-size: .78rem; }
  .hero { min-height: 690px; padding: 86px 0 90px; }
  .hero-kicker { font-size: .61rem; letter-spacing: .27em; margin-bottom: 19px; }
  .hero h1 { font-size: clamp(4.15rem, 22vw, 7rem); }
  .hero-lead { margin-top: 28px; padding: 0 8px; font-size: .98rem; }
  .hero-note { padding: 0 16px; line-height: 1.5; }
  .portal { width: min(285px, 70vw); height: 410px; bottom: 45px; }
  .orbit-one { width: 88vw; }
  .orbit-two { width: 126vw; }
  .crescent { width: 240px; right: -105px; top: 74px; opacity: .58; }
  .star-line { height: 145px; top: 18px; }
  .star-line span { top: 65px; }
  .how { padding-top: 84px; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; margin-bottom: 30px; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 205px; }
  .about-card { grid-template-columns: 1fr; gap: 34px; padding: 32px 24px; margin-top: 50px; }
  .final-cta { padding-top: 110px; padding-bottom: 110px; }
  .final-cta h2 { font-size: clamp(3.5rem, 20vw, 6.4rem); }
  .footer-top { flex-direction: column; }
  .legal-links { display: grid; grid-template-columns: 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .primary-cta, .nav-cta { transition: none; }
}

/* ---------- Логин ---------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-form {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 2rem; width: 100%; max-width: 320px;
}
.login-form h1 { font-size: 1.2rem; margin: 0 0 1.2rem; }

/* ---------- Формы (общее) ---------- */

label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=password], input[type=email], textarea {
  display: block; width: 100%; margin-top: 0.35rem;
  padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.92rem; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .btn, .btn-secondary, .btn-danger, .btn-ok {
  display: inline-block; border: 1px solid transparent; border-radius: 6px;
  padding: 0.55rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer;
}
button[type=submit], .btn { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

.form-actions { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.inline-form { display: inline-block; margin: 1rem 0; }

/* ---------- Флеш-сообщения ---------- */

.flash { padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.92rem; }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-info { background: #eef1fb; color: var(--accent); }

/* ---------- Админка ---------- */

.adm-wrap { max-width: 980px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.adm-nav {
  display: flex; align-items: center; gap: 1.4rem;
  padding: 1rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem;
}
.adm-nav-brand { font-weight: 700; margin-right: auto; }
.adm-nav-logout { margin-left: 0; }
.adm-flashes { margin-bottom: 1rem; }
.adm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; gap: 1rem; }
.adm-head h1 { font-size: 1.35rem; margin: 0; }

.adm-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.adm-table th, .adm-table td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table th { background: #f1f2f6; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.adm-table tr:last-child td { border-bottom: none; }
.adm-table-actions a { margin-right: 0.8rem; }

.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-draft { background: var(--draft-bg); color: var(--draft); }

.page-form { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.preview-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
