/* ===== FAQ.CSS — СТИЛЬ В ЕДИНОМ СТИЛЕ С ОСНОВНЫМ САЙТОМ ===== */
/* Используется Segoe UI, тонкие шрифты, синие акценты */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', 'Segoe UI Variable', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.5;
    min-height: 100vh;
    padding: 0;
    font-size: 16px;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== КОНТЕЙНЕР ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== ШАПКА (как на основном сайте) ===== */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.logo-icon {
    font-size: 1.2rem;
    font-weight: 400;
    color: #0066cc;
    letter-spacing: -0.5px;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 300;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
}

.logo-text .blue {
    color: #0066cc;
    font-weight: 400;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: #5a5a5a;
    font-weight: 300;
    font-size: 0.85rem;
    transition: all 0.25s ease;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    letter-spacing: 0.3px;
}

.nav a:hover {
    color: #1a1a1a;
}

.nav a:hover::after {
    width: 100%;
}

.nav-highlight {
    background: #0066cc;
    color: #ffffff !important;
    padding: 6px 18px !important;
    border-radius: 4px !important;
    border-bottom: none !important;
    font-weight: 400 !important;
    letter-spacing: 0.5px !important;
}

.nav-highlight:hover {
    background: #004a8f;
    transform: scale(1.02);
    color: #ffffff !important;
}

/* ===== ЗАГОЛОВОК СТРАНИЦЫ ===== */
.title-section {
    text-align: center;
    padding: 30px 0 20px;
}

.title-section h1 {
    font-size: 2.8rem;
    font-weight: 300;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    margin: 0;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
}

.title-section h1 .blue {
    color: #0066cc;
    font-weight: 400;
}

.title-section .sub {
    font-size: 1.1rem;
    color: #5a5a5a;
    margin-top: 4px;
    font-weight: 300;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    letter-spacing: 0.3px;
}

/* ===== УПРАВЛЕНИЕ (язык и контрастность) ===== */
.controls-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.lang-switch {
    display: flex;
    gap: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.lang-btn {
    background: #ffffff;
    border: none;
    border-right: 1px solid #e0e0e0;
    color: #5a5a5a;
    font-weight: 300;
    font-size: 0.8rem;
    padding: 6px 16px;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    transition: all 0.2s ease;
}

.lang-btn:last-child {
    border-right: none;
}

.lang-btn.active {
    background: #0066cc;
    color: #ffffff;
    font-weight: 400;
}

.lang-btn:hover:not(.active) {
    background: #f0f0f0;
}

.contrast-btn {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #1a1a1a;
    font-weight: 300;
    font-size: 0.8rem;
    padding: 6px 14px;
    cursor: pointer;
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    transition: all 0.2s ease;
}

.contrast-btn:hover {
    background: #f0f0f0;
}

/* ===== ПОИСК ===== */
.search-wrapper {
    max-width: 600px;
    margin: 0 auto 24px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.search-input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    font-weight: 300;
    background: #ffffff;
    color: #1a1a1a;
    outline: none;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.search-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-input::placeholder {
    color: #999999;
    font-weight: 300;
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #999999;
    padding: 4px 8px;
    display: none;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    transition: color 0.2s;
}

.clear-search.visible {
    display: block;
}

.clear-search:hover {
    color: #1a1a1a;
}

.reset-filters-btn {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #1a1a1a;
    font-weight: 300;
    font-size: 0.8rem;
    padding: 9px 16px;
    cursor: pointer;
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.reset-filters-btn:hover {
    background: #f0f0f0;
}

.search-counter {
    font-size: 0.85rem;
    color: #999999;
    font-weight: 300;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    white-space: nowrap;
}

/* ===== ТАБЛИЦА ===== */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    width: 100%;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 500px;
    table-layout: auto;
}

th {
    text-align: left;
    padding: 14px 20px;
    background: #f8f9fa;
    color: #1a1a1a;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom: 2px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
}

th:last-child {
    border-right: none;
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    background: #ffffff;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    font-weight: 300;
    color: #1a1a1a;
}

td:last-child {
    border-right: none;
}

tr:last-child td {
    border-bottom: none;
}

tr.hidden {
    display: none;
}

/* ===== КОД ОШИБКИ ===== */
.error-code {
    font-weight: 400;
    color: #0066cc;
    padding: 4px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Segoe UI', 'Cascadia Code', 'Consolas', monospace;
    background: #f8f9fa;
}

.error-code:hover {
    border-color: #0066cc;
    background: #e8f0fe;
}

.error-code:active {
    background: #d4e4f7;
    transform: scale(0.97);
}

.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.severity-critical {
    background: #d32f2f;
}

.severity-warning {
    background: #f9a825;
}

.severity-info {
    background: #0066cc;
}

.desc-cell {
    color: #1a1a1a;
    font-weight: 300;
    word-break: break-word;
    white-space: normal;
}

.desc-cell strong {
    font-weight: 400;
    color: #1a1a1a;
}

/* ===== НЕТ РЕЗУЛЬТАТОВ ===== */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999999;
    font-size: 1rem;
    display: none;
    font-weight: 300;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
}

.no-results.visible {
    display: block;
}

/* ===== ПОДСКАЗКА ПРИ КОПИРОВАНИИ ===== */
.copied-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 8px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    letter-spacing: 0.3px;
}

.copied-tooltip.show {
    opacity: 1;
}

/* ===== ФУТЕР ===== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 30px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-right {
    display: flex;
    align-items: center;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1a1a1a;
    background: #ffffff;
    padding: 8px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    transition: all 0.2s ease;
}

.telegram-link:hover {
    background: #f0f0f0;
    border-color: #0066cc;
}

.qr-btn {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #1a1a1a;
    font-weight: 300;
    font-size: 0.8rem;
    padding: 8px 16px;
    cursor: pointer;
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    transition: all 0.2s ease;
}

.qr-btn:hover {
    background: #f0f0f0;
    border-color: #0066cc;
}

.author-text {
    color: #999999;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
}

/* ===== ИКОНКА TELEGRAM ===== */
.tg-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tg-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* ===== QR-МОДАЛЬНОЕ ОКНО ===== */
.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.qr-modal.visible {
    display: flex;
}

.qr-modal-content {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    position: relative;
    max-width: 320px;
    width: 90%;
}

.qr-modal-content img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.qr-modal-content p {
    margin-top: 12px;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: #1a1a1a;
}

.close-qr {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999999;
    font-family: 'Segoe UI', 'Segoe UI Variable', sans-serif;
    transition: color 0.2s;
}

.close-qr:hover {
    color: #1a1a1a;
}

/* ===== РЕЖИМ ВЫСОКОЙ КОНТРАСТНОСТИ ===== */
body.high-contrast {
    background-color: #000000;
    color: #ffffff;
}

body.high-contrast .header {
    background: #000000;
    border-bottom-color: #ffffff;
}

body.high-contrast .title-section h1,
body.high-contrast .title-section .sub {
    color: #ffffff;
}

body.high-contrast .lang-switch {
    background: #000000;
    border-color: #ffffff;
}

body.high-contrast .lang-btn {
    background: #000000;
    border-right-color: #ffffff;
    color: #ffffff;
}

body.high-contrast .lang-btn.active {
    background: #ffffff;
    color: #000000;
}

body.high-contrast .lang-btn:hover:not(.active) {
    background: #333333;
}

body.high-contrast .search-input {
    background: #000000;
    border-color: #ffffff;
    color: #ffffff;
}

body.high-contrast .search-input:focus {
    box-shadow: 0 0 0 1px #ffffff;
}

body.high-contrast .search-input::placeholder {
    color: #cccccc;
}

body.high-contrast .clear-search {
    color: #ffffff;
}

body.high-contrast .clear-search:hover {
    color: #cccccc;
}

body.high-contrast .search-counter {
    color: #cccccc;
}

body.high-contrast .table-wrapper {
    border-color: #ffffff;
    background: #000000;
}

body.high-contrast th {
    background: #000000;
    color: #ffffff;
    border-bottom-color: #ffffff;
    border-right-color: #666666;
}

body.high-contrast td {
    background: #000000;
    color: #ffffff;
    border-bottom-color: #666666;
    border-right-color: #666666;
}

body.high-contrast tr:last-child td {
    border-bottom-color: #ffffff;
}

body.high-contrast .error-code {
    color: #ffffff;
    background: #000000;
}

body.high-contrast .error-code:hover {
    border-color: #ffffff;
}

body.high-contrast .error-code:active {
    background: #333333;
}

body.high-contrast .severity-dot {
    border-color: #ffffff;
}

body.high-contrast .severity-critical {
    background: #ffffff;
}

body.high-contrast .severity-warning {
    background: #000000;
}

body.high-contrast .severity-info {
    background: #666666;
}

body.high-contrast .desc-cell {
    color: #ffffff;
}

body.high-contrast .no-results {
    background: #000000;
    border-color: #666666;
    color: #cccccc;
}

body.high-contrast .copied-tooltip {
    background: #ffffff;
    color: #000000;
}

body.high-contrast .footer {
    border-top-color: #ffffff;
}

body.high-contrast .telegram-link,
body.high-contrast .qr-btn,
body.high-contrast .reset-filters-btn,
body.high-contrast .contrast-btn {
    background: #000000;
    border-color: #ffffff;
    color: #ffffff;
}

body.high-contrast .telegram-link:hover,
body.high-contrast .qr-btn:hover,
body.high-contrast .reset-filters-btn:hover,
body.high-contrast .contrast-btn:hover {
    background: #333333;
}

body.high-contrast .author-text {
    color: #cccccc;
}

body.high-contrast .qr-modal-content {
    background: #000000;
    border-color: #ffffff;
    color: #ffffff;
}

body.high-contrast .close-qr {
    color: #ffffff;
}

body.high-contrast .qr-modal-content p {
    color: #ffffff;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 10px;
    }

    .nav {
        gap: 12px;
        justify-content: center;
    }

    .nav a {
        font-size: 0.8rem;
    }

    .title-section h1 {
        font-size: 2.2rem;
    }

    .search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-counter {
        text-align: center;
    }

    th, td {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .error-code {
        font-size: 0.8rem;
        padding: 3px 10px;
    }

    .footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-left {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .title-section h1 {
        font-size: 1.8rem;
    }

    .title-section .sub {
        font-size: 0.95rem;
    }

    .nav a {
        font-size: 0.7rem;
    }

    .nav-highlight {
        padding: 4px 12px !important;
        font-size: 0.7rem !important;
    }

    .search-input {
        padding: 8px 36px 8px 12px;
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .error-code {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    .controls-row {
        gap: 6px;
    }

    .lang-btn {
        padding: 4px 12px;
        font-size: 0.7rem;
    }

    .contrast-btn,
    .reset-filters-btn,
    .qr-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .telegram-link {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .qr-modal-content {
        padding: 24px;
    }

    .qr-modal-content img {
        max-width: 150px;
    }
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0;
        font-size: 12px;
    }
    .header,
    .search-wrapper,
    .footer,
    .controls-row,
    .qr-modal,
    .copied-tooltip,
    .no-results,
    .reset-filters-btn {
        display: none !important;
    }
    .table-wrapper {
        border: 1px solid #000000;
    }
    th,
    td {
        padding: 4px 8px;
        border: 1px solid #000000;
    }
}