/* Дополнения к старой теме: состояние модалок, кнопки вместо span, формы, тексты из
   редактора, карусель партнёров (вместо jQuery flexisel), доступность.
   Inline-стили запрещены CSP — всё оформление только здесь. */

/* ---------- доступность ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: #9f0000; color: #fff; padding: 10px 16px; }
.skip-link:focus { left: 10px; top: 10px; }
:focus-visible { outline: 2px solid #9f0000; outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- шапка: кнопки вместо span ---------- */
button.langdefault, button.menu-toggle, button.products-mbopen-menu, .slider-pause, .carousel-btn {
  font: inherit; color: inherit; border: 0; padding: 0; cursor: pointer;
}
/* Убираем серый фон кнопки браузера там, где тема фон не задаёт. У .products-mbopen-menu
   фон не трогаем: в теме это чёрная вкладка бокового меню (background: #000). */
button.langdefault, button.menu-toggle, .slider-pause, .carousel-btn { background: none; }
button.langdefault { text-transform: uppercase; }
.langchoose a[aria-current="true"] { font-weight: bold; }
.menu a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.preview-banner { position: fixed; z-index: 500; left: 0; right: 0; bottom: 0; padding: 8px 16px; background: #ffd400; color: #000; text-align: center; font: 14px/1.4 Roboto, Arial, sans-serif; }
.site-notice { position: relative; z-index: 50; margin: 90px auto 0; max-width: 900px; padding: 12px 18px; font: 16px/1.4 Roboto, Arial, sans-serif; }
.site-notice-ok { background: #e7f6ec; color: #135d2c; border: 1px solid #9fd5b0; }

/* ---------- главная: видео / постер, пауза слайдера ---------- */
.video-poster-only { position: fixed; inset: 0; z-index: -1; }
.video-poster-only img { width: 100%; height: 100%; object-fit: cover; }
.slider-nav-wrapper { position: relative; }
.slider-pause { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: #fff; font-size: 12px; opacity: .75; text-transform: uppercase; letter-spacing: 1px; }
@media (max-width: 768px) { .slider-pause { top: auto; bottom: -26px; transform: none; } }
.slider-pause:hover, .slider-pause:focus-visible { opacity: 1; }

/* ---------- модальные окна ---------- */
/* Шапка сайта — слой 2000, окно должно быть выше неё. */
.modal-root .modal-overlay { z-index: 2099; transition: opacity .3s, visibility .3s; }
.modal-root .modal-wrapper { z-index: 2100; }
.modal-root.is-open .modal-overlay { opacity: 1; visibility: visible; }
/* height: fit-content — иначе при top/bottom: 0 белый фон тянется на весь экран. */
.modal-root .modal { opacity: 0; transform: translateX(-40px) scale(.96); transition: opacity .35s, transform .35s, visibility .35s; height: fit-content; max-height: 92vh; overflow: auto; padding-bottom: 28px; }
.modal-root .modal:focus { outline: none; }
.modal-root.is-open .modal { opacity: 1; transform: none; visibility: visible; }
.modal-title { margin: 28px 20px 0; font: 18px/1.3 "Roboto-Light", Roboto, Arial, sans-serif; color: #141414; }
.modal .footer-form-button { margin: 16px auto 0; }
.modal .textarea-name { display: block; width: 80%; margin: 22px auto 8px; text-align: left; }
.modal textarea { box-sizing: border-box; width: 80%; max-width: 80%; min-height: 110px; padding: 8px 10px; border: 1px solid #c9c9c9; color: #000; font: 15px/1.4 "Roboto-Light", Roboto, Arial, sans-serif; resize: vertical; }
.modal textarea:focus { border-color: #9f0000; outline: none; }
body.modal-lock { overflow: hidden; }

/* ---------- формы ---------- */
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Телефон: страна (с кодом) + номер в одной строке, в стиле остальных полей — без плашки. */
.country-select { flex: none; max-width: 96px; margin: 0 10px 0 0; padding: 0 2px 9px 0; border: 0; background: transparent; color: inherit; font: 15px/28px "Roboto-Light", Roboto, Arial, sans-serif; cursor: pointer; }
.country-select option { color: #141414; background: #fff; }
.modal-mob .country-select { color: #000; }
.form-auth-ul .country-select { color: #fff; }
.phone-input { flex: 1; min-width: 0; }

/* Поля «с линией»: фокус — красная линия под полем, а не прямоугольная рамка. */
.modal-mob li input:focus-visible, .form-auth-ul li input:focus-visible, .flex-outer li input:focus-visible, .country-select:focus-visible { outline: none; }
.modal-mob li:focus-within, .form-auth-ul li:focus-within { box-shadow: 0 1px 0 #9f0000; border-bottom-color: #9f0000; }
.flex-outer li input:focus { border-bottom-color: #9f0000; }

/* Регистрация: та же колонка «значок + поле», что у формы входа; высота — по содержимому. */
.target .register-form { height: auto; }
.register-form .form-auth-ul { margin-top: 30px; }
.register-form > .consent, .register-form > .field-error, .register-form > .form-status { box-sizing: border-box; width: 100%; max-width: 550px; margin-left: auto; margin-right: auto; }
.register-form > .consent { margin-top: 18px; color: rgba(255,255,255,.7); }
.register-form .field-error, .register-form .form-status.is-error { color: #ff9b9b; }
.register-form .form-status.is-ok { color: #8fe0a8; }
.register-form .auth-button { flex: none; padding: 28px 0 40px; }
/* Та же форма в белой карточке («Полезный софт»): тёмный текст. */
.career-form .register-form { width: 80%; margin: 0 auto; }
.career-form .register-form .form-auth-ul li { border-bottom-color: #c9c9c9; }
.career-form .register-form .form-auth-ul li input, .career-form .register-form .country-select { color: #363636; }
.career-form .register-form .form-auth-ul li img { filter: brightness(0); opacity: .4; }
.career-form .register-form > .consent { color: #555; }
.career-form .register-form .field-error, .career-form .register-form .form-status.is-error { color: #b00020; }
.career-form .register-form .form-status.is-ok { color: #135d2c; }
.career-form .register-form .auth-button { padding: 24px 0 8px; }
/* От 1000px кнопка входа/регистрации прозрачная с белым текстом — в белой карточке текст тёмный. */
@media (min-width: 1000px) { .career-form .register-form .auth-button-style { color: #363636; } }

/* Форма резюме (вакансия): обычная раскладка вместо высоты 400px и отрицательных отступов старой темы. */
.career-form { height: auto; padding: 1px 0 32px; }
.career-form .career-form-title { margin: 28px 20px 8px; text-align: center; font: 24px/1.3 "Roboto-Light", Roboto, Arial, sans-serif; color: #363636; }
.career-form p.form-hint, .career-form p.field-error, .career-form p.form-status { padding: 0; font: 13px/1.4 Roboto, Arial, sans-serif; text-align: center; }
.career-form p.form-hint { margin: 6px 0 0; color: #777; }
.career-form p.field-error { width: 80%; margin: 6px auto 0; color: #b00020; }
.career-form p.form-status { width: 80%; margin: 12px auto 0; font-size: 15px; }
.career-form > form > .consent { width: 80%; margin: 18px auto 0; }
/* Телефон в форме резюме: список стран с тем же шрифтом, отступами и линией, что у поля, —
   строка выглядит как одно поле. Размеры повторяют старую тему (до 1300px и от 1300px). */
.flex-outer li.phone-li { flex-wrap: nowrap; align-items: flex-end; }
.flex-outer li.phone-li .phone-input { flex: 1; width: auto; min-width: 0; }
.flex-outer .country-select { max-width: 120px; margin: 0; padding: 15px 6px 0 0; border-bottom: 1px solid #f1f1f1; color: #363636; font: 15px/20px "Roboto-Thin", Roboto, Arial, sans-serif; }
@media (min-width: 1300px) {
  /* Колонка узкая (50%): строке телефона — почти вся ширина (промежуток до e-mail остаётся), номер — слева. */
  .flex-outer li.phone-li { box-sizing: border-box; padding-right: 10%; }
  .flex-outer .country-select { max-width: 100px; padding: 15px 4px 15px 0; border-bottom-color: #8e8e8e; font-size: 16px; line-height: 28px; }
  .flex-outer li.phone-li .phone-input { padding: 15px 0 15px 6px; font-size: 18px; text-align: left; }
}
.resume-file { margin: 24px auto 0; text-align: center; }
.resume-file .uploadButton { display: inline-block; padding: 6px 20px; border: 1px dashed #9f9f9f; }
.resume-file .uploadButton:hover, .resume-file .uploadButton:focus-within { border-color: #9f0000; }
.resume-actions { display: flex; justify-content: center; margin-top: 22px; }
.resume-actions .form-button-style { width: auto; min-width: 220px; }
.field-error { color: #b00020; font: 13px/1.3 Roboto, Arial, sans-serif; margin: 4px auto 0; width: 80%; text-align: left; }
.form-status { margin: 12px auto; width: 80%; font: 15px/1.4 Roboto, Arial, sans-serif; }
.form-status.is-ok { color: #135d2c; }
.form-status.is-error { color: #b00020; }
.is-invalid { box-shadow: 0 2px 0 #b00020; }
.consent { display: flex; gap: 8px; align-items: flex-start; width: 80%; margin: 14px auto 0; font: 13px/1.4 Roboto, Arial, sans-serif; color: #555; text-align: left; }
.form-hint { font: 13px/1.4 Roboto, Arial, sans-serif; color: #777; margin: 6px 0; }
.form-actions button[disabled] { opacity: .6; cursor: progress; }
.career-form-title { font: 22px/1.3 "Roboto-Light", Roboto, Arial, sans-serif; margin-bottom: 12px; }
.register-form .flex-outer li, .form-auth-ul li { display: flex; align-items: center; }
.uploadButton { cursor: pointer; }
.form-result .form-errors { margin: 12px 0; padding-left: 20px; text-align: left; list-style: disc; }
.button-link { display: inline-block; padding: 10px 28px; border: 1px solid #9f0000; color: #333; }
.empty-list { padding: 20px 0; color: #666; }

/* ---------- тексты из редактора ---------- */
.rich-text p { margin: 0 0 1em; }
.rich-text h2, .rich-text h3, .rich-text h4 { margin: 1.2em 0 .5em; line-height: 1.25; }
.rich-text ul, .rich-text ol { margin: 0 0 1em 1.4em; }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text a { text-decoration: underline; }
.rich-text img { max-width: 100%; height: auto; }
.rich-text table { border-collapse: collapse; margin: 1em 0; max-width: 100%; }
.rich-text td, .rich-text th { border: 1px solid #ccc; padding: 4px 8px; }
.rich-text blockquote { border-left: 3px solid #9f0000; padding-left: 12px; margin: 1em 0; }
.rich-text .rt-video, .news-iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.rt-left { text-align: left; } .rt-right { text-align: right; } .rt-center { text-align: center; } .rt-justify { text-align: justify; }
.rt-float-left { float: left; margin: 0 1em 1em 0; } .rt-float-right { float: right; margin: 0 0 1em 1em; }

/* ---------- списки файлов ---------- */
.file-meta { color: #888; font-size: .85em; white-space: nowrap; }
.name-program-title { font-size: 18px; margin: 18px 0 8px; }
.partner-site { margin-top: 12px; }
.logo-text { display: inline-block; padding: 10px; font-weight: bold; }
.left-menu-li-brand.is-current .li-brands-img { outline: 1px solid #9f0000; }

/* ---------- блог ---------- */
.news-title { font-size: 18px; margin: 0 0 6px; }
.news-date { color: #888; font-size: 13px; margin-bottom: 6px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; list-style: none; padding: 20px 0; }
.pagination a { display: inline-block; min-width: 34px; padding: 6px 10px; text-align: center; border: 1px solid #ddd; }
.pagination a.active { background: #9f0000; border-color: #9f0000; color: #fff; }

/* ---------- карусель партнёров (замена flexisel) ---------- */
.partners-carousel { position: relative; display: flex; align-items: center; }
.carousel-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; list-style: none; padding: 10px 0; margin: 0; flex: 1; scrollbar-width: none; justify-content: space-around;}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track li { flex: 0 0 calc(25% - 15px); scroll-snap-align: start; }
.carousel-track img { max-width: 225px; width: 100%; height: auto; }
.carousel-btn { font-size: 28px; color: #8e8e8e; padding: 0 10px; }
@media (max-width: 900px) { .carousel-track li { flex-basis: calc(50% - 10px); } }
@media (max-width: 520px) { .carousel-track li { flex-basis: 80%; } .carousel-btn { display: none; } }

/* ---------- левое меню на мобильных ---------- */
.side-panel.is-open { left: 240px; }
button.products-mbopen-menu[aria-expanded="true"] { /* поворот стрелки, как в старой теме */ }

/* ---------- лайтбокс ---------- */
.lightbox { position: fixed; inset: 0; z-index: 2100; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; }
.lightbox-close { position: absolute; top: 12px; right: 16px; font-size: 36px; color: #fff; background: none; border: 0; cursor: pointer; }
.minimized { cursor: zoom-in; }

/* ---------- контакты ---------- */
.contacts-panel address { font-style: normal; }
.contacts-callback { margin-top: 20px; }

/* ---------- страница ошибки без БД ---------- */
.error-plain main { max-width: 640px; margin: 15vh auto; padding: 0 16px; font: 16px/1.5 Roboto, Arial, sans-serif; }

/* ---------- мобильная ширина 360px: ничего не вылезает ---------- */
img, video, iframe { max-width: 100%; }
@media (max-width: 400px) {
  .modal { width: 94%; }
  .country-select { max-width: 78px; }
  .field-error, .form-status, .consent { width: 92%; }
}
