/**
 * Official Design System & Stylesheet for prava-z.sbs
 * Aesthetic: Clean, authoritative Russian driving academy & transport legal registry.
 * Strict compliance with all layout, responsive and accessibility constraints.
 */

/* ==========================================================================
   1. CSS Custom Properties / Design Tokens
   ========================================================================== */
:root {
    /* Color Palette */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-subtle: #f1f5f9;
    --color-surface-hover: #e2e8f0;
    
    --color-primary: #0f2942;
    --color-primary-light: #1e3a8a;
    --color-primary-dark: #0a192f;
    
    --color-accent: #1d5bbf;
    --color-accent-hover: #164696;
    --color-accent-light: #e0eafc;
    
    --color-success: #15803d;
    --color-success-bg: #f0fdf4;
    --color-success-border: #bbf7d0;
    
    --color-warning: #b45309;
    --color-warning-bg: #fefce8;
    --color-warning-border: #fef08a;

    --color-text-main: #0f172a;
    --color-text-body: #334155;
    --color-text-muted: #64748b;
    --color-text-inverse: #ffffff;
    
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e1;

    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Shadows & Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-elevated: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);

    /* Layout */
    --container-max: 1200px;
    --container-narrow: 840px;
    --header-height: 72px;
    --top-bar-height: 38px;
}

/* ==========================================================================
   2. Reset & Strict Layout Defense (Rules 1-8)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

body {
    font-family: var(--font-stack);
    background-color: var(--color-bg);
    color: var(--color-text-body);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.site-main {
    flex: 1 0 auto;
    width: 100%;
    overflow-x: hidden;
}

.site-container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    overflow-x: hidden;
}

.site-container--narrow {
    max-width: var(--container-narrow);
}

/* Enforce min-width: 0 on ALL grid children (Rule 3) */
.grid,
.site-footer__grid,
.features-grid,
.categories-grid,
.steps-grid,
.guarantee-grid,
.faq-grid,
.sidebar-layout,
.calc-grid,
.stats-strip {
    display: grid;
}

.grid > *,
.site-footer__grid > *,
.features-grid > *,
.categories-grid > *,
.steps-grid > *,
.guarantee-grid > *,
.faq-grid > *,
.sidebar-layout > *,
.calc-grid > *,
.stats-strip > * {
    min-width: 0;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

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

/* ==========================================================================
   3. Top Bar Component
   ========================================================================== */
.top-bar {
    background-color: var(--color-primary);
    color: #cbd5e1;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--top-bar-height);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.top-bar__status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #86efac;
}

.status-indicator__dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px #22c55e;
}

.top-bar__divider {
    color: rgba(255, 255, 255, 0.2);
}

.top-bar__guarantee {
    color: #e2e8f0;
}

.top-bar__contacts {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #cbd5e1;
    transition: color 0.15s ease;
    font-weight: 500;
}

.top-contact-link:hover {
    color: #ffffff;
}

.top-contact-link--wa:hover {
    color: #25d366;
}

.top-contact-link--tg:hover {
    color: #38bdf8;
}

.top-contact-link--vk:hover {
    color: #93c5fd;
}

/* ==========================================================================
   4. Header & Navigation Component
   ========================================================================== */
.main-header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-subtle);
}

.main-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 1.5rem;
}

/* Brand Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo__emblem {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 41, 66, 0.2);
}

.brand-logo__text {
    display: flex;
    flex-direction: column;
}

.brand-logo__title {
    font-size: 1.0625rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--color-primary);
    line-height: 1.2;
}

.brand-logo__sub {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Desktop Nav */
.desktop-nav {
    display: flex;
    align-items: center;
}

.desktop-nav__list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.5rem;
}

.desktop-nav__link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-body);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.desktop-nav__link:hover {
    color: var(--color-accent);
    background-color: var(--color-surface-subtle);
}

.desktop-nav__link--active {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
}

/* Header Actions */
.main-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 0.6875rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}

.btn--primary {
    background-color: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(29, 91, 191, 0.25);
}

.btn--primary:hover {
    background-color: var(--color-accent-hover);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(29, 91, 191, 0.35);
}

.btn--secondary {
    background-color: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-border);
}

.btn--secondary:hover {
    background-color: var(--color-surface-subtle);
    border-color: var(--color-border-dark);
}

.btn--success {
    background-color: var(--color-success);
    color: #ffffff;
}

.btn--success:hover {
    background-color: #166534;
    color: #ffffff;
}

.btn--header {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn--lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.0625rem;
    border-radius: var(--radius-lg);
}

.btn--block {
    width: 100%;
}

/* Burger Button */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    gap: 4px;
}

.burger-btn__line {
    width: 20px;
    height: 2px;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition: all 0.2s ease;
}

/* ==========================================================================
   5. Mobile Drawer Menu
   ========================================================================== */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    visibility: hidden;
    transition: visibility 0.3s ease;
}

.mobile-drawer[aria-hidden="false"] {
    visibility: visible;
}

.mobile-drawer__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer[aria-hidden="false"] .mobile-drawer__backdrop {
    opacity: 1;
}

.mobile-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-drawer[aria-hidden="false"] .mobile-drawer__panel {
    transform: translateX(0);
}

.mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.drawer-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-drawer__nav {
    flex: 1;
    padding: 1rem 0;
}

.mobile-drawer__list {
    list-style: none;
}

.mobile-drawer__link {
    display: block;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-main);
    border-left: 3px solid transparent;
}

.mobile-drawer__link:hover {
    background-color: var(--color-surface-subtle);
    border-left-color: var(--color-accent);
    color: var(--color-accent);
}

.mobile-drawer__footer {
    padding: 1.25rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--color-surface-subtle);
}

.mobile-drawer__socials {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-contact-social {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    color: var(--color-text-body);
}

.btn-contact-social--wa {
    color: #15803d;
    border-color: #bbf7d0;
    background-color: #f0fdf4;
}

.btn-contact-social--tg {
    color: #0369a1;
    border-color: #bae6fd;
    background-color: #f0f9ff;
}

/* ==========================================================================
   6. Breadcrumbs Component
   ========================================================================== */
.breadcrumbs-section {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.625rem 0;
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.breadcrumbs-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.breadcrumbs-link {
    color: var(--color-text-muted);
}

.breadcrumbs-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.breadcrumbs-sep {
    color: var(--color-border-dark);
}

.breadcrumbs-current {
    color: var(--color-text-main);
    font-weight: 600;
}

/* ==========================================================================
   7. Hero Banner Component
   ========================================================================== */
.hero-section {
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 3rem 0 2.5rem;
    position: relative;
    overflow-x: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
    align-items: center;
}

.hero-content {
    min-width: 0;
}

.badge-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.375rem;
    line-height: 1.18;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--color-text-body);
    margin-bottom: 1.75rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hero-trust-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.trust-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}

.trust-item__icon {
    flex-shrink: 0;
    color: var(--color-success);
    margin-top: 2px;
}

.trust-item__content {
    display: flex;
    flex-direction: column;
}

.trust-item__title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.trust-item__desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.hero-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-elevated);
    position: relative;
}

.hero-card__header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.hero-card__title {
    font-size: 1.1875rem;
    font-weight: 800;
    color: var(--color-primary);
}

.hero-card__sub {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   8. Stats & Trust Strip
   ========================================================================== */
.stats-strip {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.stat-item__number {
    font-size: 2rem;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-item__label {
    font-size: 0.8125rem;
    color: #cbd5e1;
    font-weight: 500;
}

/* ==========================================================================
   9. Category Cards Grid (Mobile 1, Tablet 2, Desktop 3/4)
   ========================================================================== */
.section {
    padding: 3.5rem 0;
    overflow-x: hidden;
}

.section--subtle {
    background-color: var(--color-surface-subtle);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 2.5rem;
}

.section-header__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.section-header__title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.section-header__desc {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

/* 3 Columns Desktop / 2 Tablet / 1 Mobile */
.categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.category-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-elevated);
    border-color: var(--color-accent);
}

.category-card__badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    padding: 0.25rem 0.625rem;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.category-card__header {
    margin-bottom: 1rem;
    padding-right: 4rem;
}

.category-card__code {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.category-card__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.3;
}

.category-card__desc {
    font-size: 0.875rem;
    color: var(--color-text-body);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.category-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.25rem;
}

.category-card__price {
    display: flex;
    flex-direction: column;
}

.category-card__price-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.category-card__price-val {
    font-size: 1.1875rem;
    font-weight: 800;
    color: var(--color-primary);
}

.category-card__term {
    font-size: 0.8125rem;
    color: var(--color-text-body);
    font-weight: 600;
}

.category-card__actions {
    display: flex;
    gap: 0.75rem;
}

/* ==========================================================================
   10. Interactive Tariff Configurator / Calculator
   ========================================================================== */
.calc-box {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.calc-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
    align-items: start;
}

.calc-options-group {
    margin-bottom: 1.5rem;
}

.calc-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.calc-pill-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.calc-pill {
    position: relative;
    display: block;
    cursor: pointer;
}

.calc-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.calc-pill__body {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background-color: var(--color-surface-subtle);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.calc-pill input:checked + .calc-pill__body {
    background-color: #ffffff;
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(29, 91, 191, 0.15);
}

.calc-pill__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-primary);
}

.calc-pill__sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.calc-summary-panel {
    background-color: var(--color-primary);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

.calc-summary-panel__title {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0.75rem;
}

.calc-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

.calc-summary-row--total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

.calc-summary-total-val {
    color: #38bdf8;
}

.calc-guarantee-note {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 1rem;
    line-height: 1.4;
}

/* ==========================================================================
   11. Steps / Verification Workflow
   ========================================================================== */
.steps-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.step-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    display: flex;
    flex-direction: column;
}

.step-card__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--color-primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.step-card__title {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.step-card__desc {
    font-size: 0.8125rem;
    color: var(--color-text-body);
    line-height: 1.5;
}

/* ==========================================================================
   12. Content Layout & Typography (Rule 4, 7)
   ========================================================================== */
.sidebar-layout {
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
    align-items: start;
    padding: 2.5rem 0;
}

.article-main {
    min-width: 0;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.article-title {
    font-size: 2.125rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.22;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Rich Text & Article Body */
.rt,
.article-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-body);
    overflow-x: hidden;
    overflow-wrap: break-word;
}

.rt > * + * {
    margin-top: 1.25rem;
}

.rt h2,
.content-h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.3;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.rt h3,
.content-h3 {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.rt h4,
.content-h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.content-paragraph {
    margin-bottom: 1.25rem;
}

.content-list {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.content-list li {
    margin-bottom: 0.5rem;
}

.content-link {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

.inline-code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background-color: var(--color-surface-subtle);
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    color: var(--color-primary);
}

.content-divider {
    border: 0;
    height: 1px;
    background-color: var(--color-border);
    margin: 2rem 0;
}

/* Table Responsive Wrapper (Strict Rule 7) */
.table-outer-wrapper {
    width: 100%;
    overflow-x: hidden;
    margin: 1.5rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    box-shadow: var(--shadow-subtle);
}

.table-responsive-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.content-table th,
.content-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.content-table th {
    background-color: var(--color-surface-subtle);
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

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

.content-table tr:hover td {
    background-color: #f8fafc;
}

/* Code Block Terminal */
.code-block-wrapper {
    width: 100%;
    overflow-x: hidden;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    background-color: #0f172a;
    border: 1px solid #1e293b;
}

.code-terminal {
    padding: 1rem 1.25rem;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    overflow-x: auto;
    line-height: 1.5;
}

/* Article Images Showcase */
.article-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin: 2rem 0;
}

.article-gallery-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    background-color: #ffffff;
    box-shadow: var(--shadow-subtle);
}

.article-gallery-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.article-gallery-caption {
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background-color: var(--color-surface-subtle);
    border-top: 1px solid var(--color-border);
}

/* Sidebar Components */
.sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}

.sidebar-widget {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.sidebar-widget__title {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-nav-list {
    list-style: none;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-body);
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-nav-link:hover {
    color: var(--color-accent);
    padding-left: 0.25rem;
}

/* FAQ Accordion Component */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.faq-item {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 1rem;
}

.faq-question__icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-question__icon,
.faq-item.is-active .faq-question__icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text-body);
    border-top: 1px solid var(--color-surface-subtle);
}

/* ==========================================================================
   13. Form & Modals (Rule 5)
   ========================================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--color-text-main);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(29, 91, 191, 0.15);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.radio-channel-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.radio-channel {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem;
    background-color: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.form-guarantee-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: #14532d;
    margin-bottom: 1.25rem;
}

.form-privacy-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.75rem;
}

/* Modal Dialog */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s ease, opacity 0.2s ease;
}

.modal.is-open {
    visibility: visible;
    opacity: 1;
}

.modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    background-color: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--color-border);
    overflow: hidden;
    z-index: 1;
    transform: scale(0.96);
    transition: transform 0.2s ease;
}

.modal.is-open .modal__dialog {
    transform: scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background-color: var(--color-surface-subtle);
    border-bottom: 1px solid var(--color-border);
}

.modal__eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary);
}

.modal__close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__close-btn:hover {
    color: var(--color-primary);
}

.modal__body {
    padding: 1.5rem;
}

.modal__description {
    font-size: 0.875rem;
    color: var(--color-text-body);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* ==========================================================================
   14. Footer Component (Rule 6)
   ========================================================================== */
.site-footer {
    background-color: var(--color-primary);
    color: #cbd5e1;
    padding: 3.5rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.site-footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.brand-logo--footer .brand-logo__title {
    color: #ffffff;
}

.brand-logo--footer .brand-logo__sub {
    color: #94a3b8;
}

.site-footer__about {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #94a3b8;
    margin: 1rem 0;
}

.site-footer__trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: #86efac;
    font-weight: 600;
}

.site-footer__heading {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

.site-footer__list {
    list-style: none;
}

.site-footer__list li {
    margin-bottom: 0.625rem;
}

.site-footer__list a {
    color: #94a3b8;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.site-footer__list a:hover {
    color: #ffffff;
}

.site-footer__contacts-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 600;
}

.footer-contact-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.site-footer__legal-links {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: #64748b;
}

.site-footer__legal-links a {
    color: #94a3b8;
}

.site-footer__bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
    gap: 1rem;
}

.site-footer__disclaimer {
    max-width: 600px;
    text-align: right;
}

/* ==========================================================================
   15. Responsive Breakpoints & Media Queries (Rules 6 & 8)
   Breakpoints: 320px, 375px, 425px, 768px, 1024px, 1440px
   ========================================================================== */

/* Tablet & Smaller (<= 1024px) */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }
    
    .burger-btn {
        display: flex;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-layout {
        grid-template-columns: 1fr;
    }

    .calc-grid {
        grid-template-columns: 1fr;
    }

    .site-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Devices (<= 768px) - Enforce Rule 6: flex column direction */
@media (max-width: 768px) {
    .top-bar__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
        padding: 0.5rem 1.25rem;
    }

    .top-bar__contacts {
        width: 100%;
        justify-content: space-between;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-trust-list {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr; /* 1 column on mobile as required */
    }

    .calc-pill-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .radio-channel-group {
        grid-template-columns: 1fr;
    }

    .article-gallery {
        grid-template-columns: 1fr;
    }

    .site-footer__grid {
        grid-template-columns: 1fr;
    }

    .site-footer__bottom {
        flex-direction: column;
        text-align: left;
        align-items: flex-start;
    }

    .site-footer__disclaimer {
        text-align: left;
    }
}

/* Small Mobile (<= 425px) */
@media (max-width: 425px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .category-card__actions {
        flex-direction: column;
    }

    .category-card__actions .btn {
        width: 100%;
    }
}

/* Extra Small (320px - 375px) */
@media (max-width: 375px) {
    .brand-logo__title {
        font-size: 0.9375rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }
}

/* Utility UI Icons */
.ui-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.ui-icon--green {
    color: var(--color-success);
}

.ui-icon--blue {
    color: var(--color-accent);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lead Forms Validation & Feedback States */
.form-group.is-invalid .form-input,
.form-group.is-invalid .form-select,
.field.is-invalid input,
.field.is-invalid select {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.field__err {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.form__ok {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    animation: fadeIn 0.25s ease;
}

.form__ok svg {
    flex-shrink: 0;
    color: #16a34a;
}

.form__fail {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    animation: fadeIn 0.25s ease;
}

body.is-locked {
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

