/* ==========================================================================
   1. CSS Reset & Base Configuration
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-sans); background-color: var(--c-bg-body); color: var(--c-text-main); line-height: var(--base-line-height); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); color: var(--c-heading); font-weight: 700; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--c-primary); text-decoration: none; transition: color 0.2s ease-in-out; }
a:hover { color: var(--c-accent); }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ==========================================================================
   2. Design System (:root & Dark Mode)
   ========================================================================== */
:root {
    --c-primary:        #1a365d; --c-primary-light:  #2a4365; --c-accent: #c53030;
    --c-accent-hover:   #9b2c2c; --c-heading: #1a202c; --c-text-main: #2d3748;
    --c-text-muted:     #718096; --c-bg-body: #f7fafc; --c-bg-surface: #ffffff;
    --c-bg-contrast:    #edf2f7; --c-border: #e2e8f0;
    --font-sans:        'Inter', system-ui, -apple-system, sans-serif;
    --font-serif:       'Playfair Display', serif;
    --base-line-height: 1.7; --transition-base:  all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm:        0 1px 2px rgba(0,0,0,0.05); --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg:        0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm:        8px; --radius-md: 12px; --radius-lg: 20px; --container-width: 1240px;
}
body.dark-mode {
    --c-primary:        #60a5fa; --c-primary-light:  #93c5fd; --c-accent: #f87171;
    --c-accent-hover:   #fca5a5; --c-heading: #f1f5f9; --c-text-main: #cbd5e1;
    --c-text-muted:     #94a3b8; --c-bg-body: #0f172a; --c-bg-surface: #1e293b;
    --c-bg-contrast:    #334155; --c-border: #334155;
}

/* ==========================================================================
   3. Global & Layout Components
   ========================================================================== */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.875rem 1.75rem; font-family: var(--font-sans); font-size: 1rem; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; transition: var(--transition-base); gap: 0.5rem; }
.btn-primary { background-color: var(--c-primary); color: #ffffff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background-color: var(--c-primary-light); transform: translateY(-2px); box-shadow: var(--shadow-md); color: #ffffff; }
.btn-text { background-color: transparent; color: var(--c-primary); padding: 0; }
.btn-text:hover { color: var(--c-accent); }
.badge { display: inline-flex; align-items: center; padding: 0.375rem 0.875rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 9999px; line-height: 1; }
.badge-filled { background-color: rgba(197, 48, 48, 0.1); color: var(--c-accent); }
.layout-grid { display: grid; grid-template-columns: 280px 1fr; gap: 3.5rem; margin-top: 4rem; margin-bottom: 6rem; }
.text-accent-hero { color: var(--c-accent); font-style: italic; }

/* ==========================================================================
   4. Page-Specific Styles
   ========================================================================== */
.hero-section, aside.sidebar, .content-area, .programs-grid, .key-info-grid, .timeline-wrapper, .docs-grid, .documents-card { --c-accent: #c53030; }
.hero-section { text-align: center; position: relative; padding: 6rem 0; background-color: var(--c-bg-surface); border-bottom: 1px solid var(--c-border); overflow: hidden; }
.hero-section::before { content: ''; position: absolute; top: -50%; left: -20%; width: 80%; height: 200%; background: radial-gradient(circle at center, rgba(26,54,93,0.03) 0%, rgba(255,255,255,0) 50%); pointer-events: none; }
.hero-content { max-width: 750px; margin: 0 auto; position: relative; z-index: 1; }
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1; margin: 1.25rem 0; color: var(--c-heading); }
.hero-subtitle { font-size: 1.25rem; line-height: 1.6; color: var(--c-text-muted); margin-bottom: 2.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: center; }

aside.sidebar { position: relative; }
.sticky-nav { position: sticky; top: 2.5rem; background-color: var(--c-bg-surface); padding: 1.5rem; border-radius: var(--radius-md); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); }
.widget-title { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; color: var(--c-text-muted); margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--c-border); }
.nav-list { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-link { display: flex; align-items: center; padding: 0.875rem 1.25rem; color: var(--c-text-muted); font-weight: 500; border-radius: var(--radius-sm); transition: var(--transition-base); border-left: 3px solid transparent; }
.nav-link:hover { background-color: var(--c-bg-contrast); color: var(--c-heading); }
.nav-link.active { background-color: rgba(26, 54, 93, 0.05); color: var(--c-primary); font-weight: 600; border-left-color: var(--c-primary); }

.content-area { display: flex; flex-direction: column; gap: 6rem; }
.content-section { scroll-margin-top: 2.5rem; opacity: 0; }
.section-title { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; color: var(--c-heading); margin-bottom: 3rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--c-border); position: relative; }
.section-title::after { content: ''; position: absolute; bottom: -1.5px; left: 0; width: 100px; height: 3px; background-color: var(--c-accent); border-radius: 2px; }

.programs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.program-card { background-color: var(--c-bg-surface); padding: 2.5rem; border-radius: var(--radius-lg); border: 1px solid var(--c-border); transition: var(--transition-base); text-align: center; }
.program-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--c-accent); }
.program-icon { color: var(--c-accent); margin-bottom: 1.5rem; }
.program-card h3 { font-family: var(--font-sans); font-size: 1.375rem; font-weight: 600; color: var(--c-heading); margin-bottom: 0.5rem; }
.program-card p { font-size: 1rem; color: var(--c-text-muted); margin: 0; }

.key-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-bottom: 3.5rem; }
.rule-card { display: flex; flex-direction: column; justify-content: center; min-height: 160px; background-color: var(--c-bg-surface); padding: 2.5rem; border-radius: var(--radius-lg); border: 1px solid var(--c-border); transition: var(--transition-base), background-position 0.5s ease; position: relative; overflow: hidden; text-align: center; background-image: radial-gradient(var(--c-border) 1px, transparent 1px); background-size: 30px 30px; background-position: -29px -29px; }
.rule-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); border-color: var(--c-accent); background-position: 0 0; }
.rule-card h3 { font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.rule-card .rule-icon { display: block; font-family: var(--font-serif); font-size: 1.45rem; font-weight: 700; line-height: 1.2; color: var(--c-heading); }

.timeline-wrapper { display: flex; flex-direction: column; }
.timeline-row { display: grid; grid-template-columns: 140px 40px 1fr; align-items: start; }
.timeline-date { text-align: right; font-family: var(--font-serif); font-size: 1.125rem; font-weight: 700; color: var(--c-heading); padding-top: 0.25rem; padding-right: 1.25rem; }
.timeline-line-col { position: relative; display: flex; justify-content: center; height: 100%; }
.timeline-line-col::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background-color: var(--c-border); }
.timeline-row:last-child .timeline-line-col::before { bottom: auto; height: 1rem; }
.timeline-marker { width: 18px; height: 18px; background-color: var(--c-bg-surface); border: 3px solid var(--c-border); border-radius: 50%; position: relative; z-index: 1; margin-top: 0.3rem; transition: var(--transition-base); }
.timeline-content { padding-left: 1.25rem; padding-bottom: 3.5rem; }
.timeline-row:last-child .timeline-content { padding-bottom: 0; }
.timeline-content h4 { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--c-heading); }
.timeline-content p { font-size: 1rem; color: var(--c-text-muted); margin: 0; }
.timeline-row.active .timeline-date, .timeline-row.active .timeline-content h4 { color: var(--c-accent); }
.timeline-row.active .timeline-marker { background-color: var(--c-accent); border-color: var(--c-accent); box-shadow: 0 0 0 5px rgba(197, 48, 48, 0.2); }

.docs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: start; }
.docs-list-wrapper h3 { font-size: 1.375rem; color: var(--c-heading); margin-bottom: 2rem; }
.check-list li { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; font-size: 1.05rem; }
.check-list li svg { color: var(--c-accent); flex-shrink: 0; margin-top: 5px; width: 20px; height: 20px; }

/* === НОВЫЙ БЛОК SUBMISSION === */
.documents-card { background-color: var(--c-bg-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header { display: flex; align-items: center; gap: 1rem; padding: 1.5rem 2rem; background-color: var(--c-bg-contrast); border-bottom: 1px solid var(--c-border); }
.card-header .card-icon { font-size: 1.25rem; color: var(--c-primary); }
.card-header h3 { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 600; margin: 0; }
.card-content { padding: 2rem; }
.submission-text { font-size: 1rem; color: var(--c-text-muted); margin-bottom: 2rem; line-height: 1.6; }
.submission-text a { color: var(--c-accent); font-weight: 500; }
.documents-list { display: flex; flex-direction: column; gap: 1rem; }
.document-item { display: flex; align-items: center; gap: 1.5rem; background-color: var(--c-bg-surface); padding: 1.25rem; border: 1px solid var(--c-border); border-radius: var(--radius-md); transition: var(--transition-base); }
.document-item:hover { border-color: var(--c-primary); background-color: var(--c-bg-body); }
.document-icon { font-size: 1.5rem; color: var(--c-text-muted); flex-shrink: 0; width: 40px; text-align: center; }
.document-details { flex-grow: 1; }
.document-name { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--c-heading); margin-bottom: 0.25rem; }
.document-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.8125rem; color: var(--c-text-muted); }
.document-meta span:not(:last-child)::after { content: '•'; margin-left: 1rem; opacity: 0.5; }
.btn-outline { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background-color: transparent; border: 1px solid var(--c-border); color: var(--c-text-muted); border-radius: var(--radius-sm); flex-shrink: 0; }
.btn-outline:hover { background-color: var(--c-accent); border-color: var(--c-accent); color: #ffffff; transform: scale(1.05); }

@media (max-width: 1023px) {
    .layout-grid { grid-template-columns: 100%; gap: 3rem; }
    .docs-grid { grid-template-columns: 1fr; }
    aside.sidebar { position: sticky; top: 0; z-index: 100; margin-left: -1.5rem; margin-right: -1.5rem; width: calc(100% + 3rem); }
    .sticky-nav { border-radius: 0; border-left: none; border-right: none; border-top: none; background-color: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); padding: 0.75rem 0; box-shadow: var(--shadow-md); }
    body.dark-mode .sticky-nav { background-color: rgba(15, 23, 42, 0.85); }
    .nav-list { flex-direction: row; overflow-x: auto; padding: 0 1.5rem; gap: 0.75rem; scrollbar-width: none; }
    .nav-list::-webkit-scrollbar { display: none; }
    .nav-link { white-space: nowrap; padding: 0.625rem 1.25rem; background-color: var(--c-bg-contrast); border: 1px solid transparent; border-radius: 99px; font-size: 0.9rem; }
    .nav-link.active { background-color: var(--c-primary); color: #ffffff; border-color: var(--c-primary); }
    .widget-title { display: none; }
}
@media (max-width: 767px) {
    .hero-section { padding: 4rem 0; }
    .hero-title { font-size: 2.25rem; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; max-width: 380px; }
    .content-area { gap: 4rem; }
    .section-title { font-size: 2rem; margin-bottom: 2rem; }
    .programs-grid, .key-info-grid { grid-template-columns: 1fr 1fr; }
    .timeline-row { display: flex; gap: 1rem; }
    .timeline-date { display: none; }
    .timeline-line-col { min-width: 24px; flex-shrink: 0; }
    .timeline-content { padding-left: 0; }
    .timeline-content h4::before { content: attr(data-date); display: block; font-size: 0.875rem; color: var(--c-accent); font-weight: 700; margin-bottom: 0.25rem; }
}
@media (max-width: 576px) {
    .programs-grid, .key-info-grid { grid-template-columns: 1fr; }
    .document-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .document-btn { position: absolute; top: 1rem; right: 1rem; }
}
