:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --primary-color: #0066cc;
    --primary-hover: #004499;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --search-bg: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --primary-color: #3f94f6;
    --primary-hover: #5ea3f7;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --text-muted: #a0a0a0;
    --search-bg: #2d2d2d;
    --modal-overlay: rgba(0, 0, 0, 0.75);
}

* {
    box-shrink: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

header p {
    color: var(--text-muted);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 0;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

.search-box {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--search-bg);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
}

.search-box:focus {
    border-color: var(--primary-color);
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 992px) {
    .main-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }
    main {
        flex: 1;
        min-width: 0;
    }
    aside {
        width: 360px;
        flex-shrink: 0;
    }
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border-color);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.docs-list {
    list-style: none;
}

.docs-item {
    display: flex;
    align-items: flex-start;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.docs-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.docs-item .icon {
    margin-right: 15px;
    font-size: 1.4rem;
}

.docs-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.docs-item a:hover {
    text-decoration: underline;
}

.docs-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.certs-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 576px) {
    .certs-container {
        flex-direction: row;
    }
    .cert-item {
        flex: 1;
    }
}

.cert-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    background: rgba(0,0,0,0.01);
}

.cert-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.badge-fstec { background: #ffebee; color: #c62828; }
.badge-minsvyaz { background: #e3f2fd; color: #1565c0; }

.cert-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.cert-link {
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
}

.cert-link:hover {
    text-decoration: underline;
}

.download-btn {
    display: block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}

.download-btn:hover {
    background-color: var(--primary-hover);
}

.meta-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.support-info p {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
}

.mock-cert-img {
    height: 180px;
    background: #eee;
    border: 2px dashed #bbb;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
    margin: 15px 0;
    font-weight: bold;
}
[data-theme="dark"] .mock-cert-img {
    background: #2a2a2a;
    border-color: #444;
    color: #999;
}

/* Сетка для карточек ОС */
.os-certs-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 576px) {
    .os-certs-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
}

.os-cert-card {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.01);
}

/* Круглые подложки под логотипы */
.os-logo-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.os-logo-wrapper svg {
    width: 22px;
    height: 22px;
}

/* Фирменные цвета ОС */
.astra-bg { background-color: #0056b3; } /* Синий со звездой */
.redos-bg { background-color: #d32f2f; } /* Красный четырехквадратный */
.alt-bg   { background-color: #fbc02d; } /* Желтый "Базальт" */
.sber-bg  { background-color: #2e7d32; } /* Зеленый Сбер */
.rosa-bg  { background-color: #0d47a1; } /* Темно-синяя капля */

.os-cert-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.os-cert-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.os-cert-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
}

.os-cert-status:hover {
    text-decoration: underline;
}

/* Главная карточка Реестра Минцифры */
.reestr-main-card {
    border: 2px solid #0066cc !important;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, var(--card-bg), rgba(0, 102, 204, 0.03));
}

[data-theme="dark"] .reestr-main-card {
    border-color: #3f94f6 !important;
    background: linear-gradient(145deg, var(--card-bg), rgba(63, 148, 246, 0.05));
}

.reestr-badge-top {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #0066cc;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 15px;
    border-bottom-left-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .reestr-badge-top {
    background-color: #3f94f6;
}

.reestr-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

@media (min-width: 768px) {
    .reestr-content-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Круглая иконка-щит */
.reestr-logo-sphere {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 102, 204, 0.1);
    color: #0066cc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

[data-theme="dark"] .reestr-logo-sphere {
    background-color: rgba(63, 148, 246, 0.1);
    color: #3f94f6;
}

.reestr-logo-sphere svg {
    width: 32px;
    height: 32px;
}

.reestr-text-block {
    flex: 1;
}

.reestr-text-block h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
    font-weight: 700;
}

.reestr-status-text {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 15px;
    opacity: 0.9;
}

/* Сетка с параметрами записи */
.reestr-meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    padding: 12px 0;
}

@media (min-width: 576px) {
    .reestr-meta-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.reestr-meta-grid div {
    color: var(--text-color);
}

.reestr-meta-grid strong {
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 4px;
}

/* Кнопка проверки */
.reestr-link-btn {
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 1px dashed #0066cc;
}

.reestr-link-btn:hover {
    color: var(--primary-hover);
    border-bottom-style: solid;
}

[data-theme="dark"] .reestr-link-btn {
    color: #3f94f6;
    border-color: #3f94f6;
}


 header {
            position: relative;
            margin-bottom: 40px;
            padding: 20px 0;
        }

        /* Выравнивание логотипа и текста в одну линию */
        .header-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 20px;
            text-align: center;
        }

        /* На мониторах выстраиваем картинку строго слева */
        @media (min-width: 768px) {
            .header-content {
                flex-direction: row;
                text-align: left;
                gap: 30px;
            }
        }

        .header-text {
            flex: 1;
        }

        header h1 { 
            font-size: 1.9rem; 
            margin-bottom: 6px; 
            font-weight: 700;
        }
        
        header p { 
            color: var(--text-muted); 
            font-size: 1rem;
        }

        /* Контейнер-ссылка для логотипа */
        .header-logo-link {
            display: inline-flex;
            transition: transform 0.2s ease;
        }
        .header-logo-link:hover {
            transform: scale(1.02); /* Легкий интерактивный эффект при наведении */
        }

        /* Фиксированные и безопасные размеры для PNG-картинки */
        .header-logo-img {
            height: 90px;
            width: 90px;
            object-fit: contain;
            display: block;
        }