/* ===== RESET И БАЗОВЫЕ СТИЛИ ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #004182;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ===== УТИЛИТЫ ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

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

.mt-30 {
    margin-top: 30px;
}

.mb-30 {
    margin-bottom: 30px;
}

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

/* ===== ХЕДЕР ===== */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo-container {
    margin-left: 15px;
}

.logo-link img {
    height: 80px;
    width: auto;
}

/* ===== МЕНЮ ===== */
.main-nav {
    position: relative;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    margin-right: 15px;
}

.burger-line {
    width: 24px;
    height: 2px;
    background: #333;
    transition: 0.3s;
}

.menu-list {
    display: flex;
    gap: 30px;
}

.menu-item {
    position: relative;
}

.menu-item > a {
    padding: 10px 0;
    font-weight: 500;
}

.menu-item.active > a {
    color: #004182;
    font-weight: 600;
}

/* Крестик для закрытия меню */
.menu-close {
    display: none;
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1002;
    width: 40px;
    height: 40px;
    background: #004182;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.menu-close svg {
    width: 20px;
    height: 20px;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    background: #f0f4fb;
    padding: 15px 0;
}

.breadcrumbs .container {
    padding: 0 20px;
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumbs-item {
    display: flex;
    align-items: center;
}

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

.separator {
    margin-left: 8px;
    color: #666;
}

.current {
    color: #666;
    font-weight: 500;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.site-main {
    padding: 30px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

/* ===== КОНТЕНТ СТРАНИЦ ===== */
.com-content-article {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.page-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f4fb;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #001B4C;
    margin: 0;
}

.com-content-article__body {
    line-height: 1.7;
}

.com-content-article__body p {
    margin-bottom: 20px;
}

.com-content-article__body hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    margin: 30px 0;
}

.com-content-article__body img {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.com-content-article__body img:hover {
    transform: scale(1.01);
}

/* Категории на главной */
.category-block {
    margin-bottom: 40px;
    text-align: center;
}

.category-block img {
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.category-block img:hover {
    transform: scale(1.02);
}

.content-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #004182, transparent);
    margin: 40px auto;
    width: 80%;
}

/* ===== ЛЕНИВАЯ ЗАГРУЗКА ===== */
.postcard-image img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

.postcard-image img.loaded {
    opacity: 1;
}

/* ===== САЙДБАР ===== */
.sidebar {
    align-self: start;
}

.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: #004182;
}

.categories-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.categories-list a:hover {
    color: #004182;
    font-weight: 500;
}

/* ===== СТИЛИ ДЛЯ НОВЫХ БЛОКОВ САЙДБАРА ===== */
.quick-links-widget,
.holidays-widget {
    margin-top: 25px;
}

/* ===== КНОПКИ "ПОДЕЛИТЬСЯ" ===== */
.share-buttons,
.share-buttons-bottom {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.content-share {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: #f0f4fb;
    border-radius: 12px;
}

/* ===== НАВИГАЦИОННЫЕ КНОПКИ ===== */
.bd-nav-title {
    font-size: 1.3rem;
    color: #004182;
    margin: 40px 0 20px;
    padding: 15px;
    background: #f0f4fb;
    border-radius: 8px;
    text-align: center;
}

.bd-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 25px 0 40px;
}

.bd-nav-button {
    display: block;
    padding: 14px 20px;
    background: white;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    color: #004182;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.bd-nav-button:hover {
    background: #004182;
    color: white;
    border-color: #004182;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 65, 130, 0.2);
}

/* ===== ПЕРЕКРЕСТНЫЕ ССЫЛКИ ===== */
.crosslinks-card {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 25px;
    margin: 40px 0;
    border-left: 4px solid #004182;
}

.crosslinks-title {
    color: #001B4C;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.crosslinks-list {
    list-style: none;
    padding: 0;
}

.crosslinks-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #d0d9ff;
}

.crosslinks-link {
    font-weight: 600;
    color: #004182;
    font-size: 1.1rem;
}

.crosslinks-hint {
    color: #666;
    font-size: 0.9rem;
    margin-left: 10px;
    font-style: italic;
}

/* ===== ФУТЕР ===== */
.site-footer {
    background: #001B4C;
    color: white;
    padding: 40px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    padding-bottom: 40px;
}

.footer-copyright p {
    margin-bottom: 10px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: #aee3ff;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.footer-custom-code {
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-contact {
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== СТИЛИ ДЛЯ ФУТЕРА ===== */
.footer-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-nav-column {
    display: flex;
    flex-direction: column;
}

.footer-nav-title {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.footer-nav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav-list li {
    margin-bottom: 0;
}

.footer-nav-list a {
    color: #aee3ff;
    font-size: 0.95rem;
    transition: all 0.2s;
    padding: 5px 0;
    display: block;
}

.footer-nav-list a:hover {
    color: white;
    padding-left: 5px;
}

/* ===== УВЕДОМЛЕНИЕ О COOKIES ===== */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 27, 76, 0.95);
    color: white;
    padding: 20px;
    z-index: 9999;
    display: none;
}

.cookie-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-notice p {
    margin: 0;
    flex: 1;
}

.cookie-notice a {
    color: #aee3ff;
    text-decoration: underline;
}

.cookie-button {
    background: white;
    color: #004182;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    flex-shrink: 0;
}

.cookie-button:hover {
    background: #f0f0f0;
}

/* ===== КНОПКА "НАВЕРХ" ===== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #004182;
    color: white;
    padding: 12px 18px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.3s;
    z-index: 999;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0, 65, 130, 0.3);
}

#back-to-top:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 65, 130, 0.4);
}

.back-to-top-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================
   ОБЩИЕ СТИЛИ ДЛЯ КАЛЬКУЛЯТОРОВ
   ============================================ */

/* Основной контейнер калькулятора */
.calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 30px 0;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.calculator-form {
    flex: 1;
    min-width: 300px;
}

.calculator-results {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Элементы форм */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.calc-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.calc-input:focus {
    border-color: #007bff;
    outline: none;
}

.form-text {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 4px;
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.calc-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 14px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.calc-button:hover {
    background: #0056b3;
}

/* Карточки результатов */
.result-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.highlight {
    background: #e8f4fd;
    margin: 10px -15px -15px -15px;
    padding: 15px;
    border-radius: 0 0 8px 8px;
    font-weight: bold;
    font-size: 1.1em;
    color: #007bff;
    border-bottom: none;
}

.result-label {
    color: #495057;
}

.result-value {
    font-weight: 600;
    color: #212529;
}

.highlight .result-value {
    color: #007bff;
    font-size: 1.2em;
}

/* Контейнер для графиков */
.chart-container {
    margin-top: 25px;
}

.chart-container h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1em;
}

#growth-chart {
    max-width: 100%;
    height: auto;
    background: white;
    border-radius: 8px;
    padding: 10px;
}

/* Таблицы */
.table-container {
    margin: 25px 0;
    overflow-x: auto;
}

.growth-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.growth-table th {
    background: #f0f4fb;
    color: #004182;
    font-weight: 600;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
}

.growth-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.growth-table tr:last-child td {
    border-bottom: none;
    font-weight: 600;
    background: #f8f9fa;
}

.growth-table tr:hover td {
    background: #f5f5f5;
}

/* ============================================
   СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ КАЛЬКУЛЯТОРОВ
   ============================================ */

/* Калькулятор сложного процента */
.highlight-compound .result-value {
    color: #28a745;
    font-size: 1.2em;
}

#simple-row {
    border-top: 1px dashed #dee2e6;
    margin-top: 5px;
    padding-top: 10px;
}

/* Калькулятор портфеля */
.asset-row {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.asset-number {
    font-weight: 600;
    color: #004182;
}

.remove-asset-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

.remove-asset-btn:hover:not(:disabled) {
    color: #bd2130;
    transform: scale(1.1);
}

.asset-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 10px;
}

.asset-field {
    margin-bottom: 0;
}

/* Калькулятор риска */
.highlight-risk .result-value {
    color: #dc3545;
    font-size: 1.3em;
    font-weight: 700;
}

.risk-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
}

.risk-low {
    background: #28a745;
    color: white;
}

.risk-medium {
    background: #ffc107;
    color: #333;
}

.risk-high {
    background: #dc3545;
    color: white;
}

/* Калькулятор налогов */
.highlight-tax .result-value {
    color: #dc3545;
    font-size: 1.3em;
    font-weight: 700;
}

.income-fields,
.annuity-fields,
.method-fields,
.mode-fields {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #007bff;
}

.mode-fields {
    border-left-color: #dc3545;
}

.tax-breakdown {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.tax-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e9ecef;
}

.tax-breakdown-item:last-child {
    border-bottom: none;
}

/* Калькулятор пенсии */
.highlight-pension .result-value,
.highlight-annuity .result-value,
.highlight-fire .result-value {
    color: #007bff;
    font-size: 1.3em;
    font-weight: 700;
}

/* Радио-группы */
.radio-group {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #28a745;
}

.radio-group label {
    font-weight: normal;
    margin-bottom: 5px;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    width: auto;
    height: auto;
}

/* Прогресс-бар */
.goal-meter {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
}

.goal-progress {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #007bff);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s;
}

/* Калькулятор бюджета */
.highlight-budget .result-value {
    color: #28a745;
    font-size: 1.3em;
    font-weight: 700;
}

/* Сравнение брокеров */
.rating-star {
    color: #ffc107;
    font-size: 1.2rem;
}

.recommended-badge {
    background: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 5px;
}

.broker-link {
    color: #007bff;
    text-decoration: none;
}

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

/* Калькулятор акций */
.highlight-value .result-value {
    color: #007bff;
    font-size: 1.3em;
    font-weight: 700;
}

.upside-positive {
    color: #28a745;
    font-weight: 700;
}

.upside-negative {
    color: #dc3545;
    font-weight: 700;
}

.recommend-buy {
    background: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.recommend-hold {
    background: #ffc107;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.recommend-sell {
    background: #dc3545;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

/* Калькулятор дивидендов */
.highlight-dividend .result-value {
    color: #28a745;
    font-size: 1.3em;
    font-weight: 700;
}

.dividend-positive {
    color: #28a745;
    font-weight: 600;
}

.dividend-negative {
    color: #dc3545;
    font-weight: 600;
}

/* Калькулятор инфляции */
.highlight-inflation .result-value {
    color: #dc3545;
    font-size: 1.3em;
    font-weight: 700;
}

.inflation-negative {
    color: #dc3545;
    font-weight: 600;
}

/* Калькулятор доходности с рисками */
.highlight-risk-return .result-value {
    color: #007bff;
    font-size: 1.2em;
    font-weight: 700;
}

.metric-good {
    color: #28a745;
    font-weight: 600;
}

.metric-medium {
    color: #ffc107;
    font-weight: 600;
}

.metric-bad {
    color: #dc3545;
    font-weight: 600;
}

/* Сравнение вкладов и инвестиций */
.winner-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    color: white;
}

.winner-deposit {
    background: #007bff;
}

.winner-investment {
    background: #28a745;
}

.winner-draw {
    background: #6c757d;
}

/* Формулы */
.formula-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    margin: 10px 0;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    /* Меню - БУРГЕР */
    .menu-toggle {
        display: flex;
        margin-right: 15px;
    }

    .menu-list {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 100px 20px 30px;
        transition: 0.3s;
        z-index: 1001;
        display: flex;
        justify-content: flex-start;
        align-items: stretch;
        overflow-y: auto;
    }

    .menu-list.active {
        right: 0;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        display: none;
        z-index: 1000;
    }

    .menu-overlay.active {
        display: block;
    }

    .menu-item {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eaeaea;
    }

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

    .menu-item > a {
        display: block;
        padding: 12px 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: #333;
    }

    .menu-item.active > a {
        color: #004182;
    }

    .menu-item > a:hover {
        color: #004182;
    }

    .menu-close {
        display: flex;
    }

    .logo-link img {
        height: 80px;
    }

    .cookie-container {
        flex-direction: column;
        text-align: center;
    }

    .cookie-button {
        width: 100%;
    }

    .com-content-article__body img {
        max-width: 100%;
        height: auto;
    }

    .bd-nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .postcard-item-full img {
        width: 100%;
        height: auto;
    }

    .mw-download-link {
        padding: 10px 25px;
        font-size: 0.95rem;
    }

    .category-block img {
        width: 100%;
        height: auto;
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        padding: 10px 15px;
        font-size: 13px;
    }

    .footer-navigation {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-nav-column {
        margin-bottom: 20px;
    }

    .footer-nav-title {
        margin-bottom: 15px;
    }

    .quick-links-widget,
    .holidays-widget {
        margin-top: 20px;
    }

    /* Мобильная адаптация калькуляторов */
    .calculator-container {
        flex-direction: column;
    }

    .asset-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}