/* ============================================
   Root Variables & Dark Theme (по умолчанию)
   ============================================ */
:root {
    /* Dark Theme Colors */
    --bg-primary: #0a1428;
    --bg-secondary: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #2d3a4e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-green: #00ff9f;
    --accent-blue: #22d3ee;
    --accent-green-dark: #00cc7f;
    --accent-blue-dark: #1ab5d0;
    --gradient-primary: linear-gradient(135deg, #00ff9f 0%, #22d3ee 100%);
    --gradient-hover: linear-gradient(135deg, #22d3ee 0%, #00ff9f 100%);
    --success: #00ff9f;
    --warning: #fbbf24;
    --error: #ef4444;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 25px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 255, 159, 0.3);
}

/* Light Theme — исправленная контрастность */
:root.light {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.05);
    
    /* Акценты в светлой теме */
    --accent-green: #00875a;
    --accent-blue: #0b8b9e;
    --gradient-primary: linear-gradient(135deg, #00875a 0%, #0b8b9e 100%);
    --gradient-hover: linear-gradient(135deg, #0b8b9e 0%, #00875a 100%);
}

/* Светлая тема — шапка и навигация */
:root.light .main-nav {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

:root.light .nav-links a {
    color: #1e293b;  /* Тёмно-серый, почти чёрный */
}

:root.light .nav-links a:hover,
:root.light .nav-links a.active-nav {
    color: #00875a;  /* Зелёный акцент */
}

:root.light .nav-logo {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:root.light .theme-toggle {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

:root.light .theme-toggle:hover {
    border-color: #00875a;
}

/* Светлая тема — текст и карточки */
:root.light .hero h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:root.light .hero p {
    color: #475569;
}

:root.light .calc-tabs a {
    color: #64748b;
}

:root.light .calc-tabs a.active-tab {
    background: var(--gradient-primary);
    color: #ffffff;
}

:root.light .calc-tabs a:not(.active-tab):hover {
    color: #1e293b;
}

:root.light .form-group label {
    color: #475569;
}

:root.light input[type="number"],
:root.light select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

:root.light input[type="number"]:focus,
:root.light select:focus {
    border-color: #00875a;
    box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.1);
}

:root.light button[type="submit"] {
    color: #ffffff;
}

:root.light .output-box {
    background: #ffffff;
    border-color: #e2e8f0;
}

:root.light .output-box .result-label {
    color: #64748b;
}

:root.light .output-box .result-amount {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:root.light .output-box .explain-text {
    color: #64748b;
    border-top-color: #e2e8f0;
}

/* Светлая тема — блоки контента */
:root.light .toc {
    background: #f1f5f9;
}

:root.light .toc a {
    color: #475569;
}

:root.light .toc a:hover {
    color: #00875a;
}

:root.light .highlight-box {
    background: rgba(0, 135, 90, 0.08);
    border-left-color: #00875a;
}

:root.light .example-box {
    background: rgba(11, 139, 158, 0.08);
    border-left-color: #0b8b9e;
}

:root.light .warning-box {
    background: rgba(220, 38, 38, 0.08);
    border-left-color: #dc2626;
}

:root.light .highlight-box h3,
:root.light .example-box h4,
:root.light .warning-box h4 {
    color: #1e293b;
}

:root.light .limits-table {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

:root.light .limits-table th {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-color: #e2e8f0;
}

:root.light .limits-table td {
    border-bottom-color: #e2e8f0;
    color: #475569;
}

:root.light .step {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

:root.light .accordion-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

:root.light .accordion-header {
    color: #1e293b;
}

:root.light .accordion-header:hover {
    background: #f8fafc;
}

:root.light .mistake-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

:root.light .mistake-card h3 {
    color: #1e293b;
}

:root.light .faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

:root.light .faq-question {
    color: #1e293b;
}

:root.light .faq-answer {
    color: #475569;
}

:root.light .cta-box {
    background: var(--gradient-primary);
}

:root.light .cta-box p {
    color: #ffffff;
}

:root.light .cta-button {
    background: #ffffff;
    color: #00875a;
}

:root.light .cta-button:hover {
    background: #f8fafc;
}

:root.light .spokes-hub {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

:root.light .spokes-hub h4 {
    color: #64748b;
}

:root.light .spokes-hub a {
    color: #475569;
}

:root.light .spokes-hub a:hover {
    color: #00875a;
}

:root.light footer {
    border-top-color: #e2e8f0;
    color: #94a3b8;
}

:root.light footer a {
    color: #94a3b8;
}

:root.light footer a:hover {
    color: #00875a;
}

:root.light .legal-notice {
    border-top-color: #e2e8f0;
    color: #94a3b8;
}

:root.light .article-meta {
    color: #64748b;
}

:root.light .article-body h2,
:root.light .article-body h3 {
    color: #1e293b;
}

:root.light .article-body p {
    color: #475569;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Header (Glassmorphism)
   ============================================ */
.main-nav {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    background: rgba(10, 20, 40, 0.8);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    z-index: 100;
}

.main-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-logo {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active-nav {
    color: var(--accent-green);
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-green);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    text-align: center;
    padding: 48px 0 24px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ============================================
   Calculator Tabs
   ============================================ */
.calc-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 48px;
    margin: 24px 0 32px;
}

.calc-tabs a {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-radius: 40px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-tabs a.active-tab {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Form Elements (FinTech Style)
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

input[type="number"],
select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: 'Space Grotesk', 'Inter', monospace;
    transition: all 0.2s ease;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

button[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 48px;
    font-size: 16px;
    font-weight: 600;
    color: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button[type="submit"]:hover {
    transform: scale(1.02);
    background: var(--gradient-hover);
    box-shadow: var(--shadow-glow);
}

button[type="submit"]:active {
    transform: scale(0.98);
}

/* Ripple Effect */
button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

button[type="submit"]:active::after {
    width: 200%;
    height: 200%;
}

/* ============================================
   Result Box (Сумма возврата с анимацией)
   ============================================ */
.output-box {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 32px;
    margin-top: 32px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: resultAppear 0.4s ease-out;
}

@keyframes resultAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.output-box .result-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.output-box .result-amount {
    font-size: 56px;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Inter', monospace;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 8px 0;
    animation: countUp 0.6s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-box .explain-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Content Pages (Статьи)
   ============================================ */
.hero-article {
    text-align: center;
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.hero-article h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero-article .article-meta {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Article Content */
.article-body {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.7;
}

.article-body h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 20px;
    letter-spacing: -0.01em;
}

.article-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 12px;
}

.article-body p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* TOC (Оглавление) */
.toc {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.toc a:hover {
    color: var(--accent-green);
}

/* Highlight Boxes */
.highlight-box,
.example-box,
.warning-box {
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
}

.highlight-box {
    background: rgba(0, 255, 159, 0.1);
    border-left: 4px solid var(--accent-green);
}

.example-box {
    background: rgba(34, 211, 238, 0.1);
    border-left: 4px solid var(--accent-blue);
}

.warning-box {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 32px 0;
}

.limits-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.limits-table th,
.limits-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.limits-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.limits-table tr:last-child td {
    border-bottom: none;
}

/* Steps (пошаговая инструкция) */
.steps {
    margin: 32px 0;
}

.step {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.step-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.step-content p {
    margin: 0;
    font-size: 14px;
}

/* Accordion */
.accordion {
    margin: 32px 0;
}

.accordion-item {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-header::after {
    content: '+';
    font-size: 20px;
    transition: transform 0.3s;
}

.accordion-item.active .accordion-header::after {
    transform: rotate(45deg);
}

.accordion-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 300px;
    padding: 0 20px 20px;
}

/* Mistakes Grid */
.mistakes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.mistake-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mistake-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.mistake-number {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--error);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.mistake-card h3 {
    margin: 8px 0 12px;
    font-size: 16px;
}

.mistake-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* FAQ */
.faq-list {
    margin: 32px 0;
}

.faq-item {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 20px;
    transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.faq-item.open .faq-answer {
    max-height: 200px;
    padding: 0 20px 20px;
}

/* CTA Box */
.cta-box {
    background: var(--gradient-primary);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    margin: 48px 0;
}

.cta-box p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--bg-primary);
}

.cta-button {
    display: inline-block;
    background: var(--bg-primary);
    color: var(--accent-green);
    padding: 12px 28px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Article Footer */
.article-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.sources ul {
    margin: 8px 0 0 20px;
}

/* Spokes Hub */
.spokes-hub {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 24px;
    margin: 32px 0;
}

.spokes-hub h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.spokes-hub a {
    display: block;
    color: var(--accent-blue);
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s;
}

.spokes-hub a:hover {
    color: var(--accent-green);
}

/* Footer */
footer {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-green);
}

/* Legal Notice */
.legal-notice {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .output-box .result-amount {
        font-size: 36px;
    }
    
    .calc-tabs a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto;
    }
    
    .mistakes-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-article h1 {
        font-size: 28px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .main-nav,
    .theme-toggle,
    form,
    button,
    .spokes-hub,
    footer,
    .legal-notice,
    .cta-box {
        display: none !important;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    .output-box {
        border: 1px solid #ccc;
        background: white;
        color: black;
    }
}


/* Простая анимация для результата без конфетти */
@keyframes resultGlow {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 159, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(0, 255, 159, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 159, 0); }
}

.output-box {
    animation: resultGlow 0.6s ease-out;
}

/* ============================================
   Logo Styles (НалогВозврат)
   ============================================ */
.logo-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-logo {
    text-decoration: none;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    display: inline-flex;
    gap: 6px;
}

.logo-word {
    transition: all 0.3s ease;
}

/* Тёмная тема */
.logo-word-1 {
    color: #00ff9f;  /* Яркий зелёный */
}

.logo-word-2 {
    color: #22d3ee;  /* Яркий голубой */
}

.nav-logo:hover .logo-word-1 {
    color: #22d3ee;
}

.nav-logo:hover .logo-word-2 {
    color: #00ff9f;
}

/* Светлая тема */
:root.light .logo-word-1 {
    color: #00875a;  /* Насыщенный тёмно-зелёный */
}

:root.light .logo-word-2 {
    color: #0b8b9e;  /* Насыщенный сине-зелёный */
}

:root.light .nav-logo:hover .logo-word-1 {
    color: #0b8b9e;
}

:root.light .nav-logo:hover .logo-word-2 {
    color: #00875a;
}

.logo-subtitle {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Мобильная адаптация логотипа */
@media (max-width: 768px) {
    .nav-logo {
        font-size: 22px;
        gap: 4px;
    }
    
    .logo-subtitle {
        font-size: 9px;
        white-space: normal;
        max-width: 140px;
    }
    
    .logo-wrapper {
        gap: 2px;
    }
}

@media (max-width: 550px) {
    .nav-logo {
        font-size: 18px;
        gap: 3px;
    }
    
    .logo-subtitle {
        font-size: 7px;
        max-width: 120px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 450px) {
    .logo-subtitle {
        display: none;  /* Скрываем подпись на совсем маленьких */
    }
}

/* Адаптивные изображения */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* Контейнер для изображений с подписью */
.figure-container {
    margin: 32px 0;
    text-align: center;
}

.figure-container img {
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.figure-caption {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: center;
}

/* Для светлой темы */
:root.light .figure-container img {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Link Styles (FinTech стиль)
   ============================================ */

/* Основные ссылки */
a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-green);
    text-decoration: none;
}

/* Внутренние ссылки в тексте статей */
.article-body a,
.article-body .internal-link {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px dashed rgba(34, 211, 238, 0.3);
    transition: all 0.2s ease;
}

.article-body a:hover,
.article-body .internal-link:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* Ссылки в навигации (уже есть, но добавим для ясности) */
.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active-nav {
    color: var(--accent-green);
}

/* Ссылки в блоках контента */
.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: none;
}

.toc a:hover {
    color: var(--accent-green);
}

/* Ссылки в аккордеонах */
.accordion-content a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px dashed rgba(34, 211, 238, 0.3);
}

.accordion-content a:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* Ссылки в FAQ */
.faq-answer a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px dashed rgba(34, 211, 238, 0.3);
}

.faq-answer a:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* Ссылки в футере */
footer a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: none;
}

footer a:hover {
    color: var(--accent-green);
}

/* Ссылки в блоке источников */
.sources a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.3);
}

.sources a:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* CTA-кнопка (не ссылка, но для единообразия) */
.cta-button {
    display: inline-block;
    background: var(--gradient-primary);
    color: var(--bg-primary);
    padding: 12px 28px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: none;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
    color: var(--bg-primary);
}

/* Ссылки в светлой теме */
:root.light .article-body a,
:root.light .article-body .internal-link {
    color: #00875a;
    border-bottom-color: rgba(0, 135, 90, 0.3);
}

:root.light .article-body a:hover,
:root.light .article-body .internal-link:hover {
    color: #0b8b9e;
    border-bottom-color: #0b8b9e;
}

:root.light .toc a:hover {
    color: #00875a;
}

:root.light .accordion-content a {
    color: #00875a;
}

:root.light .faq-answer a {
    color: #00875a;
}

:root.light .cta-button {
    color: #ffffff;
}

:root.light .cta-button:hover {
    color: #ffffff;
}

/* Ссылки в карточках */
.mistake-card a {
    color: var(--accent-blue);
    border-bottom: 1px dashed rgba(34, 211, 238, 0.3);
}

.mistake-card a:hover {
    color: var(--accent-green);
}

/* Ссылки в хлебных крошках (если добавите) */
.breadcrumbs a {
    color: var(--text-secondary);
    font-size: 12px;
}

.breadcrumbs a:hover {
    color: var(--accent-green);
}

.breadcrumbs .current {
    color: var(--text-primary);
    cursor: default;
}

/* ============================================
   Button Styles (для единообразия)
   ============================================ */

/* Базовая кнопка */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
}

/* Первичная кнопка (градиент) */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

/* Вторичная кнопка (обводка) */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

/* Маленькая кнопка */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* CTA-кнопка — гарантированно читаемая */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #00ff9f 0%, #22d3ee 100%);
    color: #0a1428 !important;  /* Принудительно тёмный цвет */
    padding: 12px 28px;
    border-radius: 40px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 255, 159, 0.25);
}

.cta-button:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 255, 159, 0.4);
    color: #0a1428 !important;
}

/* Светлая тема — та же кнопка, но можно чуть темнее фон */
:root.light .cta-button {
    background: linear-gradient(135deg, #00875a 0%, #0b8b9e 100%);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 135, 90, 0.25);
}

:root.light .cta-button:hover {
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 135, 90, 0.4);
}

/* ============================================
   Mobile Menu (Гамбургер)
   ============================================ */

/* Гамбургер кнопка (скрыта на десктопе) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Мобильная навигация (скрыта по умолчанию) */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        transition: right 0.3s ease;
        z-index: 99;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        padding: 80px 20px 40px;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        font-size: 18px;
        padding: 12px;
        width: 100%;
        text-align: center;
    }
    
    .nav-links .theme-toggle {
        margin-top: 20px;
        width: auto;
        padding: 10px 24px;
    }
    
    /* Блокировка скролла при открытом меню */
    body.menu-open {
        overflow: hidden;
    }
}

/* Десктопная навигация (обычное отображение) */
@media (min-width: 769px) {
    .nav-links {
        display: flex;
        gap: 24px;
        align-items: center;
    }
}

/* Footer Links */
.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-green);
}

/* Мобильная адаптация футера */
@media (max-width: 550px) {
    footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 16px;
    }
}

/* Блок сценариев */
.scenarios-block {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 32px 0;
}

.scenarios-block h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.scenarios-block ul {
    margin-bottom: 0;
}

.scenarios-block a {
    color: var(--accent-blue);
}

/* Sticky TOC — для длинных статей */
.sticky-toc {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 32px;
    z-index: 10;
}

.sticky-toc h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
}

.sticky-toc ul {
    margin: 0;
    padding-left: 20px;
}

.sticky-toc li {
    margin-bottom: 8px;
    font-size: 13px;
}

.sticky-toc a {
    color: var(--text-secondary);
    text-decoration: none;
}

.sticky-toc a:hover {
    color: var(--accent-green);
}

@media (max-width: 768px) {
    .sticky-toc {
        position: static;
        margin-bottom: 24px;
    }
}

.quick-answers {
    background: rgba(34, 211, 238, 0.08);
    border-left: 4px solid var(--accent-blue);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.quick-answers h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
}

.quick-answers details {
    margin-top: 12px;
    cursor: pointer;
}

.quick-answers summary {
    color: var(--accent-blue);
    font-weight: 500;
}

.next-step {
    background: var(--gradient-primary);
    border-radius: 20px;
    padding: 28px 24px;
    margin: 40px 0;
    text-align: center;
    color: var(--bg-primary);
}

.next-step h3 {
    margin: 0 0 8px 0;
    color: var(--bg-primary);
}

.next-step p {
    margin: 0 0 20px 0;
    color: var(--bg-primary);
    opacity: 0.9;
}

.next-step-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.next-step-buttons .btn-primary {
    background: var(--bg-primary);
    color: var(--accent-green);
    border: none;
}

.next-step-buttons .btn-outline {
    background: transparent;
    border: 1px solid var(--bg-primary);
    color: var(--bg-primary);
}

.next-step-buttons .btn-outline:hover {
    background: var(--bg-primary);
    color: var(--accent-green);
}

.scenario-chain {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
}

.scenario-chain h3 {
    margin: 0 0 16px 0;
}

.chain-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chain-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-arrow {
    color: var(--accent-green);
    font-size: 18px;
    font-weight: 600;
}

.chain-step a {
    color: var(--text-primary);
    text-decoration: none;
}

.chain-step a:hover {
    color: var(--accent-green);
}

/* ============================================
   Decision UI Buttons (Кнопки действий)
   ============================================ */

/* Базовые стили для кнопок */
.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 48px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* Первичная кнопка (градиент) */
.btn-primary {
    background: var(--gradient-primary);
    color: #0a1428;
    box-shadow: 0 2px 8px rgba(0, 255, 159, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 159, 0.4);
    color: #0a1428;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Вторичная кнопка (обводка) */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-2px);
}

.btn-outline:active {
    transform: translateY(0);
}

/* Контейнер для кнопок */
.next-step-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Мобильная адаптация */
@media (max-width: 550px) {
    .btn-primary,
    .btn-outline {
        padding: 10px 18px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    .next-step-buttons {
        flex-direction: column;
        gap: 12px;
    }
}