/* Современный светлый стиль главной страницы (index.html)
   Подключается ПОСЛЕ style.css и header.css, поэтому перекрывает их.
   Внутренние страницы (templates/page/*) этот файл не подключают. */

:root {
    --accent: #0b74c8;
    --accent-2: #2bc0e8;
    --accent-soft: #e8f4fd;
    --ink: #12263a;
    --muted: #5d7188;
    --line: #e6eef7;
    --bg: #f4f8fd;
    --card: #ffffff;
    --radius: 16px;
    --shadow-1: 0 1px 2px rgba(16, 42, 76, .06), 0 6px 18px -8px rgba(16, 42, 76, .10);
    --shadow-2: 0 4px 10px rgba(16, 42, 76, .08), 0 18px 40px -16px rgba(11, 116, 200, .22);
    --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

html { scroll-behavior: smooth; min-width: 350px; }

body {
    font-family: 'Inter', 'Montserrat', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ===================== Шапка ===================== */
.head_line {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .25s ease;
}
.head_line.scrolled { box-shadow: 0 12px 32px -20px rgba(16, 42, 76, .4); }

.head_logo { flex: 0 0 auto; width: fit-content; margin: 0; }
.head_logo > a { margin: 0; display: flex; align-items: center; gap: 14px; text-decoration: none; width: auto; height: auto; }
.head_logo > a > img { display: block; width: 92px; height: auto; }
.head_logo__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.head_logo__title {
    max-width: none;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .01em;
    color: var(--accent);
}
.head_logo__sub {
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--muted);
}

.head_nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
}

.phone_sicons { flex-direction: row; align-items: center; gap: 14px; margin: 0; }
.icons_phone { margin: 0; }
.icons_phone > a {
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
    transition: color .3s ease;
}
.icons_phone > a:hover { color: var(--accent); }

.sicons { margin: 0; display: flex; gap: 8px; }
.sicons > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid #d6e7f7;
    transition: transform .2s, background .2s, box-shadow .2s, border-color .2s;
}
.sicons > a:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-1); }
.sicons > a img { width: 18px; height: 18px; object-fit: contain; }

.icons { gap: 10px; }
.icons > div { margin: 0; padding: 0; }
.icons > div:before { display: none; }
.icons > div > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.icons > div > a:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); border-color: #cfddea; }
.icons > div img { max-height: 26px; width: auto; }
.icons > div:last-child img { max-height: 26px; }

/* Кнопка для слабовидящих */
.accessibility-button {
    width: 42px;
    height: 42px;
    padding: 10px;
    background: var(--accent-soft);
    border: 1px solid #d6e7f7;
    border-radius: 50%;
    color: var(--accent);
    transition: transform .2s, box-shadow .2s;
}
.accessibility-button svg { width: 100%; height: 100%; }
.accessibility-button:hover { transform: scale(1.06); box-shadow: var(--shadow-1); }

/* Панель для слабовидящих */
.nav-pannel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-2);
    width: auto;
    max-width: 1240px;
    margin: 12px auto;
    padding: 16px 20px;
}
.nav-pannel-title { color: var(--ink); }
.nav-pannel .bvi-link { border-radius: 8px !important; box-shadow: var(--shadow-1); transition: transform .15s; }
.nav-pannel .bvi-link:hover { transform: translateY(-2px); }

/* ===================== Контент ===================== */
.unit { padding: 0 20px; }
.unit_block { max-width: 1240px; margin: 0 auto; padding: 0; }

.main_block { padding: 34px 0 10px; }

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 26px;
    padding: 0;
    border: 0;
    font-size: 13px;
    color: var(--muted);
}
.crumbs li {
    list-style: none;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.crumbs img {
    width: 13px;
    height: 13px;
    color: #b6c6d8;
    opacity: .7;
    flex: 0 0 auto;
}
.crumbs li a { color: var(--muted); text-decoration: none; font-weight: 500; transition: color .3s ease; }
.crumbs li a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.crumbs li:last-child:not(:first-child) { color: var(--ink); font-weight: 600; }

/* ===================== Карточки-ссылки ===================== */
.main_serv {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: 100%;
}
.main_serv > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    color: var(--ink);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), box-shadow .32s ease, border-color .32s ease;
}
.main_serv > a > span:first-child {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    display: flex;
    align-items: center;
    background: transparent;
    padding: 8px 4px;
    color: inherit;
    transition: color .3s ease;
}
.main_serv > a > span:first-child::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
}
.main_serv > a:hover > span:first-child {
    background: transparent;
    color: var(--accent);
}
.main_serv > a:hover > span:first-child::after { transform: scaleX(1); }
.main_serv > a > span:last-child {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad);
    border-radius: 14px;
    box-shadow: 0 8px 18px -8px rgba(11, 116, 200, .55);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
}
.main_serv > a > span:last-child img { max-height: 30px; width: auto; }

.main_serv > a:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
    border-color: rgba(11, 116, 200, .35);
}
.main_serv > a:hover > span:last-child { transform: rotate(-6deg) scale(1.06); }

@keyframes cardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
.main_serv > a { animation: cardIn .5s ease both; }
.main_serv > a:nth-child(2) { animation-delay: .06s; }
.main_serv > a:nth-child(3) { animation-delay: .12s; }
.main_serv > a:nth-child(4) { animation-delay: .18s; }
.main_serv > a:nth-child(5) { animation-delay: .24s; }
.main_serv > a:nth-child(6) { animation-delay: .3s; }
.main_serv > a:nth-child(7) { animation-delay: .36s; }
.main_serv > a:nth-child(8) { animation-delay: .42s; }

@media (min-width: 640px) {
    .main_serv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .main_serv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .main_serv > a { font-size: 16px; }
}

/* ===================== Подвал ===================== */
.footer {
    width: 100%;
    display: block;
    margin-top: 48px;
    padding: 44px 24px 36px;
    background: linear-gradient(180deg, #ffffff, #f1f6fc);
    border-top: 1px solid var(--line);
}
.footer_menu {
    width: 100%;
    max-width: 1240px;
    min-width: 0;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
}
.footer_menu > div {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    border: 0;
}
.footer_menu > div > img { position: static; width: 22px; height: 22px; margin-bottom: 10px; opacity: .7; }
.footer_menu > div > p { margin: 0 0 12px; font-weight: 700; font-size: 14px; color: var(--ink); }
.footer_menu > div > a {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.4;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color .3s ease;
}
.footer_menu > div > a:hover { color: var(--accent); }

/* ===================== Модалка и уведомления ===================== */
.modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 30px 80px -30px rgba(16, 42, 76, .5);
}
.modal-header { border-bottom: 1px solid var(--line); }
.modal-title { font-weight: 700; color: var(--ink); }
.alert { border: 0; border-radius: 12px; box-shadow: var(--shadow-1); }

/* Средние экраны: три варианта ширины надписи */
@media (min-width: 961px) and (max-width: 1280px) {
    .head_logo__title { white-space: normal; width: 460px; max-width: 460px; font-size: 16px; }
    .head_logo__sub { white-space: normal; }
}

@media (max-width: 960px) {
    .icons { display: none; }
}

@media (min-width: 861px) and (max-width: 960px) {
    .head_logo__title { white-space: normal; width: 300px; max-width: 300px; font-size: 14px; }
    .head_logo__sub { white-space: normal; }
}

@media (min-width: 801px) and (max-width: 860px) {
    .head_logo__title { white-space: normal; width: 260px; max-width: 260px; font-size: 14px; }
    .head_logo__sub { white-space: normal; }
}

@media (min-width: 701px) and (max-width: 800px) {
    .head_logo__title { white-space: normal; width: 170px; max-width: 240px; font-size: 13px; }
    .head_logo > a > img { width: 88px; }
    .icons_phone > a { font-size: 12px; }
}

@media (min-width: 561px) and (max-width: 700px) {
    .head_logo__title { white-space: normal; width: 170px; max-width: 240px; font-size: 12px; }
    .head_logo > a > img { width: 88px; }
    .icons_phone > a { font-size: 12px; }
}

/* Мелкие экраны */
@media (max-width: 640px) {
    .unit { padding: 0 14px; }
    .footer { padding: 32px 16px 28px; }
    .nav-pannel { padding: 12px 14px; }
    .nav-pannel > div { text-align: center; }
    .nav-pannel > div > div { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 560px) {
    .head_line { padding: 8px 14px; flex-wrap: wrap; row-gap: 8px;}
    .head_logo > a > img { width: 88px; }
    .head_logo__title { width: 240px; max-width: 240px; white-space: normal; font-size: 13px; }
    .icons_phone > a { font-size: 15px; }
}

@media (max-width: 400px) {
    .head_line { padding: 8px 12px; }
    .head_logo > a { gap: 10px; }
    .head_logo > a > img { width: 76px; }
    .head_logo__title { width: 200px; max-width: 200px; font-size: 12px; }
    .icons_phone > a { font-size: 14px; }
}
