/* ============================================================
   «Осознай Реальность» — общая дизайн-система (этап 2).
   Шапка, подвал, типографика, мобильное меню, плавающие кнопки.
   Подключается в templates/main.html ПОСЛЕ main_css.css, поэтому
   перекрывает старые правила. main_css.css не переписывается.

   Правила: docs/Задачи после 3 переноса тестового сайта/ДИЗАЙН_ПРАВИЛА.md
   Контент главной (.home-main) живёт в static/0_main_redesign.css.
   ============================================================ */

/* ---------- 1. Токены ---------- */
:root {
  /* фон и поверхности */
  --bg: #F8F5EF;
  --surface: #FFFFFF;
  --surface-2: #F1ECE2;

  /* текст */
  --ink: #211B2E;
  --ink-soft: #3B3449;
  --muted: #5B5468;
  --line: #E2DACD;
  --line-strong: #CEC3B1;

  /* бренд */
  --indigo: #2F2A6E;
  --indigo-deep: #171326;
  --indigo-soft: #4A4290;
  --blue: #4169E1;
  --gold: #A9812F;
  --gold-ink: #6E4F12;
  --gold-soft: #D8BE86;
  --gold-pale: #F3E7CD;
  --white: #FFFFFF;

  /* форма */
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px rgba(33, 27, 46, .08);
  --shadow-sm: 0 8px 24px rgba(33, 27, 46, .06);
  --wrap: 1200px;
  --serif: Georgia, "Times New Roman", serif;

  /* тёмные полосы шапки/подвала — одинаковые в обеих темах */
  --ds-dark: #100D1C;
  --ds-dark-2: #171326;
  --ds-dark-line: #2A243B;
  --ds-on-dark: #E5DDD0;
  --ds-on-dark-soft: #BDB5C8;
  --ds-on-dark-muted: #8B8299;

  /* отступ первой секции от шапки, которая теперь в потоке */
  --ds-top-gap: 40px;
}

html[data-theme="dark"] {
  --bg: #0C0918;
  --surface: #171228;
  --surface-2: #211A36;
  --ink: #F7F1E5;
  --ink-soft: #D9D2C5;
  --muted: #B9B0C6;
  --line: #332C45;
  --line-strong: #4A4260;
  --indigo: #4B3F9E;
  --indigo-deep: #0A0720;
  --indigo-soft: #6C5CE0;
  --gold: #C9A96B;
  --gold-ink: #E9D9B4;
  --gold-soft: #D8BE86;
  --gold-pale: #2A2340;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .25);
}

/* ---------- 2. База: body, текст, ссылки ---------- */
html[data-theme] body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body ::selection {
  background: var(--gold-soft);
  color: #171326;
}

a {
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Кнопки дизайн-системы (используются в новых блоках и модалках) */
body .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

body .btn:hover { transform: translateY(-2px); }
body .btn-primary { background: var(--indigo); color: #FFFFFF; }
body .btn-primary:hover { background: #262158; }
body .btn-gold { background: var(--gold-soft); color: #241B0B; }
body .btn-gold:hover { background: #E7D3A5; }
body .btn-light {
  background: transparent;
  color: #F5EFE3;
  border-color: rgba(245, 239, 227, .3);
}
body .btn-light:hover { background: rgba(245, 239, 227, .08); }
body .btn .arr { transition: transform .18s ease; }
body .btn:hover .arr { transform: translateX(3px); }

/* Контейнер */
body .wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 3. Верхняя полоса ---------- */
body .topbar {
  background: var(--ds-dark);
  color: var(--ds-on-dark-soft);
  font-size: 13px;
  letter-spacing: .02em;
}

body .topbar .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: nowrap;
}

body .topbar-left,
body .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

body .topbar a {
  color: #F0E8DA;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
body .topbar a:hover { color: var(--gold-soft); }
body .topbar .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #5E5570;
}

body .top-link,
body .top-profile {
  cursor: pointer;
  color: #D9D2C5;
  font-size: 13px;
}
body .top-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
body .top-profile > div {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}
body .top-profile svg {
  width: 18px;
  height: 18px;
  color: var(--gold-soft);
}
body .top-link:hover,
body .top-profile:hover { color: var(--gold-soft); }

/* Тумблер темы */
body .theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #D9D2C5;
  font-size: 12px;
  flex: 0 0 auto;
  flex-direction: row;
  width: auto;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body .theme-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: #3A334B;
  border: 1px solid #4A4260;
}

body #sub_tog_switch_icon_id {
  position: absolute;
  left: 2px;
  top: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-soft);
  display: grid;
  place-items: center;
  transition: transform .2s ease;
}
body #sub_tog_switch_icon_id svg {
  width: 11px;
  height: 11px;
  fill: #241B0B;
}
body #sub_tog_switch_text_id {
  white-space: nowrap;
  color: #D9D2C5;
  font-size: 12px;
  line-height: 20px;
}

/* ---------- 4. Шапка ---------- */
body .site-head {
  position: sticky;
  top: 0;
  z-index: 3000;
  display: block;
  width: 100%;
  height: auto;
  background: rgba(23, 19, 38, .97);
  border-bottom: 1px solid rgba(216, 190, 134, .14);
  backdrop-filter: blur(12px);
}

body .site-head .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

body .site-head .logo,
body .site-footer .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
  animation: none;
}

body .logo-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background-image: url(/static/img/gold_logo1.png);
  background-repeat: no-repeat;
  background-size: auto 42px;
  background-position: 0 center;
}

body .logo-text b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #E9D9B4;
  white-space: nowrap;
}

body .logo-text i {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9D94AC;
  white-space: nowrap;
}

body .site-head .nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  margin-left: auto;
}

body .site-head .nav a {
  color: #D9D2C5;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
body .site-head .nav a:hover {
  color: var(--gold-soft);
  border-color: var(--gold-soft);
}

/* Поиск в шапке */
body .head-search {
  width: 150px;
  min-width: 0;
  margin: 0;
  display: flex;
  flex: 0 0 auto;
}

body .head-search .search_box_cl {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #453D59;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}
body .head-search .search_box_cl > div {
  width: 16px;
  height: 16px;
  color: #9D94AC;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
body .head-search svg { width: 16px; height: 16px; }
body .head-search input {
  width: 100%;
  height: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: #F5EFE3;
  font: inherit;
  font-size: 13px;
  padding: 0;
}
body .head-search input::placeholder { color: #8B8299; }

body .head-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #241B0B;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  text-decoration: none;
}
body .head-cta:hover { background: #E7D3A5; color: #241B0B; }

/* ---------- 5. Мобильное меню ---------- */
body .mobile_nav_catalog_cl {
  display: none;
  position: relative;
  width: auto;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  border: 1px solid #453D59;
  border-radius: 12px;
  background: transparent;
  background-image: none !important;
  color: #E9E1D4;
  cursor: pointer;
  z-index: 3000;
  flex-shrink: 0;
}

body .mnav-bars { display: flex; flex-direction: column; gap: 4px; }
body .mnav-bars span {
  display: block;
  width: 18px;
  height: 2px;
  background: #E9E1D4;
  border-radius: 2px;
}
body .mnav-label { font-size: 14px; color: #E9E1D4; }

body .mnav-panel,
body #nav_catalog_output_id {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(86vw, 320px);
  height: auto;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: #1D1830;
  border: 1px solid #3A334B;
  border-radius: 16px;
  padding: 12px;
  margin: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  opacity: 1;
  visibility: visible;
  z-index: 3001;
}

body .mnav-panel.is-open,
body #nav_catalog_output_id.is-open {
  display: flex;
  max-height: calc(100vh - 140px);
  opacity: 1;
  visibility: visible;
}

body .mnav-panel a,
body #regis_button_mob_id,
body #button_profile_m_id {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: var(--ds-on-dark);
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}

body .mnav-panel a:hover,
body #regis_button_mob_id:hover,
body #button_profile_m_id:hover {
  background: rgba(216, 190, 134, .1);
  color: var(--gold-soft);
}

body #button_profile_m_id > div { width: 18px; height: 18px; display: grid; place-items: center; }
body #button_profile_m_id svg { width: 18px; height: 18px; }
body #button_profile_m_id > span { color: var(--ds-on-dark); }

body #regis_button_mob_id {
  background: var(--gold-soft);
  color: #241B0B;
  justify-content: center;
  font-weight: 700;
  margin-top: 8px;
}
body #regis_button_mob_id:hover { background: #E7D3A5; color: #241B0B; }

body .mnav-search { margin: 0 0 8px; }
body .mnav-search input {
  width: 100%;
  height: 42px;
  border: 1px solid #3A334B;
  border-radius: 10px;
  background: #12101F;
  color: #F5EFE3;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
}
body .mnav-search input::placeholder { color: #8B8299; }

/* Старые полосы поиска и бегущей строки: элементы остаются в DOM
   (их использует main_js.js), но в новой шапке не нужны. */
body .search_head_mobile_cl { display: none !important; }
body .moving_inscription_cl { display: none !important; }

/* ---------- 6. Подвал ---------- */
body .site-footer {
  width: 100%;
  max-width: none;
  min-height: 0;
  display: block;
  gap: 0;
  padding: 56px 0 28px;
  margin: 0;
  background: var(--ds-dark);
  color: var(--ds-on-dark-soft);
  font-size: 14px;
}

body .site-footer .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

body .site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 36px;
}

body .site-footer .logo-text b { color: #E9D9B4; }
body .site-footer .logo-text i { color: #9D94AC; }

body .footer-about {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: #9D94AC;
  max-width: 340px;
}

body .site-footer h3 {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ds-on-dark);
  margin: 0 0 14px;
  font-weight: 700;
}

body .site-footer nav { display: block; }
body .site-footer nav a,
body .site-footer .doc-links a {
  display: block;
  width: 100%;
  padding: 5px 0;
  font-size: 14px;
  color: var(--ds-on-dark-soft);
  text-decoration: none;
}
body .site-footer a:hover { color: var(--gold-soft); }

body .footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
body .footer-social__item {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #3A334B;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #D9D2C5;
  cursor: pointer;
  text-decoration: none;
}
body .footer-social__item:hover { border-color: var(--gold-soft); color: var(--gold-soft); }

body .footer-contact { font-size: 14px; line-height: 1.6; }
body .footer-contact div { margin-bottom: 10px; }
body .footer-contact b { color: var(--ds-on-dark); font-weight: 600; }
body .site-footer .footer-contact a,
body .site-footer #phone_id,
body .site-footer #mail_id { color: var(--ds-on-dark-soft); text-decoration: none; }

body .footer-sub {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--ds-dark-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
body .footer-sub b { display: block; color: var(--ds-on-dark); font-size: 15px; }
body .footer-sub span { display: block; color: var(--ds-on-dark-muted); font-size: 13px; margin-top: 4px; }
body .footer-sub-form { display: flex; gap: 10px; flex-wrap: wrap; }
body .footer-sub-form input {
  height: 44px;
  min-width: 170px;
  border: 1px solid #3A334B;
  border-radius: 12px;
  background: #1A152B;
  color: #F5EFE3;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
}
body .footer-sub-form input::placeholder { color: #8B8299; }
body .footer-sub-form #purchase_window_open_3_id {
  height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #241B0B;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

body .footer-disclaimer {
  margin-top: 24px;
  color: var(--ds-on-dark-muted);
  font-size: 12px;
  line-height: 1.55;
  max-width: 980px;
}

body .footer-bottom {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ds-dark-line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ds-on-dark-muted);
}

/* ---------- 7. Плавающие кнопки ---------- */
body .up_arrow_cl {
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(216, 190, 134, .35);
  border-radius: 50%;
  background-image: none;
  background-color: rgba(23, 19, 38, .92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  z-index: 950;
}
body .up_arrow_cl::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-left: 2px solid var(--gold-soft);
  border-top: 2px solid var(--gold-soft);
  transform: translate(-50%, -50%) rotate(45deg);
}
body .up_arrow_cl:hover {
  background-color: var(--indigo);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

body #message_nim_id {
  right: 24px;
  bottom: 84px;
  width: 48px;
  height: 48px;
  z-index: 949;
}
body #message_nim_id > section {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--indigo);
  display: grid;
  place-items: center;
}
body #message_nim_id > section > svg {
  width: 22px;
  height: 22px;
  color: var(--gold-soft);
}
body #message_nim_id > section > svg:hover { color: #F5E9CF; }

/* WhatsApp-пузырь заменён общей кнопкой чата (как на главной).
   Элемент остаётся в DOM: main_js.js вешает на него обработчик. */
body #whatsapp_logo_id { display: none; }

/* ---------- 8. Внутренние страницы: шапка теперь в потоке ----------
   Старые отступы (15vh / --top_offset) считались под fixed-шапку.
   Оставляем аккуратный зазор, чтобы не было пустого поля на пол-экрана. */
body .main_services_cl,
body .main_courses_cl,
body .main_seminars_cl,
body .main_articles_cl,
body .seo-page-container,
body #course_block_render_id,
body .pay_zone_cl,
body .search_page_cl,
body .main_body_contacts_cl,
body .agreement_block_cl,
body .main_body_schedule_cl,
body #faculty_direction_id,
body .pr_mat_zone_cl,
body .user_profile_cl {
  padding-top: var(--ds-top-gap) !important;
}

/* Юридические страницы: у <main> остаётся свой отступ — обнуляем. */
body .agreement_block_cl > main { padding-top: 0 !important; }

/* Главная сама управляет отступом hero. */
body.home-redesign .main-body,
body.home-redesign .home-main { padding-top: 0 !important; }

/* ---------- 9. Адаптив ---------- */
@media (max-width: 1120px) {
  body .site-head .nav,
  body .head-search,
  body .head-cta { display: none; }

  body .mobile_nav_catalog_cl { display: flex; }
}

@media (max-width: 900px) {
  body .site-footer .footer-grid { grid-template-columns: 1.2fr .8fr .8fr; }
  body .site-footer .footer-grid > div:last-child { grid-column: 1 / -1; }
  body .footer-sub { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  :root { --ds-top-gap: 28px; }

  body .topbar-left { display: none; }
  body .topbar .wrap { min-height: 30px; font-size: 11px; justify-content: space-between; }
  body .top-phone { white-space: nowrap; font-size: 13px; }

  body .site-head .wrap { padding: 0 18px; min-height: 66px; gap: 12px; }
  body .logo-mark { width: 36px; height: 36px; background-size: auto 36px; }
  body .logo-text b { font-size: 14px; }
  body .logo-text i { font-size: 9px; letter-spacing: .13em; }

  body .site-footer { padding: 44px 0 24px; }
  body .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  body .site-footer .footer-grid > div:first-child,
  body .site-footer .footer-grid > div:last-child { grid-column: 1 / -1; }
  body .footer-sub-form { width: 100%; }
  body .footer-sub-form input { flex: 1 1 150px; }

  body .up_arrow_cl { right: 14px; bottom: 14px; width: 44px; height: 44px; }
  body #message_nim_id { right: 14px; bottom: 72px; width: 44px; height: 44px; }
  body #message_nim_id > section { width: 44px; height: 44px; }
  body #message_nim_id > section > svg { width: 20px; height: 20px; }
}

@media (max-width: 460px) {
  body .site-footer .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  body .site-footer .footer-grid > div { min-width: 0; }
  body .site-footer .footer-about,
  body .site-footer .footer-disclaimer,
  body .site-footer nav a,
  body .site-footer .doc-links a { overflow-wrap: anywhere; }
  body .site-footer .wrap { padding: 0 16px; }
  body .footer-sub-form { gap: 8px; }
  body .footer-sub-form input { min-width: 0; }
}

@media (max-width: 430px) {
  body .site-head .logo-mark { width: 32px; height: 32px; background-size: auto 32px; }
  body .site-head .logo-text b { font-size: 12px; letter-spacing: .03em; }
  body .site-head .logo-text i { display: none; }
  body .mobile_nav_catalog_cl { padding: 0 10px; gap: 8px; }
  body .mnav-label { font-size: 13px; }
}

@media (max-width: 380px) {
  body .site-head .wrap { padding: 0 12px; gap: 8px; }
  body .site-head .logo-text b { font-size: 11px; letter-spacing: .04em; }
  body .mnav-label { display: none; }
  body .mobile_nav_catalog_cl { min-width: 40px; height: 40px; padding: 0 10px; }
  body .site-footer .wrap { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  body .site-head,
  body .btn,
  body .up_arrow_cl { transition: none !important; }
}

/* ---------- 10. Прямые ID-переопределения старых правил main_css.css ---------- */
body #regis_button_id,
body #button_profile_id {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #D9D2C5;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
body #button_profile_id { display: flex; align-items: center; gap: 6px; }
body #button_profile_id > div { width: 20px; height: 20px; margin: 0; }
body #button_profile_id > span { font-size: 13px; color: #D9D2C5; white-space: nowrap; }

body #subject_toggle_switch_id {
  position: static;
  top: auto;
  right: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  font-size: 12px;
  line-height: 1;
  color: #D9D2C5;
}
body #subject_toggle_switch_id > div {
  position: relative;
  width: 36px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: #3A334B;
  border: 1px solid #4A4260;
  display: block;
}
body #subject_toggle_switch_id > span {
  display: inline-block;
  position: static;
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  color: #D9D2C5;
  font-weight: 500;
}

body #intr_search_sheet_id {
  width: 100%;
  height: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: #F5EFE3;
  padding: 0;
  font: inherit;
  font-size: 13px;
}

/* «Подписаться» и подпись профиля скрыты в верхней полосе — как на главной.
   Подписка доступна в подвале, профиль — по иконке. */
html[data-theme] body #subject_toggle_switch_id > span {
  color: #D9D2C5;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
body #regis_button_id { display: none; }
body #button_profile_id > span { display: none; }

/* Мобильная верхняя полоса: телефон + тема. Профиль и «Подписаться»
   уходят в меню — иначе на 320 px полоса не влезает.
   Правила ниже ID-переопределений намеренно: иначе display: flex выше
   перебивает скрытие. */
@media (max-width: 720px) {
  body #button_profile_id,
  body #regis_button_id { display: none; }
  body #sub_tog_switch_text_id { display: none; }
}

/* Тёмная тема: общие элементы читаются в обеих темах.
   Шапка и подвал заданы фиксированной тёмной палитрой. */
html[data-theme="dark"] body .topbar { color: #BDB5C8; }
html[data-theme="dark"] body .site-footer { color: #BDB5C8; }


/* ============================================================
   12. Формы — единая система (16.11.2026)
   Поля, подписи, ошибки, согласие, кнопки. Используется в модале
   записи, формах /contacts, подписке в подвале, входе и отзыве.
   Спецификация: docs/Задачи после 3 переноса тестового сайта/2026-11-16_Формы_дизайн.md
   ============================================================ */

:root {
  --frm-h: 54px;
  --frm-r: 12px;
  --frm-line: #968A73;        /* рамка поля: 3,4:1 к белому */
  --frm-line-hover: #7A6E5B;
  --frm-danger: #8F1D2C;
  --frm-danger-bg: #FBEAEA;
  --frm-ok: #1E6B45;
}

html[data-theme="dark"] {
  --frm-line: #7A7294;
  --frm-line-hover: #9A92B0;
  --frm-danger: #F0A5A5;
  --frm-danger-bg: #2A1620;
  --frm-ok: #8FD3A8;
}

.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.fld__label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.fld__req { color: var(--frm-danger); font-weight: 700; }
.fld__opt { font-size: 13px; font-weight: 500; color: var(--muted); }
.fld__hint { font-size: 13px; line-height: 1.45; color: var(--muted); }

.ctl {
  width: 100%;
  min-height: var(--frm-h);
  padding: 0 16px;
  border: 1px solid var(--frm-line);
  border-radius: var(--frm-r);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.ctl::placeholder { color: var(--muted); opacity: 1; }
.ctl:hover { border-color: var(--frm-line-hover); }

.ctl:focus,
.ctl:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
  box-shadow: none;
}

textarea.ctl {
  min-height: 96px;
  padding: 13px 16px;
  resize: vertical;
}

select.ctl {
  padding-right: 46px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B5468' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
}

html[data-theme="dark"] select.ctl {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23B9B0C6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

select.ctl option { color: #211B2E; background: #FFFFFF; }
select.ctl:invalid { color: var(--muted); }

.fld--err .ctl {
  border-width: 2px;
  border-color: var(--frm-danger);
}

.fld--err .ctl:focus { outline-color: var(--frm-danger); }

.fld__err {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--frm-danger);
}

.fld__err svg { flex: 0 0 auto; margin-top: 1px; }

/* согласие */
.cns {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  margin: 2px 0 18px;
}

.cns__box {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  border: 2px solid var(--frm-line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background .15s ease, border-color .15s ease;
}

.cns__box:hover { border-color: var(--gold); }

.cns__box:checked {
  background: var(--indigo);
  border-color: var(--indigo);
}

.cns__box:checked::after {
  content: "";
  width: 14px;
  height: 8px;
  border-left: 2.5px solid #FFFFFF;
  border-bottom: 2.5px solid #FFFFFF;
  transform: rotate(-45deg) translate(1px, -2px);
}

.cns__box:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.cns__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.cns__text a {
  color: var(--gold-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cns--err .cns__box { border-color: var(--frm-danger); }

/* кнопки формы */
.frm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--indigo);
  color: #FFFFFF;
  font: 650 16px/1.2 inherit;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.frm-btn:hover { background: var(--indigo-soft); transform: translateY(-2px); }
html[data-theme="dark"] .frm-btn:hover { background: #5A4FBF; }
.frm-btn--block { width: 100%; }

.frm-btn--quiet {
  min-height: 44px;
  padding: 0 8px;
  background: none;
  border: 0;
  color: var(--muted);
  font: 500 15px/1.2 inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.frm-btn--quiet:hover { color: var(--ink); transform: none; }
.frm-btn[disabled] { opacity: .72; cursor: progress; transform: none; }

.frm-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

/* --- усиление под старые селекторы с id (main_css.css) --- */
#purchase_window_id .ctl,
#feedback_input_box_id .ctl {
  width: 100%;
  min-height: var(--frm-h);
  padding: 0 16px;
  border: 1px solid var(--frm-line);
  border-radius: var(--frm-r);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: normal;
  text-align: left;
  box-shadow: none;
}

#purchase_window_id textarea.ctl,
#feedback_input_box_id textarea.ctl {
  min-height: 96px;
  padding: 13px 16px;
}

#purchase_window_id .frm-btn,
#feedback_input_box_id .frm-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  background: var(--indigo);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 650;
  text-align: center;
  box-shadow: none;
}

#purchase_window_id .cns__box,
#feedback_input_box_id .cns__box {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 2px solid var(--frm-line);
  border-radius: 6px;
  background: var(--surface);
}

#purchase_window_id .cns__box:checked,
#feedback_input_box_id .cns__box:checked {
  background: var(--indigo);
  border-color: var(--indigo);
}


/* --- Модал «Записаться»: разметка новая, старые правила main_css гасим --- */
#purchase_window_id {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#purchase_window_id > div {
  width: min(480px, calc(100vw - 32px));
  max-height: 92vh;
  overflow-y: auto;
  padding: 0;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

#purchase_window_id .letters_to_you_two_cl {
  padding: 24px 22px;
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border-radius: 22px;
  backdrop-filter: none;
}

#purchase_window_id .style_name_block_cl {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 6px;
}

#purchase_window_id #back_x_from_the_tape_id {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#purchase_window_id #back_x_from_the_tape_id:hover {
  border-color: var(--gold);
  color: var(--gold-ink);
}

#purchase_window_id .frm-lead {
  margin: 0 0 18px;
  font-size: 15px;
}

#purchase_window_id .frm-btn--quiet {
  display: block;
  width: auto;
  min-height: 44px;
  margin: 10px auto 0;
  padding: 0 8px;
  border: 0;
  background: none;
  border-radius: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#purchase_window_id .frm-btn--quiet:hover {
  background: none;
  color: var(--ink);
  box-shadow: none;
}

/* окно должно быть выше шапки */
#purchase_window_id { z-index: 4000; }


/* --- Регистрация и окно кода (16.11.2026) --- */
html body #registration_window_id,
html body #password_entry_id {
  z-index: 4100;
  padding: 16px;
  align-items: center;
  justify-content: center;
}

html body #registration_window_id > div,
html body #password_entry_id > div {
  width: min(480px, calc(100vw - 32px));
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 22px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

html body #registration_window_id > div > div:first-child,
html body #password_entry_id > div > div:first-child {
  display: none; /* старые иконки */
}

html body #registration_window_id > div > span:first-of-type,
html body #password_entry_id > div > span:first-of-type {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 6px;
}

html body #registration_window_id .frm,
html body #password_entry_id .frm {
  width: 100%;
}

html body #registration_window_id .frm-btn--quiet,
html body #password_entry_id .frm-btn--quiet {
  margin: 10px auto 0;
  border: 0;
  background: none;
  color: var(--muted);
}

html body #password_entry_id .code-ctl {
  min-height: 60px;
  font-size: 24px;
  letter-spacing: .3em;
  text-align: center;
  padding: 0 0 0 .3em;
}

html body #password_entry_id #password_entry_back_id,
html body #registration_window_id #back_regis_window_id {
  align-self: center;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}


/* --- Подписка в подвале (16.11.2026) --- */
.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

html body .footer-sub-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

html body .footer-sub-form .ctl {
  flex: 1 1 150px;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  background: #1A152B;
  border-color: #6B6383;
  color: #F5EFE3;
}

html body .footer-sub-form .ctl::placeholder {
  color: #9A92A8;
}

html body .footer-sub-form .ctl:hover {
  border-color: #8E86A6;
}

html body .footer-sub-form .ctl:focus {
  outline: 2px solid #D8BE86;
  border-color: #D8BE86;
}

html body .footer-sub-form .frm-btn--gold {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 20px;
  background: #D8BE86;
  color: #241B0B;
  font-size: 15px;
  font-weight: 700;
}

html body .footer-sub-form .frm-btn--gold:hover {
  background: #E4CE9E;
  transform: none;
}

html body .footer-sub .cns--dark {
  margin: 12px 0 0;
  max-width: 520px;
}

html body .footer-sub .cns--dark .cns__box {
  width: 22px;
  height: 22px;
  background: #1A152B;
  border-color: #6B6383;
}

html body .footer-sub .cns--dark .cns__box:checked {
  background: #D8BE86;
  border-color: #D8BE86;
}

html body .footer-sub .cns--dark .cns__box:checked::after {
  border-color: #241B0B;
}

html body .footer-sub .cns--dark .cns__text {
  font-size: 13px;
  line-height: 1.5;
  color: #B9B0C6;
}

html body .footer-sub .cns--dark .cns__text a {
  color: #D8BE86;
}

@media (max-width: 720px) {
  html body .footer-sub-form {
    width: 100%;
  }
  html body .footer-sub-form .frm-btn--gold {
    flex: 1 1 100%;
    justify-content: center;
  }
}


/* --- Cookie-баннер (16.11.2026) --- */
html body #cookie_agreement_block_id {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: min(620px, calc(100vw - 32px));
  height: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.5;
  z-index: 950;
  transform: translateY(75vh);
  transition: transform .6s ease;
}

html body #cookie_agreement_block_id .cookie_text_cl {
  flex: 1 1 300px;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: break-word;
}

html body #cookie_agreement_block_id .cookie_text_cl b {
  font-weight: 650;
}

html body #cookie_agreement_block_id .cookie_text_cl a {
  color: var(--gold-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html body #cookie_agreement_block_id .cookie_buttons_cl {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
}

html body #cookie_agreement_block_id .cookie_buttons_cl > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

html body #cookie_agreement_block_id #accept_cookies_id {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #FFFFFF;
}

html body #cookie_agreement_block_id #accept_cookies_id:hover {
  background: var(--indigo-soft);
  border-color: var(--indigo-soft);
  filter: none;
}

html body #cookie_agreement_block_id #no_accept_cookies_id {
  background: transparent;
  border-color: var(--frm-line);
  color: var(--ink);
}

html body #cookie_agreement_block_id #no_accept_cookies_id:hover {
  border-color: var(--ink);
  color: var(--ink);
}

@media (max-width: 800px) {
  html body #cookie_agreement_block_id {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    padding: 14px 14px;
    gap: 12px;
    border-radius: 14px;
    font-size: 13px;
  }
  html body #cookie_agreement_block_id .cookie_text_cl {
    flex: 1 1 100%;
    font-size: 13px;
  }
  html body #cookie_agreement_block_id .cookie_buttons_cl {
    flex: 1 1 100%;
  }
  html body #cookie_agreement_block_id .cookie_buttons_cl > div {
    flex: 1 1 0;
    padding: 0 10px;
  }
}


/* --- Панель «Написать в школу» (16.11.2026) --- */
html body #feedback_chat_id {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: min(78vh, 640px);
  overflow: hidden;
  z-index: 1200;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: block;
}

html body #feedback_chat_id[hidden] {
  display: none;
}

html body #feedback_chat_id .chat-panel {
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 640px);
}

html body #feedback_chat_id .chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--indigo);
  color: #FFFFFF;
}

html body #feedback_chat_id .chat-panel__title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
}

html body #feedback_chat_id .chat-panel__status {
  font-size: 13px;
  color: #CFC7E6;
  margin-top: 2px;
}

html body #feedback_chat_id .chat-panel__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: none;
  color: #FFFFFF;
  cursor: pointer;
}

html body #feedback_chat_id .chat-panel__close:hover {
  border-color: #FFFFFF;
}

html body #feedback_chat_id .chat-panel__body {
  padding: 18px;
  overflow-y: auto;
}

html body #feedback_chat_id .fld {
  margin-bottom: 14px;
}

html body #feedback_chat_id .cns {
  margin-bottom: 14px;
}

html body #feedback_chat_id .chat-panel__ok {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 4px 8px;
  text-align: center;
}

html body #feedback_chat_id .chat-panel__ok b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink);
}

html body #feedback_chat_id .chat-panel__ok span {
  font-size: 15px;
  color: var(--muted);
}

html body #feedback_chat_id .chat-panel__ok[hidden] {
  display: none;
}

@media (max-width: 480px) {
  html body #feedback_chat_id {
    right: 12px;
    left: 12px;
    bottom: 80px;
    width: auto;
    max-height: 76vh;
  }
}


/* --- Вторая (необязательная) галочка: письма о программах --- */
.cns--optional {
  margin-top: -6px;
  margin-bottom: 18px;
  gap: 10px;
}

.cns--optional .cns__box {
  width: 22px;
  height: 22px;
  border-width: 2px;
  border-color: var(--line-strong);
}

.cns--optional .cns__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

html body .footer-sub .cns--optional {
  margin-top: 8px;
}


/* подпись всегда светлая: id+id перебивает старое правило main_css */
html[data-theme] body #subject_toggle_switch_id #sub_tog_switch_text_id {
  color: #E5DDD0;
}


/* --- Модал отзыва (16.11.2026) --- */
html body #feedback_input_box_id {
  z-index: 4100;
  padding: 16px;
  align-items: center;
  justify-content: center;
}

html body #feedback_input_box_id > div {
  width: min(480px, calc(100vw - 32px));
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 22px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0;
}

html body #feedback_input_box_id > div > span:first-child {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

html body #feedback_input_box_id .cns {
  margin: 12px 0;
}

html body #feedback_input_box_id .cns--optional {
  margin: 0 0 12px;
}

html body #feedback_input_box_id .fld__err {
  margin: 4px 0 10px;
}

html body #feedback_input_box_id .frm-lead {
  margin: 6px 0 12px;
  font-size: 14px;
}


/* Ссылки внутри текста форм: стандартный синий на тёмном давал 1,86:1 */
.frm-lead a,
.fld__hint a,
.cns__text a,
.chat-panel__ok a {
  color: var(--gold-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.frm-lead a:hover,
.fld__hint a:hover {
  color: var(--indigo);
}

html[data-theme="dark"] .frm-lead a:hover,
html[data-theme="dark"] .fld__hint a:hover {
  color: var(--gold-soft);
}
