:root {
    --primary-color: #ffe600;
    --secondary-color: #333;
    --background-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333;
    --text-secondary: #555555;
    --text-muted: #777777;
    --border-color: #afafaf;
}

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

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

.container {
    max-width: 900px;
    margin: 0 auto;
}

.title-container {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #333;
    font-size: 2.2rem;
    display: inline-block;
    margin-bottom: 0;
}

.footnote-ref {
    color: var(--primary-color);
    font-weight: normal;
    text-decoration: none;
    cursor: pointer;
    font-size: 1.1rem;
    vertical-align: text-top;
    margin-left: 4px;
}

.footnote-ref:hover {
    text-decoration: underline;
}

.footnote-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    text-align: left;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

.footnote-content.active {
    max-height: 200px;
}

.footnote-content ul {
    padding-left: 0;
    list-style-type: disc;
    margin-left: 20px;
}

.footnote-content li {
    margin-bottom: 8px;
}

/* ИСКЛЮЧЕНИЕ: Не применять выделение количественных контекстов в сноске с нормативными актами */
.footnote-content,
.footnote-content * {
    color: var(--text-secondary) !important;
    font-weight: normal !important;
    text-decoration: none !important;
}

/* ИСКЛЮЧЕНИЕ: Не применять выделение количественных контекстов в заголовках карточек */
.card-header,
.card-header * {
    color: #484a54 !important;
    font-weight: normal !important;
    text-decoration: none !important;
}

.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    /*box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);*/
    overflow: hidden;
    /*transition: transform 0.3s ease, box-shadow 0.3s ease;*/
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: var(--primary-color);
    /*color: white;*/
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
}

.card-body p {
    margin-bottom: 18px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-body ul, .card-body ol {
    padding-left: 30px;
    margin-top: 0;
    margin-bottom: 18px;
}

.card-body li {
    margin-bottom: 4px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-body li ul,
.card-body li ol {
    padding-left: 25px;
    margin-top: 0;
    margin-bottom: 0;
}

.card-body p.before-list {
    margin-bottom: 0;
}

.card-body strong {
    color: var(--text-primary);
}

.numeric-context {
    color: #c8180f !important;
    font-weight: bold;
    text-decoration: underline;
}

.card-body ol li {
    color: var(--text-secondary) !important;
    font-weight: normal !important;
    text-decoration: none !important;
}

.card-body ol li .numeric-context {
    color: #c8180f !important;
    font-weight: bold !important;
    text-decoration: underline !important;
}

.card-footer {
    padding: 15px 20px;
    background-color: rgba(200, 24, 15, 0.05);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.details-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.details-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .footnote-ref {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .card-header h2 {
        font-size: 1.2rem;
    }
}

/* ---------------------------- Custom styles -------------------------------------------- */
.hide-print {
    display: block;
}

.show-print {
    display: none;
}

@media print {
    .hide-print {
        display: none !important;
    }

    .show-print {
        display: block !important;
    }

    @page {
        size: A4;
        margin-left: 17mm;
        margin-top: 7mm;
        margin-right: 17mm;
        margin-bottom: 7mm;
    }

    /* Можно также подстраховать содержимое */
    body {
        margin-left: 20mm !important;
        margin-right: 20mm !important;
    }

    .print-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 20mm; /* высота колонтитула */
        text-align: center;
        font-size: 12pt;
        border-bottom: 1px solid #000;
        padding-top: 5mm;
    }

    /* Важное! После разрыва страницы тоже оставляем отступ */
    .page-break {
        page-break-after: always;
        margin-bottom: 0;
    }
}

/* Form overlay*/
.form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.form-overlay img {
    width: 150px;
}