/* THEME: Neon Cyberpunk (Oscilon Byte)
   PALETTE: Navy Blue, Neon Green, White, Glassmorphism
*/

:root {
    --bg-dark: #0a192f;
    --bg-light: #112240;
    --primary: #64ffda;
    /* Neon Green */
    --secondary: #bd93f9;
    /* Soft Purple */
    --text-main: #e6f1ff;
    --text-muted: #8892b0;
    --white: #ffffff;
    --error: #ff5555;
    --success: #50fa7b;

    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Roboto Mono', monospace;

    --radius-xl: 1.5rem;
    --shadow-soft: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
    --shadow-neon: 0 0 10px rgba(100, 255, 218, 0.3);

    --transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 700;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.9rem;
}

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

.btn--primary:hover {
    background: rgba(100, 255, 218, 0.1);
    box-shadow: var(--shadow-neon);
    transform: translateY(-2px);
}

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

.btn--outline:hover {
    background: rgba(100, 255, 218, 0.1);
    box-shadow: var(--shadow-neon);
    transform: translateY(-2px);
}

.btn--text {
    color: var(--secondary);
    background: transparent;
}

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

.btn--full {
    width: 100%;
    background: var(--primary);
    color: var(--bg-dark);
}

.btn--full:hover {
    background: var(--white);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

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

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

.logo__text .highlight {
    color: var(--primary);
}

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

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

.nav__close {
    display: none;
}

.burger {
    display: none;
}

/* Hero Section - Fixed Responsiveness */
.hero {
    min-height: 100vh;
    /* Использовать dvh для корректного отображения на мобильных с адресной строкой */
    min-height: 100dvh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    /* Отступ под хедер */
    padding-bottom: 60px;
    background: radial-gradient(circle at 50% 50%, #172a45 0%, #0a192f 100%);
    overflow: hidden;
    /* Скрываем лишнее при ресайзе */
}

.hero__container {
    display: grid;
    /* Резиновая сетка: 2 колонки на больших, 1 на маленьких */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(30px, 5vw, 60px);
    /* Резиновый отступ между текстом и картинкой */
    align-items: center;
    width: 100%;
}

.hero__content {
    /* Если экран большой - контент слева, если маленький - по центру (автоматически grid) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 255, 218, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    margin-bottom: 24px;
    border: 1px solid var(--primary);
    width: fit-content;
    /* Чтобы бейдж не растягивался на всю ширину на мобильных */
    max-width: 100%;
}

.hero__title {
    /* Самое важное: резиновый шрифт. 
       Минимум 2rem, предпочтительно 5vw, максимум 3.5rem */
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}

.hero__subtitle {
    color: var(--text-muted);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    /* Также резиновый шрифт */
    margin-bottom: 35px;
    max-width: 550px;
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    /* Кнопки переносятся, если не влезают */
    gap: 20px;
    margin-bottom: 30px;
}

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

/* Карточка с картинкой */
.hero__visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-card {
    background: rgba(17, 34, 64, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 600px;
    /* Ограничение ширины картинки */
}

.hero__img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.hero__floating-card {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--bg-dark);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.hero__floating-card strong {
    color: var(--success);
}

/* Sections */
.section {
    padding: 80px 0;
}

.section__title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section__desc {
    color: var(--text-muted);
    margin-bottom: 50px;
}

/* Features Grid */
.about {
    overflow: hidden;
    /* Чтобы анимации не вызывали гориз. скролл */
}

.features-grid {
    display: grid;
    /* Базовая логика: авто-заполнение, но не уже 260px */
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(20px, 3vw, 40px);
    /* Резиновый отступ между картами */
    margin-top: 40px;
}

.feature-card {
    background: var(--bg-light);
    /* Или ваш цвет фона карточки */
    padding: clamp(20px, 5vw, 35px);
    /* Резиновые внутренние отступы */
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);

    /* Делаем карточку флекс-контейнером, чтобы контент ровно распределялся */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    /* Растягиваем на всю высоту ячейки грида */
}

.feature-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    /* Чуть светлее при наведении */
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    /* Фиксируем высоту иконки, чтобы тексты начинались на одном уровне */
    height: 50px;
    display: flex;
    align-items: center;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--text-main);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: auto;
    /* Если нужно прижать что-то к низу, но здесь просто красивый текст */
}

/* Services Masonry */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 20px;
    margin-top: 40px;
}

.masonry-item {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bg-light);
}

.masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: var(--transition);
}

.masonry-item:hover img {
    opacity: 0.3;
    transform: scale(1.1);
}

.masonry-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 2;
}

.item--large {
    grid-column: span 2;
    grid-row: span 2;
}

.item--wide {
    grid-column: span 2;
}

.service-card {
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.highlight-bg {
    background: var(--primary);
    color: var(--bg-dark);
}

.highlight-bg p {
    color: #0a192f;
}

/* Reviews */
.reviews-slider {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.review-card {
    min-width: 300px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius-xl);
    border-left: 4px solid var(--primary);
}

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

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

/* --- CONTACT SECTION CENTERED FIX --- */

.contact {
    padding: 80px 0;
}

/* Обертка-карточка */
.contact-wrapper {
    background: rgba(17, 34, 64, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: var(--radius-xl);
    padding: 50px;
    overflow: hidden;

    /* ЦЕНТРУВАННЯ САМОЇ КАРТКИ */
    max-width: 800px;
    /* Обмежуємо ширину, щоб не була на весь екран */
    margin: 0 auto;
    /* Ставимо по центру сторінки */

    /* Центрування контенту всередині */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Стили текстової частини */
.contact-info {
    margin-bottom: 40px;
    /* Відступ до форми */
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Лінія знизу */
    padding-bottom: 30px;
}

.contact-info h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: var(--white);
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Список контактів по центру */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    /* Центруємо елементи списку */
}

.contact-list li {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Центруємо текст і іконку */
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.contact-list a {
    color: var(--text-main);
    text-decoration: none;
    transition: 0.3s;
}

.contact-list a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(100, 255, 218, 0.4);
}

.contact-list li:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(100, 255, 218, 0.4);
}

/* --- FORM STYLES --- */
#contactForm {
    width: 100%;
    max-width: 500px;
    /* Обмежуємо ширину форми для краси */
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
    /* Підписи полів залишаємо зліва для зручності */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

/* Інпути */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(10, 25, 47, 0.5);
    border: 1px solid rgba(136, 146, 176, 0.2);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(100, 255, 218, 0.05);
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.15);
}

/* Hint */
.hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Капча */
.captcha-group {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.captcha-group input {
    width: 80px;
    text-align: center;
    font-weight: bold;
}

.captcha-group label {
    margin-bottom: 0;
    color: var(--white);
}

/* Чекбокс */
.checkbox-group {
    display: flex;
    align-items: center;
    /* Центруємо чекбокс з текстом */
    justify-content: center;
    /* По центру форми */
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

/* Footer */
.footer {
    background: #020c1b;
    padding: 60px 0 20px;
    font-size: 0.9rem;
    border-top: 1px solid #233554;
}

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

.footer__logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
    display: block;
    margin-bottom: 20px;
}

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

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

.footer__col a,
.footer-link {
    color: var(--text-muted);
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
    font-size: 0.9rem;
}

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

.footer__bottom {
    text-align: center;
    border-top: 1px solid #233554;
    padding-top: 20px;
    color: var(--text-muted);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 12, 27, 0.9);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-light);
    padding: 40px;
    border-radius: var(--radius-xl);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    overflow-y: auto;
    border: 1px solid var(--primary);
}

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

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

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

.legal-text h3 {
    color: var(--secondary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.legal-text p,
.legal-text li {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-muted);
}

/* Cookie Popup */
.cookie-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    z-index: 900;
    max-width: 350px;
    box-shadow: var(--shadow-soft);
}

.cookie-content p {
    font-size: 0.85rem;
    margin-bottom: 15px;
}

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

/* Status Messages */
.form-status {
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
}

.status-success {
    color: var(--success);
}

.status-error {
    color: var(--error);
}

/* Spinner */
.loader {
    width: 16px;
    height: 16px;
    border: 2px solid var(--bg-dark);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .hero__container {
        grid-template-columns: 1fr;
        /* Одна колонка */
        text-align: center;
        gap: 40px;
    }

    .hero__content {
        align-items: center;
        /* Центрируем контент по горизонтали */
    }

    .hero__subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero__actions {
        justify-content: center;
    }

    /* Уменьшаем картинку на планшетах, чтобы не занимала весь экран */
    .glass-card {
        max-width: 80%;
        margin: 0 auto;
    }
}

/* Мобильные телефоны (до 768px) */
@media (max-width: 768px) {
    .hero {
        padding-top: 100px;
        /* Больше места под меню */
        align-items: flex-start;
        /* Поднимаем контент выше */
    }

    .hero__title {
        font-size: 2.2rem;
        /* Фиксируем размер для удобства чтения */
    }

    .hero__actions {
        flex-direction: column;
        /* Кнопки друг под другом */
        width: 100%;
    }

    .btn {
        width: 100%;
        /* Кнопки на всю ширину */
        text-align: center;
    }

    /* На мобильных можно скрыть парящую карточку или уменьшить */
    .hero__floating-card {
        padding: 5px 10px;
        font-size: 0.75rem;
        bottom: 10px;
        right: 10px;
    }

    .glass-card {
        max-width: 100%;
    }

    .masonry-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .item--large,
    .item--wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        background: var(--bg-light);
        flex-direction: column;
        justify-content: center;
        transition: 0.3s;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav.open {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        margin-top: 60px;
    }

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

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

    .burger span {
        width: 30px;
        height: 3px;
        background: var(--primary);
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .reviews-slider {
        /* На планшетах і ПК перемикаємось на Grid */
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        /* Автоматичні колонки */
        overflow-x: visible;
        /* Вимикаємо скрол */
        gap: 30px;
    }

    .review-card {
        /* Скидаємо мобільні обмеження */
        flex: none;
        width: auto;
        max-width: none;
        min-width: 0;
    }

    /* Ховер ефект тільки для мишки */
    .review-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px -10px rgba(100, 255, 218, 0.15);
        border-color: var(--primary);
    }
}

@media (min-width: 650px) and (max-width: 1100px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature-card {
    background: var(--bg-light);
    /* Или ваш цвет фона карточки */
    padding: clamp(20px, 5vw, 35px);
    /* Резиновые внутренние отступы */
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);

    /* Делаем карточку флекс-контейнером, чтобы контент ровно распределялся */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    /* Растягиваем на всю высоту ячейки грида */
}

/* Мобильная адаптация */
@media (max-width: 649px) {
    .features-grid {
        grid-template-columns: 1fr;
        /* Строго одна колонка */
        gap: 20px;
    }

    .feature-card {
        padding: 25px;
    }
}