/* ===========================================================================
   FAQ TEMPLATE V6 - "Smart Accordion"
   Clean, Organized, Efficient Design
   Smooth Animations | Accordion Layout | Progressive Disclosure
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

/* ===========================================================================
   CSS VARIABLES
   =========================================================================== */

:root {
    /* Green Palette - Trust & Growth */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --primary-lightest: #d1fae5;
    
    --secondary: #14b8a6;
    --accent: #06b6d4;
    
    /* Neutrals */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border: #e5e7eb;
    
    /* Semantic Colors */
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
}

/* ===========================================================================
   BASE
   =========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================================================================
   BODY - CLEAN BACKGROUND
   =========================================================================== */

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1rem, 2vw, 1.0625rem);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2rem);
}

/* Subtle gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(180deg, 
            rgba(16, 185, 129, 0.03) 0%, 
            transparent 50%,
            rgba(16, 185, 129, 0.02) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ===========================================================================
   CONTAINER
   =========================================================================== */

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-primary);
    padding: clamp(2rem, 5vw, 3.5rem);
    border-radius: clamp(1rem, 2vw, 1.5rem);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
    animation: fadeIn 0.6s ease-out;
}

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

/* Green accent bar */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 1.5rem 1.5rem 0 0;
}

/* ===========================================================================
   HEADER - COMPACT & CLEAN
   =========================================================================== */

header {
    text-align: center;
    padding-bottom: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    border-bottom: 2px solid var(--border);
    position: relative;
}

/* Animated icon */
h1::before {
    content: '❓';
    display: block;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 0.75rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===========================================================================
   STATS - MINIMAL BADGES
   =========================================================================== */

.stats {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2rem);
    flex-wrap: wrap;
    margin: clamp(1.25rem, 3vw, 1.75rem) 0;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem);
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    background: var(--primary-lightest);
}

.stat-value {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: clamp(0.8rem, 1.5vw, 0.875rem);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

/* ===========================================================================
   NAVIGATION - ACCORDION CARDS
   =========================================================================== */

nav {
    margin-top: clamp(1.5rem, 4vw, 2rem);
}

ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 2vw, 1rem);
}

/* Stagger animation */
li {
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

li:nth-child(1) { animation-delay: 0.05s; }
li:nth-child(2) { animation-delay: 0.1s; }
li:nth-child(3) { animation-delay: 0.15s; }
li:nth-child(4) { animation-delay: 0.2s; }
li:nth-child(5) { animation-delay: 0.25s; }
li:nth-child(6) { animation-delay: 0.3s; }
li:nth-child(7) { animation-delay: 0.35s; }
li:nth-child(8) { animation-delay: 0.4s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===========================================================================
   QUESTION CARDS - CLEAN ACCORDION STYLE
   =========================================================================== */

a {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 1.25rem);
    padding: clamp(1rem, 3vw, 1.5rem);
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 0.875rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: clamp(0.95rem, 2vw, 1.0625rem);
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 68px;
}

/* Left border accent */
a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0.875rem 0 0 0.875rem;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover,
a:focus-visible {
    border-color: var(--primary);
    background: var(--bg-secondary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

a:hover::before,
a:focus-visible::before {
    transform: scaleY(1);
}

/* Number badge - circular minimal */
.number {
    flex-shrink: 0;
    width: clamp(2.25rem, 5vw, 2.75rem);
    height: clamp(2.25rem, 5vw, 2.75rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: clamp(0.95rem, 2vw, 1.125rem);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

a:hover .number {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Question text */
a span:not(.number) {
    flex: 1;
}

/* Arrow indicator */
a::after {
    content: '→';
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

a:hover::after,
a:focus-visible::after {
    opacity: 1;
    transform: translateX(0);
}

/* ===========================================================================
   SEARCH BAR (Optional - styled if present)
   =========================================================================== */

.search-container {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    position: relative;
}

.search-input {
    width: 100%;
    padding: clamp(0.875rem, 2vw, 1.125rem) clamp(1rem, 3vw, 1.5rem);
    padding-left: clamp(2.75rem, 5vw, 3.5rem);
    font-size: clamp(0.95rem, 2vw, 1.0625rem);
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: 0.875rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-lightest);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-icon {
    position: absolute;
    left: clamp(0.875rem, 2vw, 1.125rem);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--text-tertiary);
}

/* ===========================================================================
   CATEGORY TAGS (Optional)
   =========================================================================== */

.categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.category-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.category-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===========================================================================
   LANGUAGE SWITCHER - MINIMAL FLOATING
   =========================================================================== */

.language-switcher {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.language-switcher:hover {
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.lang-label {
    font-size: 1.125rem;
}

.language-switcher select {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem;
    font-family: inherit;
}

.language-switcher select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* ===========================================================================
   FOOTER
   =========================================================================== */

footer {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: clamp(1.5rem, 4vw, 2rem);
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-tertiary);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
}

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }
    
    .container {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    .stats {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stat {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .language-switcher {
        bottom: 1rem;
        right: 1rem;
        padding: 0.625rem 0.875rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 2.5rem;
    }
}

@media (min-width: 1024px) {
    body {
        padding: 2rem;
    }
    
    .container {
        padding: 3.5rem;
    }
}

/* ===========================================================================
   ACCESSIBILITY
   =========================================================================== */

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

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

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    a,
    .stat,
    .search-input {
        border-width: 3px;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-tertiary: #9ca3af;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --bg-tertiary: #374151;
        --border: #374151;
    }
    
    .container {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }
    
    body::before {
        background: 
            linear-gradient(180deg, 
                rgba(16, 185, 129, 0.05) 0%, 
                transparent 50%,
                rgba(16, 185, 129, 0.03) 100%);
    }
}

/* Print */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    body::before {
        display: none;
    }
    
    .container {
        box-shadow: none;
        padding: 1rem;
    }
    
    .language-switcher {
        display: none;
    }
    
    a {
        page-break-inside: avoid;
    }
    
    a::after {
        display: none;
    }
}

/* ===========================================================================
   CTA SECTION (Call-to-Action Block)
   Стили для кнопки призыва к действию на index страницах
   =========================================================================== */

.cta-section {
    margin: clamp(2rem, 5vw, 3rem) 0;
}

.cta-block {
    background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--secondary, #8b5cf6) 100%);
    color: white;
    border-radius: clamp(1rem, 2vw, 1.5rem);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmerCta 3s infinite;
}

@keyframes shimmerCta {
    0% { left: -100%; }
    100% { left: 100%; }
}

.cta-block h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: white;
    position: relative;
    z-index: 1;
}


.cta-description {
    font-size: clamp(0.95rem, 2vw, 1.125rem);
    margin-bottom: 1.5rem;
    opacity: 0.95;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: clamp(0.875rem, 2vw, 1.125rem) clamp(1.5rem, 4vw, 2.5rem);
    background: white;
    color: var(--primary, #6366f1);
    font-weight: 800;
    font-size: clamp(1rem, 2vw, 1.125rem);
    border: none;
    border-radius: 3rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 52px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cta-button::after {
    content: '→';
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.cta-button:hover::after {
    transform: translateX(5px);
}

/* ===========================================================================
   LANGUAGE SWITCHER FOOTER (Переключатель языков в футере)
   =========================================================================== */

.language-switcher-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.05));
    border-radius: 1rem;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    text-decoration: none;
    border-radius: 0.75rem;
    background: var(--bg-primary, white);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lang-flag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--primary, #6366f1);
}

.lang-flag.active {
    border-color: var(--primary, #6366f1);
    background: var(--primary, #6366f1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ===========================================================================
   RESPONSIVE для CTA и Language Switcher
   =========================================================================== */

@media (max-width: 640px) {
    .cta-block {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    .cta-button {
        width: 100%;
        justify-content: center;
    }
    
    .language-switcher-footer {
        padding: 0.75rem;
        gap: 0.375rem;
    }
    
    .lang-flag {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

@media (prefers-color-scheme: dark) {
    .language-switcher-footer {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .lang-flag {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .lang-flag:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* FAQ: Кастомизация CTA для зелёной темы */
.cta-block {
    background: linear-gradient(135deg, var(--primary, #10b981) 0%, var(--primary-dark, #059669) 100%);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
}

.lang-flag:hover {
    border-color: var(--primary, #10b981);
}

.lang-flag.active {
    background: var(--primary, #10b981);
    border-color: var(--primary, #10b981);
}
