/* --- Variables & Reset --- */
:root {
    /* Random Palette: Deep Space & Cyber Cyan */
    --primary-bg: #0f111a;
    --secondary-bg: #161b2c;
    --primary: #00f2ea;
    --primary-hover: #00c7c0;
    --accent: #ff0055;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --white: #ffffff;

    --font-main: 'Sora', sans-serif;

    --transition: all 0.3s ease;
    --radius: 12px;
    --shadow: 0 10px 30px -10px rgba(0, 242, 234, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--primary-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Components --- */
.btn {
    display: inline-flex;
    /* Використовуємо flex для центрування тексту всередині */
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    /* Трохи збільшимо падінги */
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    text-align: center;
    white-space: nowrap;
    /* Забороняємо перенос тексту всередині кнопки */
    min-width: 180px;
    /* Мінімальна ширина, щоб кнопки були однакові */
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), #00a8a3);
    color: var(--primary-bg);
    box-shadow: 0 4px 15px rgba(0, 242, 234, 0.3);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 234, 0.4);
}

.btn--outline {
    border-color: var(--primary);
    color: var(--primary);
}

.btn--outline:hover {
    background: rgba(0, 242, 234, 0.1);
}

.btn--sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

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

.section {
    padding: 80px 0;
}

.section__title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    background: linear-gradient(to right, var(--white), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 17, 26, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--white);
}

.nav__list {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav__link:not(.btn) {
    color: var(--text-main);
    font-weight: 500;
    position: relative;
}

.nav__link:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav__link:not(.btn):hover::after {
    width: 100%;
}

/* --- Burger Menu Styles --- */
.burger {
    display: none;
    /* Ховаємо на десктопі */
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    /* Рівномірний розподіл */
    width: 30px;
    height: 20px;
    z-index: 2000;
    /* ВАЖЛИВО: Вище, ніж саме меню (.nav), щоб кнопку можна було натиснути */
    position: relative;
    padding: 0;
}

.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    /* Плавна анімація перетворення */
    transform-origin: center;
}

/* --- Анімація перетворення на Хрестик (Close Button) --- */

/* Коли додано клас .active (меню відкрите): */
.burger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    /* Верхня лінія опускається і повертається */
}

.burger.active span:nth-child(2) {
    opacity: 0;
    /* Середня лінія зникає */
    transform: translateX(-20px);
}

.burger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    /* Нижня лінія піднімається і повертається */
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    /* Pexels Tech Abstract Background (Dark/Blue theme) */
    background-image: url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--primary-bg), rgba(15, 17, 26, 0.7));
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--primary);
}

.hero__title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero__subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero__actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    /* Дозволяє перенос кнопок на новий рядок при стисненні */
    width: 100%;
}

.hero__note {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* --- Features & Services --- */
.bg-dark {
    background-color: var(--secondary-bg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.card__icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.service-item {
    background: var(--primary-bg);
    padding: 40px;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
}

/* --- Reviews --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.review-card {
    background: var(--secondary-bg);
    padding: 30px;
    border-radius: var(--radius);
}

.review-text {
    font-style: italic;
    margin-bottom: 20px;
    color: var(--text-main);
}

.review-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-placeholder {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-bg);
    font-weight: bold;
}

.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* Робить фото круглим */
    object-fit: cover;
    /* Обрізає фото, щоб не сплющувалося */
    border: 2px solid var(--primary);
    /* Додає кольорову обводку */
    margin-right: 15px;
    /* Відступ від тексту */
}

/* --- Contact --- */
.contact__container {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

.contact__info,
.contact__form {
    flex: 1;
    min-width: 300px;
}

.contact__list li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact__list i {
    color: var(--primary);
}

.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--white);
    outline: none;
    font-size: 1rem;
}

.form-group input:focus {
    border-color: var(--primary);
}

.form-group label {
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.form-group input:focus~label,
.form-group input:not(:placeholder-shown)~label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    background: var(--secondary-bg);
    padding: 0 5px;
    color: var(--primary);
}

.captcha-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

#captchaTask {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

#captchaInput {
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}

/* --- Footer --- */
.footer {
    background: #05060a;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer__col h4 {
    color: var(--white);
    margin-bottom: 20px;
}

.footer__col ul li {
    margin-bottom: 10px;
}

.footer__col a {
    color: var(--text-muted);
    transition: color 0.3s;
}

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

.footer__bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Cookie Popup --- */
.cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--secondary-bg);
    border-top: 2px solid var(--primary);
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.cookie-popup.hidden {
    transform: translateY(100%);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--secondary-bg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: var(--radius);
    padding: 40px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.modal-content h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.modal-content p,
.modal-content ul {
    margin-bottom: 15px;
    color: var(--text-muted);
}

.modal-content ul {
    padding-left: 20px;
    list-style: disc;
}

/* --- Mobile --- */
@media (max-width: 1024px) {
    .burger {
        display: flex;
        /* Показуємо бургер на мобільних */
    }

    .nav {
        position: fixed;
        top: 0;
        /* Перекриваємо весь екран */
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--secondary-bg);
        /* Або ваш колір фону */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1500;
        /* Менше, ніж у бургера (2000) */
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        transform: translateY(-100%);
        /* Виїжджає зверху */
    }

    .nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav__list {
        flex-direction: column;
        font-size: 1.5rem;
    }

    .hero__title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero__actions {
        flex-direction: column;
        /* Кнопки стають одна під одною */
        align-items: center;
        gap: 15px;
    }

    .btn {
        width: 100%;
        /* Кнопка розтягується */
        max-width: 320px;
        /* Але не ширше ніж 320px (стандарт мобільного екрану) */
        width: 100%;
    }
}