/* --- Variables & Reset --- */
:root {
    /* Palette: Dark Tech Theme */
    --primary: #00B4D8;
    /* Vibrant Teal/Blue */
    --primary-dark: #0077B6;
    --secondary: #03045E;
    /* Deep Navy */
    --accent: #FF6B6B;
    /* Coral for urgency */
    --text-main: #333333;
    --text-light: #F8F9FA;
    --bg-light: #FFFFFF;
    --bg-gray: #F0F4F8;

    --font-head: 'Manrope', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

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

h1,
h2,
h3,
h4 {
    font-family: var(--font-head);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

.section {
    padding: 80px 0;
}

.section__title {
    font-size: 2.5rem;
    color: var(--secondary);
    text-align: center;
    margin-bottom: 10px;
}

.section__subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 50px;
    font-size: 1.1rem;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.btn--primary {
    background-color: var(--primary);
    color: #fff;
}

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

.btn--outline {
    border-color: #fff;
    color: #fff;
}

.btn--outline:hover {
    background-color: #fff;
    color: var(--secondary);
}

.btn--small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* --- Header --- */
.header {
    background-color: var(--bg-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
}

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

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

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

.nav__list {
    display: flex;
    gap: 30px;
}

.nav__link {
    font-weight: 600;
    color: var(--secondary);
}

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

.nav__close {
    display: none;
}

.burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.burger span {
    width: 25px;
    height: 3px;
    background-color: var(--secondary);
    transition: var(--transition);
}

/* Mobile Nav */
@media (max-width: 1024px) {
    .burger {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--secondary);
        flex-direction: column;
        justify-content: center;
        transition: 0.4s;
    }

    .nav.active {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .nav__link {
        color: #fff;
        font-size: 1.5rem;
    }

    .nav__close {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        color: #fff;
        font-size: 2rem;
        cursor: pointer;
    }
}

/* --- Hero --- */
.hero {
    height: 100vh;
    background: url('images/hero-bg.jpg') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
    padding-top: 70px;
    background-attachment: fixed;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 4, 94, 0.7);
    /* Overlay matches secondary color */
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    /* Центрує сам блок по горизонталі */
    text-align: center;
    /* Центрує текст всередині блоку */
}

.badge {
    background-color: var(--accent);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

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

.hero__subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero__actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    /* Вирівнює кнопки по центру */
    margin-top: 30px;
    /* Невеликий відступ зверху для краси */
}

@media (max-width: 768px) {
    .hero__title {
        font-size: 2rem;
    }
}

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

.feature-card {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
}

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

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--secondary);
}

/* --- Services --- */
.services {
    background-color: var(--bg-gray);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.service-item {
    background: var(--secondary);
    color: #fff;
    padding: 30px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    opacity: 0;
    transition: var(--transition);
}

.service-item:hover::before {
    opacity: 1;
}

.service-item h3 {
    z-index: 1;
    margin-bottom: 10px;
}

.service-item p {
    z-index: 1;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- Reviews --- */
.reviews__slider {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.review-card {
    background: #fff;
    border-left: 5px solid var(--accent);
    padding: 25px;
    box-shadow: var(--shadow);
    max-width: 500px;
    flex: 1;
}

.review-card__header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.review-card__avatar {
    width: 60px;
    /* Трохи збільшив розмір для фото */
    height: 60px;
    border-radius: 50%;
    /* Робить фото ідеально круглим */
    object-fit: cover;
    /* Обрізає фото, щоб не сплющувалось */
    border: 2px solid var(--primary);
    /* Додає кольорову рамку в стилі сайту */
    background-color: var(--bg-gray);
    /* Фон на випадок, якщо картинка не завантажиться */
    flex-shrink: 0;
    /* Забороняє стискатися фотографії */
}

/* --- Contact --- */
.contact {
    background-color: var(--bg-light);
}

.contact__wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

@media (max-width: 768px) {
    .contact__wrapper {
        grid-template-columns: 1fr;
    }
}

.contact__list li {
    margin-top: 0;
    /* ВИПРАВЛЕНО: додано значення 0 */
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

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

.form__group {
    margin-bottom: 20px;
}

.form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    transition: var(--transition);
}

.form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.btn__spinner {
    display: none;
    margin-left: 10px;
}

.btn.loading .btn__text {
    display: none;
}

.btn.loading .btn__spinner {
    display: inline-block;
}

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

/* --- Footer --- */
.footer {
    background-color: #1a1b2e;
    /* Very dark blue */
    color: #fff;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

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

.logo--footer {
    color: #fff;
    margin-bottom: 15px;
}

.footer h4 {
    margin-bottom: 20px;
    color: var(--primary);
}

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

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

/* --- Cookie Popup Adaptive Fix --- */
.cookie-popup {
    position: fixed;
    bottom: -200px;
    /* Збільшено зсув для приховання на великих екранах */
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 9999;
    transition: bottom 0.5s ease;
    border-top: 3px solid var(--primary);
    /* Важливо для мобільних: враховуємо safe area (айфони) */
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.cookie-popup.active {
    bottom: 0;
}

.cookie-popup__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    /* Дозволяємо перенесення на нові рядки */
}

@media(max-width: 600px) {
    .cookie-popup {
        padding: 15px 20px calc(15px + env(safe-area-inset-bottom));
    }

    .cookie-popup__content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .cookie-popup__actions {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 10px;
    }
}

/* --- Modal Fix: Absolute Centering --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    display: block;
    /* Використовуємо звичайний блок, не flex */
}

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

.modal {
    /* Жорстке позиціонування по центру */
    position: absolute;
    top: 50%;
    left: 50%;
    /* Зміщуємо назад на 50% своєї ширини/висоти + початковий масштаб */
    transform: translate(-50%, -50%) scale(0.9);

    background: #fff;
    width: 90%;
    /* Щоб на мобільних не вилазило */
    max-width: 500px;
    /* Максимальна ширина */
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);

    margin: 0;
    /* Обов'язково скидаємо відступи! */

    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;

    /* Якщо контент довгий, з'явиться скрол всередині модалки */
    max-height: 85vh;
    overflow-y: auto;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    /* Важливо: зберігаємо translate, змінюємо лише scale */
    transform: translate(-50%, -50%) scale(1);
}

/* Стиль хрестика (без змін) */
.modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

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

.modal__content h3 {
    margin-bottom: 20px;
    color: var(--secondary);
}

.modal__content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal__content p {
    margin-bottom: 15px;
}