/* =====================================================================
   Современное оформление сайта
   Подключается после style.css и перед accessibility.css:
   режимы для слабовидящих по-прежнему имеют приоритет.
   Фирменные цвета меняются в блоке :root ниже.
   ===================================================================== */

:root {
    --brand-900: #0b2447;
    --brand-800: #0f3b73;
    --brand-700: #14509a;
    --brand-600: #1f6fb5;
    --brand-500: #2a86d0;
    --brand-400: #5dafdf;
    --brand-100: #e3effb;
    --brand-50:  #f1f7fd;
    --accent:    #f5a623;
    --ink:       #14213d;
    --muted:     #5b6b86;
    --line:      rgba(15, 59, 115, .10);

    /* Переопределяем переменные, которые использует style.css */
    --primary-color: var(--brand-600);
    --primary-dark:  var(--brand-800);
    --heading-color: var(--brand-900);
    --page-bg: #f4f8fc;
    --text-muted-color: var(--muted);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 1px 2px rgba(11, 36, 71, .04), 0 6px 18px rgba(11, 36, 71, .06);
    --shadow-md: 0 14px 34px rgba(11, 36, 71, .12);
    --shadow-lg: 0 24px 54px rgba(11, 36, 71, .18);

    /* Переменные Bootstrap 5: меняют цвет .text-primary, .bg-primary, ссылок и т.д. */
    --bs-primary: #1f6fb5;
    --bs-primary-rgb: 31, 111, 181;
    --bs-link-color: #1f6fb5;
    --bs-link-color-rgb: 31, 111, 181;
    --bs-link-hover-color: #0f3b73;
    --bs-link-hover-color-rgb: 15, 59, 115;
    --bs-body-color: #33415c;
}

body {
    background: var(--page-bg);
    color: #33415c;
    font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; }
h1 { font-weight: 800; }
h2 { font-weight: 800; }

::selection { background: rgba(42, 134, 208, .25); }

/* ---------------------------------------------------------------------
   Верхняя полоса
   --------------------------------------------------------------------- */
.topbar {
    background: var(--brand-900);
    color: rgba(255, 255, 255, .78);
    font-size: .83rem;
    padding: 8px 0;
}
.topbar a, .topbar span { color: rgba(255, 255, 255, .82); text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar-contacts { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.topbar-contacts i { color: var(--brand-400); margin-right: 8px; font-size: .8rem; }
.topbar-links a { font-weight: 600; }

/* ---------------------------------------------------------------------
   Навигация
   --------------------------------------------------------------------- */
.site-nav {
    background: rgba(255, 255, 255, .88) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    padding: .55rem 0;
    transition: box-shadow .25s ease, background .25s ease;
}
.site-nav.is-scrolled { box-shadow: 0 10px 30px rgba(11, 36, 71, .10); background: rgba(255, 255, 255, .96) !important; }

.site-brand { display: flex; align-items: center; gap: 12px; margin-right: 1rem; padding: 0; }
.site-logo { height: 52px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.site-logo-fallback {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; color: #fff; font-size: 1.25rem;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
    box-shadow: 0 6px 16px rgba(31, 111, 181, .35);
}
.site-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.site-brand-text strong { color: var(--brand-900); font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.site-brand-text small { color: var(--muted); font-size: .72rem; font-weight: 500; margin-top: 3px; }

.site-nav .navbar-nav .nav-link {
    color: #1b2b4b;
    font-weight: 600;
    font-size: .95rem;
    margin: 0 2px;
    padding: .55rem .95rem;
    border-radius: 12px;
}
.site-nav .navbar-nav .nav-link:hover,
.site-nav .navbar-nav .nav-link:focus { background: var(--brand-50); color: var(--brand-600); }
.site-nav .navbar-nav .nav-link.active,
.site-nav .navbar-nav .show > .nav-link { background: var(--brand-100); color: var(--brand-700); }

.site-nav .dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 8px;
    box-shadow: var(--shadow-md);
    margin-top: 8px;
}
.site-nav .dropdown-item { border-radius: 10px; padding: .55rem .85rem; font-weight: 500; }
.site-nav .dropdown-item:hover { background: var(--brand-50); color: var(--brand-700); }

.site-nav .navbar-toggler { border: 1px solid var(--line); border-radius: 12px; padding: .45rem .65rem; }
.site-nav .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(42, 134, 208, .25); }

.nav-cta { padding: .6rem 1.25rem; border-radius: 14px; white-space: nowrap; }

@media (max-width: 991.98px) {
    .site-nav .navbar-collapse {
        margin-top: .75rem; padding: .75rem; background: #fff;
        border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-md);
    }
    .site-nav .navbar-nav .nav-link { padding: .7rem .9rem; }
    .nav-cta { width: 100%; }
    .site-brand-text strong { font-size: .95rem; }
    .site-logo { height: 44px; }
}

/* ---------------------------------------------------------------------
   Шапки страниц (hero)
   --------------------------------------------------------------------- */
main .hero-section,
main .page-header.bg-primary {
    position: relative;
    color: #fff;
    background-image:
        radial-gradient(900px 420px at 88% -10%, rgba(93, 175, 223, .50), transparent 62%),
        radial-gradient(700px 380px at -8% 115%, rgba(42, 134, 208, .38), transparent 62%),
        linear-gradient(135deg, var(--brand-900) 0%, var(--brand-800) 45%, var(--brand-600) 100%);
    background-color: var(--brand-800);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding-top: clamp(56px, 7vw, 96px) !important;
    padding-bottom: clamp(64px, 8vw, 110px) !important;
}
main .hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' fill-opacity='.07' d='M0,224L60,213.3C120,203,240,181,360,186.7C480,192,600,224,720,229.3C840,235,960,213,1080,181.3C1200,149,1320,107,1380,85.3L1440,64L1440,320L0,320Z'/%3E%3C/svg%3E") bottom / 100% 55% no-repeat;
    opacity: 1;
    pointer-events: none;
}
main .hero-section::after {
    content: '';
    position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 0 0 60px rgba(255, 255, 255, .03), 0 0 0 120px rgba(255, 255, 255, .02);
    pointer-events: none;
}
main .hero-section > .container,
main .page-header > .container { position: relative; z-index: 2; }

main .hero-section h1,
main .page-header h1 { color: #fff; font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
main .hero-section h1.display-4 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
main .hero-section h1.display-5 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
main .hero-section .lead { color: rgba(255, 255, 255, .86); font-weight: 400; max-width: 46rem; }

/* Иконка справа — «стеклянный» круг */
main .hero-section i.display-1 {
    display: inline-flex; align-items: center; justify-content: center;
    width: 190px; height: 190px; font-size: 4.6rem; border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .18), inset 0 0 40px rgba(255, 255, 255, .08);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 1 !important; color: #fff;
}

/* Хлебные крошки в шапке */
main .hero-section .breadcrumb { margin: 0; padding: 0; background: transparent; font-size: .9rem; }
main .hero-section .breadcrumb a { color: rgba(255, 255, 255, .9) !important; text-decoration: none; }
main .hero-section .breadcrumb a:hover { color: #fff !important; text-decoration: underline; }
main .hero-section .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .5); }

@media (max-width: 768px) {
    main .hero-section i.display-1 { width: 130px; height: 130px; font-size: 3.2rem; }
}

/* ---------------------------------------------------------------------
   Секции и заголовки
   --------------------------------------------------------------------- */
main section.bg-light { background: #eef4fb !important; }
main section.bg-primary.text-white:not(.hero-section) {
    background-image:
        radial-gradient(700px 300px at 90% 0%, rgba(93, 175, 223, .40), transparent 60%),
        linear-gradient(135deg, var(--brand-800), var(--brand-600));
    background-color: var(--brand-700);
}
main section.bg-dark.text-white { background-image: linear-gradient(135deg, #0b2447, #14213d); background-color: #0b2447; }
main section.bg-primary.text-white h2,
main section.bg-dark.text-white h2,
main .hero-section h2 { color: #fff; }

.section-title { position: relative; }
.section-title::after {
    content: ''; display: block; width: 56px; height: 4px; border-radius: 4px; margin: 14px 0 0;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
}
.text-center .section-title::after, .text-center.section-title::after,
.section-title.text-center::after { margin-left: auto; margin-right: auto; }

.lead { font-weight: 400; }

/* ---------------------------------------------------------------------
   Карточки
   --------------------------------------------------------------------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.news-card:hover, .program-card:hover, .advantage-card:hover, .team-card:hover, .certificate-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md) !important;
    border-color: rgba(42, 134, 208, .45);
}
.card-footer { border-top: 0; }
.card-header.bg-primary,
.card-header.bg-gradient-primary,
.bg-gradient-primary {
    background-image: linear-gradient(135deg, var(--brand-600), var(--brand-800)) !important;
    background-color: var(--brand-700) !important;
}

.program-icon, .advantage-icon, .contact-icon {
    background: linear-gradient(135deg, var(--brand-100), #cde3f7) !important;
    border-radius: 16px !important;
}
.program-icon i, .advantage-icon i, .contact-icon i { color: var(--brand-600) !important; }
.photo-placeholder { background: linear-gradient(135deg, var(--brand-500), var(--brand-800)) !important; }

/* Карточки новостей */
.news-card .card-title { font-weight: 800; color: var(--brand-900); }
.news-card .card-footer { background: transparent; }

/* ---------------------------------------------------------------------
   Кнопки
   --------------------------------------------------------------------- */
.btn { border-radius: 12px; font-weight: 700; letter-spacing: 0; }
.btn-lg { padding: .8rem 1.8rem; border-radius: 14px; }
.btn-primary {
    background-image: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%);
    background-color: var(--brand-600);
    border: 0; color: #fff;
    box-shadow: 0 8px 20px rgba(31, 111, 181, .30);
}
.btn-primary:hover, .btn-primary:focus {
    background-image: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-800) 100%);
    box-shadow: 0 12px 26px rgba(31, 111, 181, .40);
    transform: translateY(-2px);
}
.btn-outline-primary { color: var(--brand-600); border: 2px solid var(--brand-600); background: transparent; }
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--brand-600); border-color: var(--brand-600); color: #fff; transform: translateY(-2px);
}
.btn-success, .btn-outline-success { border-radius: 12px; }

/* Кнопки на цветном фоне (hero, блоки) */
.btn-white { border: 0 !important; color: var(--brand-800) !important; border-radius: 14px !important; padding: .8rem 1.7rem !important; font-weight: 700; }
.btn-white:hover { background: #fff !important; color: var(--brand-600) !important; box-shadow: 0 14px 30px rgba(0, 0, 0, .22) !important; }
.btn-outline-white { border: 2px solid rgba(255, 255, 255, .85) !important; border-radius: 14px !important; padding: .75rem 1.7rem !important; }
.btn-outline-white:hover { background: rgba(255, 255, 255, .14) !important; }

/* ---------------------------------------------------------------------
   Формы, бейджи, вкладки, таблицы, окна
   --------------------------------------------------------------------- */
.form-control, .form-select {
    border: 1px solid #d3deec; border-radius: 12px; padding: .65rem .95rem; background-color: #fff;
}
.form-control:focus, .form-select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 .22rem rgba(42, 134, 208, .20); }
.input-group > .form-control { border-radius: 12px; }
.badge { font-weight: 700; border-radius: 999px; padding: .45em .8em; }

.nav-pills .nav-link { border-radius: 12px; font-weight: 700; color: var(--brand-700); background: #fff; border: 1px solid var(--line); }
.nav-pills .nav-link:hover { background: var(--brand-50); }
.nav-pills .nav-link.active { background-image: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; border-color: transparent; }

.page-link { border-radius: 10px !important; margin: 0 3px; border: 1px solid var(--line); color: var(--brand-700); }
.page-item.active .page-link { background: var(--brand-600); border-color: var(--brand-600); }

.alert { border: 0; border-radius: 14px; }
.accordion-item { border: 1px solid var(--line); border-radius: 14px !important; overflow: hidden; margin-bottom: .6rem; }
.accordion-button:not(.collapsed) { background: var(--brand-50); color: var(--brand-700); }

.table { --bs-table-bg: transparent; }
.table thead th { background: var(--brand-50); color: var(--brand-800); border-bottom: 2px solid var(--brand-100); font-weight: 700; }

.modal-content { border: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header.bg-primary { background-image: linear-gradient(135deg, var(--brand-600), var(--brand-800)); background-color: var(--brand-700) !important; }

.breadcrumb-item a { text-decoration: none; }

/* ---------------------------------------------------------------------
   Блок «Показатели»
   --------------------------------------------------------------------- */
.stat-card {
    height: 100%; padding: 28px 20px; text-align: center; border-radius: var(--radius-md);
    background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center; color: var(--brand-600);
    background: linear-gradient(135deg, var(--brand-100), #cde3f7);
}
.stat-card .stat-number {
    font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--brand-700);
}
.stat-card .stat-label { margin-top: 8px; color: var(--muted); font-weight: 600; font-size: .95rem; }

/* ---------------------------------------------------------------------
   Футер
   --------------------------------------------------------------------- */
.site-footer {
    position: relative;
    margin-top: 4.5rem !important;
    background: linear-gradient(180deg, var(--brand-900) 0%, #071a35 100%) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.site-footer::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-400), var(--accent));
}
.site-footer h6 {
    text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 800; color: var(--brand-400) !important;
}
.site-footer .text-primary { color: var(--brand-400) !important; }
.site-footer .footer-link { color: rgba(255, 255, 255, .72) !important; }
.site-footer .footer-link:hover { color: #fff !important; }
.site-footer hr { border-color: rgba(255, 255, 255, .14) !important; opacity: 1; }
.footer-brand { gap: 14px; }
.footer-logo {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border-radius: 14px; padding: 8px 12px; flex: 0 0 auto;
}
.footer-logo img { height: 44px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.footer-logo-fallback { width: 52px; height: 52px; padding: 0; color: var(--brand-600); font-size: 1.4rem; }

/* ---------------------------------------------------------------------
   Кнопка «наверх»
   --------------------------------------------------------------------- */
.back-to-top {
    background: #fff !important; color: var(--brand-600) !important;
    border: 1px solid var(--line) !important; box-shadow: var(--shadow-md) !important;
}
.back-to-top:hover { background: var(--brand-600) !important; color: #fff !important; }

/* Страница «Контакты»: перекрашиваем фиолетовые акценты чата */
main .bot-message .message-avatar { background: var(--brand-600); }
main .user-message .message-content { background: var(--brand-600); }

/* ---------------------------------------------------------------------
   Появление при прокрутке (классы добавляет js/modern.js)
   --------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    * { scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------------
   Режим для слабовидящих: шапка и футер остаются читаемыми
   --------------------------------------------------------------------- */
html[class*="a11y-"] .reveal { opacity: 1 !important; transform: none !important; }
html[class*="a11y-scheme-"] .site-nav { background: #000 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.a11y-scheme-blue .site-nav { background: #17223b !important; }
html[class*="a11y-scheme-"] .topbar { background: #000 !important; }
html.a11y-scheme-blue .topbar { background: #17223b !important; }
html[class*="a11y-scheme-"] .site-nav .nav-link,
html[class*="a11y-scheme-"] .site-brand-text strong,
html[class*="a11y-scheme-"] .site-brand-text small,
html[class*="a11y-scheme-"] .topbar a,
html[class*="a11y-scheme-"] .topbar span { color: #fff !important; }
html.a11y-scheme-wb .site-nav .nav-link,
html.a11y-scheme-wb .topbar a { color: #ffe07d !important; }
html[class*="a11y-scheme-"] .site-nav .nav-link.active { outline: 2px solid currentColor; background: transparent; }
html[class*="a11y-scheme-"] .site-footer,
html[class*="a11y-scheme-"] main .hero-section { border-radius: 0; }
html[class*="a11y-scheme-"] .stat-card .stat-number { -webkit-text-fill-color: currentColor; background: none; color: inherit; }
html[class*="a11y-scheme-"] .site-footer h6 { color: inherit !important; }


/* ---------------------------------------------------------------------
   Категории программ: карточки, плитки, шапка категории
   --------------------------------------------------------------------- */
.cc-logo {
    width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-100), #cde3f7); color: var(--brand-600); font-size: 1.7rem;
}
.cc-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #fff; }

.cc-title { font-size: 1.2rem; font-weight: 800; margin: 0; line-height: 1.2; color: var(--brand-900); }
.cc-title a { color: inherit; text-decoration: none; }
.cc-title a:hover { color: var(--brand-600); }
.cc-count {
    display: inline-block; margin-top: 6px; padding: 2px 11px; border-radius: 999px;
    background: var(--brand-100); color: var(--brand-700); font-size: .8rem; font-weight: 700;
}
.cc-desc { color: var(--muted); font-size: .93rem; margin-bottom: 12px; }

.category-card {
    display: flex; flex-direction: column; height: 100%; padding: 22px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: rgba(42, 134, 208, .45); }
.cc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cc-chips a {
    padding: 3px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--brand-50);
    color: var(--brand-700); font-size: .8rem; font-weight: 600; text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.cc-chips a:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.cc-list { list-style: none; margin: 0 0 12px; padding: 0; flex: 1 1 auto; }
.cc-list li + li { border-top: 1px dashed var(--line); }
.cc-list a { display: flex; align-items: center; gap: 10px; padding: 9px 2px; color: #33415c; text-decoration: none; font-weight: 600; font-size: .93rem; }
.cc-list a i { color: var(--brand-500); width: 1.2em; text-align: center; flex: 0 0 auto; }
.cc-list a:hover { color: var(--brand-600); }
.cc-list .cc-meta { margin-left: auto; padding-left: 8px; color: var(--muted); font-weight: 500; font-size: .8rem; white-space: nowrap; }
.cc-rest { margin: -4px 0 14px; color: var(--muted); font-size: .85rem; font-weight: 600; }

.category-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%;
    padding: 30px 20px 22px; overflow: hidden;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    color: #33415c; text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.category-tile::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
    transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.category-tile:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: rgba(42, 134, 208, .45); color: #33415c; }
.category-tile:hover::before { transform: scaleX(1); }
.category-tile .cc-logo { width: 84px; height: 84px; flex-basis: 84px; border-radius: 24px; font-size: 2.2rem; margin-bottom: 16px; }
.category-tile .cc-arrow { margin-top: auto; padding-top: 18px; color: var(--brand-600); font-weight: 700; font-size: .9rem; }
.category-tile .cc-arrow i { transition: transform .2s ease; }
.category-tile:hover .cc-arrow i { transform: translateX(4px); }

/* Шапка выбранной категории в каталоге */
.category-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 22px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.category-banner .cc-logo { width: 84px; height: 84px; flex-basis: 84px; border-radius: 24px; font-size: 2.2rem; }
.category-banner .cb-text { flex: 1 1 280px; min-width: 0; }
.category-banner h2 { margin: 0 0 6px; font-size: 1.6rem; }
.category-banner .cb-crumbs { margin-bottom: 4px; font-size: .85rem; color: var(--muted); }
.category-banner .cb-crumbs a { color: var(--brand-600); text-decoration: none; }
.category-banner .cb-crumbs a:hover { text-decoration: underline; }

@media (max-width: 575.98px) {
    .category-tile { padding: 22px 12px 16px; }
    .category-tile .cc-logo { width: 64px; height: 64px; flex-basis: 64px; font-size: 1.7rem; border-radius: 18px; }
    .category-tile .cc-title { font-size: 1rem; }
    .category-tile .cc-arrow { font-size: .8rem; }
    .category-card { padding: 18px; }
}

html[class*="a11y-scheme-"] .category-card,
html[class*="a11y-scheme-"] .category-tile,
html[class*="a11y-scheme-"] .category-banner { background: transparent !important; border: 2px solid currentColor !important; box-shadow: none !important; color: inherit !important; }
html[class*="a11y-scheme-"] .cc-title, html[class*="a11y-scheme-"] .cc-count, html[class*="a11y-scheme-"] .cc-desc,
html[class*="a11y-scheme-"] .cc-list a { color: inherit !important; background: transparent !important; }


/* ---------------------------------------------------------------------
   Каталог программ: секции-подкатегории, сетка и «лента»
   --------------------------------------------------------------------- */
.view-switch {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.view-switch .vs-label { padding: 0 8px 0 10px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.view-switch button {
    border: 0; background: transparent; border-radius: 9px; padding: 6px 12px;
    color: var(--brand-700); font-size: .88rem; font-weight: 700; cursor: pointer; white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.view-switch button:hover { background: var(--brand-50); }
.view-switch button.active { background: var(--brand-600); color: #fff; }

.prg-section + .prg-section { margin-top: 44px; }
.prg-section-head {
    display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-bottom: 14px;
    border-bottom: 2px solid var(--brand-100);
}
.prg-section-head .cc-logo { width: 52px; height: 52px; flex-basis: 52px; border-radius: 15px; font-size: 1.4rem; }
.prg-section-title { flex: 1 1 auto; min-width: 0; }
.prg-section-title h3 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--brand-900); line-height: 1.2; }
.prg-section-title .cc-count { margin-top: 4px; }
.prg-section-link { flex: 0 0 auto; color: var(--brand-600); font-weight: 700; text-decoration: none; white-space: nowrap; }
.prg-section-link:hover { color: var(--brand-800); text-decoration: underline; }

/* Сетка: число колонок задаёт переключатель (data-view у #prgWrap) */
.prg-wrap { --prg-cols: 3; }
.prg-wrap[data-view="2"] { --prg-cols: 2; }
.prg-wrap[data-view="3"] { --prg-cols: 3; }
.prg-wrap[data-view="4"] { --prg-cols: 4; }
.prg-grid { display: grid; gap: 24px; grid-template-columns: repeat(var(--prg-cols), minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 1199.98px) { .prg-wrap[data-view="4"] .prg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991.98px)  { .prg-wrap:not([data-view="list"]) .prg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px)  {
    .prg-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 16px; }
    .view-switch .vs-hide { display: none; }
}

.prg-card {
    display: flex; flex-direction: column; min-width: 0;
    background: #fff; border: 1px solid #e9ecef; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.prg-main { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; padding: 20px 20px 8px; min-width: 0; }
.prg-text { min-width: 0; }
.prg-cat {
    display: inline-block; max-width: 100%; margin-bottom: 8px; padding: 3px 10px; border-radius: 8px;
    background: var(--brand-50); border: 1px solid var(--line); color: var(--brand-700);
    font-size: .74rem; font-weight: 700; line-height: 1.3; white-space: normal; overflow-wrap: anywhere;
}
.prg-title { margin: 0 0 8px; font-size: 1.12rem; font-weight: 800; line-height: 1.3; color: var(--brand-900); overflow-wrap: anywhere; }
.prg-desc {
    margin: 0 0 12px; color: var(--muted); font-size: .92rem; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.prg-topics { list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.prg-topics li { display: flex; gap: 8px; margin-bottom: 4px; }
.prg-topics li i { color: #198754; font-size: .7rem; margin-top: .4em; flex: 0 0 auto; }
.prg-topics li.more { color: var(--brand-600); font-weight: 600; padding-left: 18px; }

.prg-side { padding: 8px 20px 20px; }
.prg-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 12px; font-size: .88rem; color: var(--muted); }
.prg-meta:empty { display: none; }
.prg-price { margin-left: auto; color: var(--brand-600); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.prg-side .btn { width: 100%; }

/* Лента: одна программа — одна строка */
.prg-wrap[data-view="list"] .prg-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.prg-wrap[data-view="list"] .prg-card { flex-direction: row; align-items: center; }
.prg-wrap[data-view="list"] .prg-main { flex-direction: row; align-items: flex-start; padding: 18px 20px; gap: 18px; }
.prg-wrap[data-view="list"] .prg-desc { -webkit-line-clamp: 2; margin-bottom: 8px; }
.prg-wrap[data-view="list"] .prg-topics { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.prg-wrap[data-view="list"] .prg-topics li { margin-bottom: 0; }
.prg-wrap[data-view="list"] .prg-topics li.more { padding-left: 0; }
.prg-wrap[data-view="list"] .prg-side {
    flex: 0 0 230px; display: flex; flex-direction: column; align-items: stretch; justify-content: center;
    padding: 18px 20px; border-left: 1px solid var(--line); align-self: stretch;
}
.prg-wrap[data-view="list"] .prg-meta { flex-direction: column; align-items: flex-end; gap: 2px; margin-bottom: 10px; }
.prg-wrap[data-view="list"] .prg-price { margin-left: 0; }
@media (max-width: 767.98px) {
    .prg-wrap[data-view="list"] .prg-card { flex-direction: column; align-items: stretch; }
    .prg-wrap[data-view="list"] .prg-main { flex-direction: column; padding: 18px 18px 6px; }
    .prg-wrap[data-view="list"] .prg-side { flex-basis: auto; border-left: 0; padding: 6px 18px 18px; }
    .prg-wrap[data-view="list"] .prg-meta { flex-direction: row; align-items: center; }
}

html[class*="a11y-scheme-"] .prg-card { background: transparent !important; border: 2px solid currentColor !important; box-shadow: none !important; }
html[class*="a11y-scheme-"] .prg-title, html[class*="a11y-scheme-"] .prg-desc, html[class*="a11y-scheme-"] .prg-topics,
html[class*="a11y-scheme-"] .prg-meta, html[class*="a11y-scheme-"] .prg-price, html[class*="a11y-scheme-"] .prg-cat { color: inherit !important; }
html[class*="a11y-scheme-"] .view-switch { background: transparent; border: 2px solid currentColor; }
html[class*="a11y-scheme-"] .view-switch button { color: inherit !important; }
html[class*="a11y-scheme-"] .view-switch button.active { outline: 2px solid currentColor; background: transparent; }

.prg-card .program-icon { width: 60px; height: 60px; flex: 0 0 60px; align-self: flex-start; display: flex; align-items: center; justify-content: center; }


/* ---------------------------------------------------------------------
   Окно программы («Подробнее»)
   --------------------------------------------------------------------- */
.prg-modal .modal-content { border: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.pm-head {
    display: flex; align-items: center; gap: 16px; padding: 20px 24px; border: 0; color: #fff;
    background-image: radial-gradient(500px 220px at 95% 0%, rgba(93, 175, 223, .5), transparent 60%), linear-gradient(135deg, var(--brand-900), var(--brand-600));
    background-color: var(--brand-800);
}
.pm-icon {
    width: 56px; height: 56px; flex: 0 0 56px; border-radius: 16px; font-size: 1.5rem; color: #fff;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3);
}
.pm-titles { flex: 1 1 auto; min-width: 0; }
.pm-titles .modal-title { margin: 0; color: #fff; font-size: 1.25rem; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.pm-crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.pm-crumbs a { color: rgba(255, 255, 255, .92); text-decoration: none; }
.pm-crumbs a:hover { color: #fff; text-decoration: underline; }
.pm-head .btn-close { align-self: flex-start; opacity: .85; }

.prg-modal .modal-body { padding: 24px; background: #fff; }
.pm-h { margin: 0 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.pm-desc { margin-bottom: 22px; color: #33415c; font-size: .98rem; line-height: 1.6; overflow-wrap: anywhere; }
.pm-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.pm-list li {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
    background: var(--brand-50); color: #1b2b4b; font-weight: 600; font-size: .92rem;
}
.pm-list li i { flex: 0 0 auto; color: #198754; font-size: .8rem; }

.pm-info { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--brand-50); }
.pm-row + .pm-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.pm-row .pm-label { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.pm-row .pm-label i { width: 1.1em; text-align: center; color: var(--brand-500); }
.pm-row strong { color: var(--brand-900); font-size: 1rem; overflow-wrap: anywhere; }
.pm-price { color: var(--brand-600) !important; font-size: 1.5rem !important; font-weight: 800; letter-spacing: -.02em; }
.pm-price-ask { color: var(--muted) !important; font-size: .9rem !important; font-weight: 600; }
.pm-cat { color: var(--brand-600); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.pm-cat:hover { color: var(--brand-800); text-decoration: underline; }
.pm-cat i { font-size: .7em; margin-left: 4px; }

.pm-bot {
    display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px;
    border: 1px solid #cfe3f5; border-radius: 16px; background: #fff;
}
.pm-bot img { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(31, 111, 181, .3); background: #5dafdf; }
.pm-bot strong { display: block; color: var(--brand-900); font-size: .92rem; }
.pm-bot span { display: block; margin-top: 2px; color: var(--muted); font-size: .8rem; line-height: 1.35; }

.prg-modal .modal-footer { gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--brand-50); }

/* Кнопка записи с логотипом бота */
.btn-bot { display: inline-flex; align-items: center; gap: 10px; padding: .45rem 1.25rem .45rem .5rem; border-radius: 999px; }
.btn-bot-img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: #5dafdf; object-fit: cover; flex: 0 0 auto; }

@media (max-width: 575.98px) {
    .pm-head { padding: 16px; gap: 12px; }
    .pm-icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 1.2rem; border-radius: 13px; }
    .pm-titles .modal-title { font-size: 1.05rem; }
    .prg-modal .modal-body { padding: 16px; }
    .prg-modal .modal-footer { flex-direction: column-reverse; align-items: stretch; padding: 14px 16px; }
    .prg-modal .modal-footer .btn { width: 100%; justify-content: center; }
}

html[class*="a11y-scheme-"] .pm-info, html[class*="a11y-scheme-"] .pm-bot, html[class*="a11y-scheme-"] .pm-list li { background: transparent !important; border: 2px solid currentColor !important; color: inherit !important; }
html[class*="a11y-scheme-"] .pm-row strong, html[class*="a11y-scheme-"] .pm-row .pm-label, html[class*="a11y-scheme-"] .pm-desc,
html[class*="a11y-scheme-"] .pm-bot strong, html[class*="a11y-scheme-"] .pm-bot span, html[class*="a11y-scheme-"] .pm-price { color: inherit !important; }

/* ---------------------------------------------------------------------
   Чат-помощник на странице «Контакты»
   --------------------------------------------------------------------- */
.chat-card { border-radius: 22px !important; overflow: hidden; box-shadow: var(--shadow-md) !important; }
.chat-card .card-header { padding: 18px 24px !important; border: 0; }
.chat-card .card-header h4 { margin: 0; color: #fff; font-size: 1.3rem; font-weight: 800; }
.chat-card .card-header small { font-size: .9rem; }
.chat-card .chatbot-avatar {
    position: relative; width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%;
    background: #5dafdf; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.chat-card .chatbot-avatar img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.chat-card .chatbot-dot {
    position: absolute; right: -2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #4cd964; border: 3px solid #14509a; animation: chatDot 2.4s infinite;
}
@keyframes chatDot { 0% { box-shadow: 0 0 0 0 rgba(76, 217, 100, .6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(76, 217, 100, 0); } }
.chat-reset {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px;
    background: rgba(255, 255, 255, .12); color: #fff; font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: background .15s ease;
}
.chat-reset:hover { background: rgba(255, 255, 255, .24); }

.chat-card .card-body { padding: 22px 24px 24px; background: #fff; }
.chat-card .chatbot-messages {
    height: clamp(320px, 50vh, 520px); padding: 20px; border: 0; border-radius: 18px; background: #eaf3fb;
    scrollbar-width: thin; scrollbar-color: #b9d3ec transparent;
}
.chat-card .message { align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.chat-card .message-avatar { width: 42px; height: 42px; margin: 0; overflow: hidden; }
.chat-card .bot-message .message-avatar { background: #5dafdf; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(31, 111, 181, .28); }
.chat-card .user-message .message-avatar { background: var(--brand-100); color: var(--brand-600); }
.chat-card .message-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-card .message-content { max-width: min(640px, 80%); padding: 12px 16px; border-radius: 18px; box-shadow: var(--shadow-sm); }
.chat-card .bot-message .message-content { border-bottom-left-radius: 6px; }
.chat-card .user-message .message-content { border-bottom-right-radius: 6px; background: var(--brand-600); color: #fff; }
.chat-card .message-text { white-space: pre-line; line-height: 1.5; overflow-wrap: anywhere; }
.chat-card .message-text a { color: var(--brand-600); font-weight: 600; }
.chat-card .message-time { margin-top: 4px; font-size: .72rem; }

.chat-card .quick-question { border-radius: 999px; font-weight: 600; font-size: .85rem; padding: .3rem .9rem; }
.chat-card .quick-questions .btn:hover { transform: none; }

.chatbot-form { display: flex; align-items: center; gap: 10px; }
.chatbot-form .form-control { flex: 1 1 auto; height: 52px; padding: 0 22px; border-radius: 999px; border: 1px solid #d3deec; font-size: 1rem; }
.chatbot-form .form-control:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(42, 134, 208, .22); }
.chatbot-form .btn { width: 52px; height: 52px; flex: 0 0 52px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.chatbot-form .btn:disabled { opacity: .55; }

@media (max-width: 575.98px) {
    .chat-card .card-header { padding: 14px 16px !important; }
    .chat-card .card-header h4 { font-size: 1.05rem; }
    .chat-card .chatbot-avatar { width: 52px; height: 52px; flex-basis: 52px; }
    .chat-card .card-body { padding: 14px; }
    .chat-card .chatbot-messages { padding: 12px; height: clamp(300px, 55vh, 480px); }
    .chat-card .message-avatar { width: 34px; height: 34px; }
    .chat-card .message-content { max-width: 86%; }
}
@media (prefers-reduced-motion: reduce) { .chat-card .chatbot-dot { animation: none; } }

html[class*="a11y-scheme-"] .chat-card .chatbot-messages,
html[class*="a11y-scheme-"] .chat-card .message-content { background: transparent !important; border: 2px solid currentColor; color: inherit !important; box-shadow: none !important; }
html[class*="a11y-scheme-"] .chat-card .user-message .message-content { color: inherit !important; }

/* Поле чата: одна чёткая рамка фокуса (оранжевая — по правилам доступности сайта) без двойного контура */
.chatbot-form .form-control:focus,
.chatbot-form .form-control:focus-visible { outline: 3px solid #f5a623 !important; outline-offset: 2px; box-shadow: none; }

/* ===== Текст страниц (page.php), то, что создаёт редактор страниц ===== */
.page-text { overflow-wrap: anywhere; }
.page-text > :first-child { margin-top: 0; }
.page-text > :last-child { margin-bottom: 0; }
.page-text h2, .page-text h3, .page-text h4 { font-weight: 800; color: var(--brand-dark, #0b2447); line-height: 1.25; margin: 1.8em 0 .6em; }
.page-text h2 { font-size: 1.7rem; }
.page-text h3 { font-size: 1.35rem; }
.page-text h4 { font-size: 1.15rem; }
.page-text p { margin: 0 0 1em; }
.page-text a { color: var(--brand-primary, #1f6fb5); text-decoration: underline; text-underline-offset: 3px; }
.page-text a:hover { text-decoration-thickness: 2px; }
.page-text ul, .page-text ol { margin: 0 0 1em; padding-left: 1.5em; }
.page-text li { margin-bottom: .35em; }
.page-text img { max-width: 100%; height: auto; border-radius: 12px; }
.page-text img.float-start { float: left; margin: .3em 1.2em .6em 0; max-width: 45%; }
.page-text img.float-end { float: right; margin: .3em 0 .6em 1.2em; max-width: 45%; }
.page-text::after { content: ''; display: block; clear: both; }
.page-text blockquote { margin: 1.2em 0; padding: .8em 1.2em; border-left: 4px solid var(--brand-primary, #1f6fb5); background: #f1f7fd; border-radius: 0 12px 12px 0; color: #33415c; }
.page-text blockquote > :last-child { margin-bottom: 0; }
.page-text pre { background: #0f1b33; color: #d6e4ff; padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: .9rem; }
.page-text code { font-size: .92em; }
.page-text hr { border: 0; border-top: 2px solid #e3e9f2; margin: 2em 0; opacity: 1; }
.page-text table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.page-text th, .page-text td { border: 1px solid #d5deea; padding: .55em .8em; vertical-align: top; }
.page-text th { background: #f1f6fc; text-align: left; }
.page-text .table-striped tr:nth-child(even) td { background: #f9fbfe; }
.page-text .alert { border-radius: 14px; margin: 1.2em 0; padding: 1em 1.2em; }
.page-text .alert > :last-child { margin-bottom: 0; }
.page-text iframe { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; margin: 1.2em 0; }
.page-text figure { margin: 1.2em 0; }
.page-text figcaption { font-size: .88rem; color: #6c757d; text-align: center; margin-top: .4em; }
.page-draft-banner { background: #fff4d6; color: #7a5200; border-bottom: 1px solid #f0d58a; padding: 10px 0; font-weight: 600; font-size: .92rem; }
