/* =========================================
   1. THEME VARIABLES (Сплошные цвета)
========================================= */
:root,
html[data-theme='light'] {
    --color-primary: #1ea0aa;
    --color-primary-light: #25d5c9;
    --color-dark: #153f53;
    --color-text: #1e293b;
    --color-text-muted: #64748b;

    --color-bg: #f1f5f9;
    --color-bg-secondary: #e2e8f0;
    --color-bg-card: #ffffff;

    --color-border: rgba(21, 63, 83, 0.12);

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(21, 63, 83, 0.1);
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --surface-overlay: rgba(255, 255, 255, 0.6);
}

html[data-theme='dark'] {
    --color-primary: #1f8e88;
    --color-primary-light: #4dbfb9;
    --color-dark: #153f53;
    --color-text: #e5e7eb;
    --color-text-muted: rgba(255, 255, 255, 0.55);

    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-card: rgba(30, 41, 59, 0.7);

    --color-border: rgba(255, 255, 255, 0.08);

    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --surface-overlay: rgba(0, 0, 0, 0.4);
}

/* =========================================
   2. GLOBAL RESETS & LAYOUT
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: color 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
    width: 100%;
    flex: 1;
}

/* =========================================
   3. HEADER
========================================= */
.header {
    padding: 1rem 0;
    background: var(--glass-bg);
    border-bottom: 1px solid transparent;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.3s ease;
}

html[data-theme='light'] .header {
    border-bottom-color: rgba(255,255,255,0.5);
    background: rgba(255, 255, 255, 0.85);
}

html[data-theme='dark'] .header {
    border-bottom-color: rgba(255,255,255,0.05);
    background: rgba(15, 23, 42, 0.85);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo a {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav a {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav a:hover, .nav a.active {
    color: var(--color-primary);
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    border-radius: 50%;
    margin-left: 1rem;
}

.theme-toggle:hover {
    color: var(--color-primary);
    background: rgba(37, 213, 201, 0.1);
    transform: rotate(15deg);
}

.icon-sun, .icon-moon { display: none; }
html[data-theme='light'] .icon-moon { display: block; }
html[data-theme='dark'] .icon-sun {
    display: block;
    color: var(--color-primary-light);
}

/* =========================================
   4. FOOTER
========================================= */
.footer {
    margin-top: 3rem;
    padding: 3rem 0 1.5rem 0;
    background: var(--surface-overlay);
    border-top: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 3rem;
    margin-bottom: 1.5rem;
}

.footer-divider {
    width: 1px;
    height: 100%;
    background-color: var(--color-border);
    justify-self: center;
}

.footer-left { display: flex; gap: 3rem; justify-content: flex-end; }
.footer-right { display: flex; gap: 3rem; justify-content: flex-start; }
.footer-links { min-width: 120px; }

.footer-links h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.75rem; }

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover { color: var(--color-primary); }

/* --- ФИКС ИКОНОК СОЦСЕТЕЙ --- */
.footer-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover .footer-icon {
    opacity: 1;
    transform: scale(1.1);
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* =========================================
   5. FORMS
========================================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-card);
    color: var(--color-text);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 213, 201, 0.15);
}

/* =========================================
   6. UTILITIES
========================================= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary);
    color: #ffffff;
    transform: translateY(-5px);
}

.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 1000;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.cookie-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.cookie-banner a {
    color: var(--color-primary, #3b82f6);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.cookie-banner a:hover {
    color: var(--color-primary-hover, #2563eb);
    text-decoration-thickness: 2px;
}
.cookie-banner a:focus {
    outline: 2px solid var(--color-primary, #3b82f6);
    outline-offset: 2px;
    border-radius: 2px;
}
.cookie-banner a:active {
    color: var(--color-primary-active, #1d4ed8);
}

.btn-cookie-accept {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-cookie-accept:hover { transform: translateY(-2px); }

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 865px) {
    .container { padding: 1.5rem 1rem; }
    .header-container { flex-direction: column; gap: 1rem; }
    .nav { flex-wrap: wrap; justify-content: center; gap: 1rem; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    .footer-divider { display: none; }
    .footer-left, .footer-right { flex-direction: column; gap: 1.5rem; }

    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .footer-links ul {
        width: 100%;
    }

    .footer-links a {
        justify-content: center;
        width: 100%;
    }
}

