@font-face {
    font-family: 'Ubuntu';
    src: url('fonts/Ubuntu-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Ubuntu';
    src: url('fonts/Ubuntu-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Ubuntu';
    src: url('fonts/Ubuntu-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --primary-color: #F37021;
    --primary-hover: #d65d16;
    --text-color: #333333;
    --text-secondary: #666666;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-main: 'Ubuntu', sans-serif;
    --transition: all 0.3s ease;
    --list-px: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.header {
    background-color: rgba(255,255,255,0.95);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo-img { height: 50px; width: auto; display: block; }
.social-icons { display: flex; align-items: center; gap: 8px; }

.social-icon {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background-color: #F0F2F5; transition: var(--transition);
}
.social-icon:hover { background-color: var(--primary-color); transform: translateY(-2px); }
.social-icon img { transition: var(--transition); }

.main-content { padding: 40px 20px 80px; }

.hero { text-align: center; margin: 0 auto 40px; max-width: 1200px; }

.info-block {
    background: linear-gradient(135deg, #fff 0%, #fff8f3 100%);
    padding: 40px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(243,112,33,0.1);
    margin-bottom: 40px;
}
.info-block p { margin-bottom: 16px; font-size: 1.1rem; color: var(--text-secondary); }
.info-block p:last-child { margin-bottom: 0; }
.info-block strong { color: var(--text-color); font-weight: 800; }

.section-title {
    font-size: 2.5rem; font-weight: 700; color: var(--text-color);
    margin-bottom: 10px; position: relative; display: inline-block;
}
.section-title::after {
    content: ''; display: block; width: 60px; height: 4px;
    background-color: var(--primary-color); margin: 16px auto 0; border-radius: 2px;
}
.section-hint { color: var(--text-secondary); font-size: 1rem; margin-top: 16px; }

.resources-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.resource-item {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid transparent;
    overflow: hidden;
}
.resource-item:hover { box-shadow: var(--shadow-md); border-color: rgba(243,112,33,0.15); }

.resource-header {
    display: flex; align-items: center;
    padding: 20px var(--list-px);
    cursor: pointer; user-select: none; gap: 16px;
    transition: var(--transition);
}
.resource-header:hover { background-color: rgba(243,112,33,0.03); }

.resource-icon {
    width: 56px; height: 56px; min-width: 56px;
    background-color: #FFF4EC; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.resource-item:hover .resource-icon { background-color: var(--primary-color); transform: scale(1.05); }
.resource-icon img { width: 32px; height: 32px; object-fit: contain; transition: var(--transition); }
.resource-item:hover .resource-icon img { filter: brightness(0) invert(1); }

.resource-title-wrapper { flex: 1; min-width: 0; }
.resource-title-wrapper h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-color); margin: 0; line-height: 1.3; }
.item-count { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; display: block; }

.toggle-icon {
    width: 32px; height: 32px; min-width: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background-color: #F0F2F5;
    color: var(--text-secondary); transition: var(--transition);
}
.resource-item:hover .toggle-icon { background-color: var(--primary-color); color: white; }
.resource-item[data-collapsed="false"] .toggle-icon { transform: rotate(180deg); }

/* Collapsible content */
.resource-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background-color: rgba(248,249,250,0.5);
    border-top: 0 solid rgba(243,112,33,0.08);
}
.resource-item[data-collapsed="false"] .resource-content {
    max-height: 9999px;
    border-top-width: 1px;
}

/* ────────────────────────────────────────────────
   Списки ресурсов: одно правило для обоих блоков
   .resource-items     — всегда видимые
   .resource-items-more — скрытые до «Показать ещё»
   ──────────────────────────────────────────────── */
.resource-items,
.resource-items-more {
    list-style: none;
    margin: 0;
    /* горизонтальный отступ одинаковый, управляется через --list-px */
    padding-left: var(--list-px);
    padding-right: var(--list-px);
}

.resource-items {
    padding-top: 20px;
    padding-bottom: 20px; /* убирается через data-has-more в buildHtml */
}

/* Когда есть кнопка — убираем нижний отступ у первого ul,
   кнопка сама даёт отступ через свой padding */
.resource-items.has-more {
    padding-bottom: 0;
}

/* Скрытый список.
   max-height ставим реалистичный (~28px на строку × макс 50 строк),
   иначе браузер анимирует пустоту и получается рывок. */
.resource-items-more {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease,
                padding-top 0.35s ease,
                padding-bottom 0.35s ease;
    padding-top: 0;
    padding-bottom: 0;
}
.resource-items-more.expanded {
    max-height: 1400px;
    padding-top: 10px;
    padding-bottom: 20px;
}

/* Строки — одинаковые для обоих */
.resource-items li,
.resource-items-more li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}
.resource-items li:last-child,
.resource-items-more li:last-child { margin-bottom: 0; }

.resource-items li::before,
.resource-items-more li::before {
    content: '';
    position: absolute;
    left: 0; top: 8px;
    width: 6px; height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.resource-items li a,
.resource-items-more li a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
.resource-items li a:hover,
.resource-items-more li a:hover { color: var(--primary-hover); text-decoration: underline; }

/* Show More button */
.show-more-btn {
    display: flex; align-items: center; gap: 6px;
    width: 100%;
    padding: 12px var(--list-px);
    background: none; border: none; cursor: pointer;
    color: var(--primary-color);
    font-family: var(--font-main); font-size: 0.9rem; font-weight: 600;
    transition: var(--transition);
}
.show-more-btn:hover { background-color: rgba(243,112,33,0.05); color: var(--primary-hover); }
.show-more-btn svg { transition: var(--transition); flex-shrink: 0; }

/* Button */
.button-container { text-align: center; }

.main-button {
    display: inline-block;
    background-color: var(--primary-color); color: white;
    text-decoration: none; font-weight: 700; font-size: 1.1rem;
    padding: 15px 40px; border-radius: 50px;
    box-shadow: 0 10px 20px rgba(243,112,33,0.3);
    transition: var(--transition); text-transform: uppercase; letter-spacing: 0.5px;
}
.main-button:hover { background-color: var(--primary-hover); box-shadow: 0 14px 28px rgba(243,112,33,0.35); transform: translateY(-2px); }
.main-button:active { transform: translateY(2px); }

/* Footer */
.footer { background-color: #fff; padding: 40px 0; border-top: 1px solid #eee; text-align: center; }
.footer-phone { font-size: 1.5rem; font-weight: 700; color: var(--text-color); margin-bottom: 16px; }
.footer-copyright { color: #999; font-size: 0.9rem; line-height: 1.6; }

/* Responsive */
@media (max-width: 768px) {
    :root { --list-px: 20px; }

    .section-title { font-size: 1.75rem; }
    .resources-list { grid-template-columns: 1fr; gap: 16px; }
    .info-block { padding: 24px; }
    .resource-header { padding: 16px var(--list-px); gap: 12px; }
    .resource-icon { width: 48px; height: 48px; min-width: 48px; }
    .resource-icon img { width: 28px; height: 28px; }
    .resource-title-wrapper h3 { font-size: 1rem; }
    .main-button { width: 100%; padding: 16px; }
}
/* ────────────────────────────────────────────────
   Проверка доступности сервисов (check.js)
   ──────────────────────────────────────────────── */
.check-block {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(243,112,33,0.15);
    padding: 32px 40px;
    margin: 0 auto 40px;
    text-align: left;
}
.check-head { display: flex; gap: 20px; align-items: flex-start; }
.check-icon {
    width: 56px; height: 56px; min-width: 56px;
    border-radius: 14px; background: #FFF4EC; color: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
}
.check-title { font-size: 1.5rem; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.check-desc { color: var(--text-secondary); font-size: 1rem; }

.check-controls {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; margin-top: 24px; flex-wrap: wrap;
}
.check-consent {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.95rem; color: var(--text-secondary); cursor: pointer;
    flex: 1 1 320px;
}
.check-consent input {
    /* Своя отрисовка: у штатного чекбокса с accent-color браузер сам
       выбирает цвет галочки и на оранжевом рисует её тёмной */
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; min-width: 20px; margin: 1px 0 0;
    border: 2px solid #C9CDD2; border-radius: 5px; background: #fff;
    cursor: pointer; transition: var(--transition);
}
.check-consent input:checked {
    border-color: var(--primary-color);
    background: var(--primary-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l3 3 6-6.3' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.check-consent input:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
/* Прокрутка к результату: не прятать его под липкой шапкой */
.check-result, .check-net { scroll-margin-top: 100px; }
.check-consent a { color: var(--primary-color); }
.check-button {
    background: var(--primary-color); color: #fff; border: none; cursor: pointer;
    font-family: var(--font-main); font-weight: 700; font-size: 1rem;
    padding: 14px 36px; border-radius: 50px;
    box-shadow: 0 8px 16px rgba(243,112,33,0.25);
    transition: var(--transition);
}
.check-button:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
.check-button:disabled { background: #E3E5E8; color: #9AA0A6; box-shadow: none; cursor: not-allowed; }

.check-progress { margin-top: 24px; }
.check-progress[hidden], .check-result[hidden] { display: none; }
.check-progress-bar { height: 6px; background: #F0F2F5; border-radius: 3px; overflow: hidden; }
.check-progress-bar span {
    display: block; height: 100%; width: 0;
    background: var(--primary-color); border-radius: 3px; transition: width 0.3s ease;
}
.check-progress-text { margin-top: 8px; font-size: 0.9rem; color: var(--text-secondary); }

.check-result {
    margin-top: 24px; padding: 18px 20px; border-radius: var(--radius-md);
    border-left: 4px solid;
}
.check-result-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.check-result-text { color: var(--text-color); font-size: 0.95rem; }
.check-result.ok    { background: #EEF8F1; border-color: #2E9E5B; }
.check-result.warn  { background: #FFF4EC; border-color: var(--primary-color); }
.check-result.info  { background: #EEF3FB; border-color: #3B6FC4; }
.check-result.error { background: #FDEEEE; border-color: #D64545; }

/* Заявка в Арену под результатом проверки */
.check-ticket { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(243,112,33,0.2); }
.check-ticket-hint { font-size: 0.95rem; margin-bottom: 10px; }
.check-ticket-status { color: #D64545; font-size: 0.9rem; margin-top: 8px; }
.check-ticket-done { font-weight: 500; color: #2E7D4F; }
.check-result-text a, .check-ticket-hint a { color: var(--primary-color); }

.check-net { margin-top: 20px; font-size: 0.95rem; color: var(--text-secondary); }
.check-net.check-result { margin-top: 24px; color: inherit; }
.check-net[hidden], .check-controls[hidden] { display: none; }
.check-again {
    margin-top: 12px; background: none; border: 1px solid var(--primary-color); color: var(--primary-color);
    font-family: var(--font-main); font-weight: 600; font-size: 0.9rem;
    padding: 9px 18px; border-radius: 50px; cursor: pointer; transition: var(--transition);
}
.check-again:hover { background: var(--primary-color); color: #fff; }

/* ────────────────────────────────────────────────
   Уведомление на главной (detect.js): режим интернета абонента
   ──────────────────────────────────────────────── */
.detect-block {
    margin: 0 auto 28px; padding: 18px 22px;
    border-radius: var(--radius-md); border-left: 4px solid; text-align: left;
}
.detect-block[hidden] { display: none; }
.detect-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.detect-text { color: var(--text-color); font-size: 0.95rem; }
.detect-text a { color: var(--primary-color); }
.detect-block.ok   { background: #EEF8F1; border-color: #2E9E5B; }
.detect-block.info { background: #EEF3FB; border-color: #3B6FC4; }
.detect-block.warn { background: #FFF4EC; border-color: var(--primary-color); }

/* Страница проверки по ссылке /c/<адрес> */
.check-page .main-content { max-width: 760px; min-height: calc(100vh - 260px); }
.check-page .check-title { font-size: 1.5rem; }
.check-progress-bar span { transition: width 0.4s ease; }

@media (max-width: 768px) {
    .check-block { padding: 24px 20px; }
    .check-head { gap: 14px; }
    .check-icon { width: 48px; height: 48px; min-width: 48px; }
    .check-title { font-size: 1.25rem; }
    .check-button { width: 100%; }
}
