/* ==========================================================================
   Общие стили для документации VPS
   Светлая тема: светлый фон, тёмный шрифт
   ========================================================================== */

:root {
    /* Фон и поверхности */
    --bg: #f5f6fa;
    --bg-secondary: #ffffff;
    --code-bg: #f0f2f8;

    /* Текст */
    --text: #2f3142;
    --text-bright: #1a1b26;
    --text-muted: #6b7280;

    /* Акценты */
    --accent: #3b6fd6;
    --accent-bright: #1d4ed8;
    --accent-soft: rgba(59, 111, 214, 0.1);

    /* Семантика */
    --green: #15803d;
    --green-soft: rgba(21, 128, 61, 0.12);
    --yellow: #b45309;
    --yellow-soft: rgba(180, 83, 9, 0.12);
    --red: #b91c1c;
    --red-soft: rgba(185, 28, 28, 0.12);

    /* Геометрия */
    --border: #d8dbe7;
    --border-strong: #b8bcd0;
    --radius: 12px;
    --shadow: 0 12px 40px rgba(30, 41, 59, 0.08);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    padding: 20px;
    min-height: 100vh;
}

/* ---------- Контейнер ---------- */

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 50px;
    box-shadow: var(--shadow);
}

/* index.html центрирует контейнер */
body.layout-centered {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

body.layout-centered .container {
    max-width: 900px;
    width: 100%;
}

/* ---------- Ссылки и навигация ---------- */

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-bright);
}

.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.back-link:hover {
    color: var(--accent-bright);
}

/* ---------- Заголовки ---------- */

h1 {
    color: var(--text-bright);
    font-size: 2.2em;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 15px;
}

h2 {
    color: var(--accent-bright);
    font-size: 1.5em;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--accent);
}

h3 {
    color: var(--text-bright);
    font-size: 1.2em;
    margin-top: 28px;
    margin-bottom: 14px;
}

h4 {
    color: var(--text-bright);
    font-size: 1.05em;
    margin-top: 22px;
    margin-bottom: 10px;
}

p {
    margin-bottom: 14px;
}

ul,
ol {
    margin: 0 0 18px 24px;
}

ul li,
ol li {
    margin-bottom: 6px;
}

strong {
    color: var(--text-bright);
}

/* ---------- Главная страница: шапка ---------- */

.header {
    text-align: center;
    margin-bottom: 50px;
}

.header h1 {
    color: var(--accent-bright);
    font-size: 2.5em;
    margin-bottom: 10px;
    border-bottom: none;
    padding-bottom: 0;
}

.header .subtitle {
    color: var(--text-muted);
    font-size: 1.1em;
}

/* ---------- Бейджи с информацией (index) ---------- */

.server-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.info-badge {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 25px;
    text-align: center;
    min-width: 180px;
}

.info-badge .label {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.info-badge .value {
    font-size: 1.3em;
    color: var(--accent-bright);
    font-weight: bold;
}

/* ---------- Карточки документов (index) ---------- */

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.doc-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.doc-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.doc-card .icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.doc-card h3 {
    color: var(--text-bright);
    font-size: 1.3em;
    margin-bottom: 10px;
}

.doc-card p {
    font-size: 0.95em;
    color: var(--text-muted);
    line-height: 1.6;
}

.doc-card .badge {
    display: inline-block;
    background: var(--accent);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    margin-top: 15px;
}

/* ---------- Быстрые ссылки (index) ---------- */

.quick-links {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.quick-links h3 {
    color: var(--text-bright);
    margin-bottom: 20px;
}

.quick-links ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 0;
}

.quick-links li a {
    color: var(--accent);
    text-decoration: none;
    padding: 8px 12px;
    display: block;
    border-radius: 6px;
    transition: all 0.2s;
}

.quick-links li a:hover {
    background: var(--accent-soft);
    color: var(--accent-bright);
}

/* ---------- Таблицы ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

th {
    background: var(--accent);
    color: #ffffff;
    padding: 14px 18px;
    text-align: left;
    font-weight: bold;
}

td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

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

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: var(--accent-soft);
}

/* Браузерный стиль table для руководства приводится к общему виду */
table[border] {
    border: 1px solid var(--border);
}

/* ---------- Моноширинный текст и код ---------- */

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin: 12px 0 20px;
    overflow-x: auto;
    line-height: 1.5;
    color: var(--text-bright);
}

code {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}

pre code {
    background: none;
    padding: 0;
}

.url-cell {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
    color: var(--accent-bright);
    word-break: break-all;
}

.copy-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    margin-left: 10px;
    font-size: 0.85em;
}

.copy-link:hover {
    color: var(--accent-bright);
}

/* ---------- Теги ---------- */

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
}

.tag-public {
    background: var(--green-soft);
    color: var(--green);
}

.tag-internal {
    background: var(--yellow-soft);
    color: var(--yellow);
}

.tag-admin {
    background: var(--red-soft);
    color: var(--red);
}

/* ---------- Информационные блоки ---------- */

.info-box {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

/* Информационный блок «Совет» (зелёный) */
.info {
    background: var(--green-soft);
    border: 1px solid var(--green);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
}

.info p:last-child,
.warning p:last-child {
    margin-bottom: 0;
}

/* Предупреждение «Важно» (жёлтый) */
.warning {
    background: var(--yellow-soft);
    border: 1px solid var(--yellow);
    border-left: 4px solid var(--yellow);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
}

.credential-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 15px 0;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
}

.credential-block .label {
    color: var(--text-muted);
    font-size: 0.85em;
}

.credential-block .value {
    color: var(--accent-bright);
    font-size: 1.1em;
    margin: 5px 0;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

/* ---------- Подвал ---------- */

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9em;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 24px;
    }

    .header h1,
    h1 {
        font-size: 1.8em;
    }

    .server-info {
        gap: 15px;
    }

    .info-badge {
        min-width: 140px;
        padding: 12px 18px;
    }

    table {
        font-size: 0.85em;
    }

    th,
    td {
        padding: 10px 12px;
    }
}

/* ---------- Печать ---------- */

@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        box-shadow: none;
    }

    .url-cell {
        color: #333;
    }

    .tag {
        border: 1px solid #999;
    }
}
