:root {
    /* Palette: Neo-Mint & Deep Ocean */
    --primary-color: #00E9A3;
    /* Bright Mint */
    --primary-hover: #00BFA5;
    --secondary-color: #1F2A44;
    /* Dark Blue */
    --bg-dark: #0B1120;
    /* Deepest Navy/Black */
    --bg-light: #151E32;
    /* Lighter Navy */
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --white: #ffffff;
    --error: #FF4D4D;

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

    --container-width: 1200px;
    --header-height: 70px;
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

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

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

ul {
    list-style: none;
}

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

/* --- Utilities --- */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section {
    padding: 80px 0;
}

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

/* --- Buttons (Unified) --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    /* Прозорий бордер за замовчуванням, щоб уникнути зміщень */
    border: 2px solid transparent;
    font-size: 1rem;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Загальний ефект підняття для всіх кнопок */
.btn:hover {
    transform: translateY(-3px);
}

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

.btn--primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(0, 233, 163, 0.4);
}

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

.btn--secondary:hover {
    background-color: rgba(0, 233, 163, 0.1);
    box-shadow: 0 4px 15px rgba(0, 233, 163, 0.2);
}

.btn--outline {
    border-color: var(--text-muted);
    background: transparent;
    color: var(--text-main);
}

.btn--outline:hover {
    border-color: var(--white);
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.05);
}

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

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

/* --- Header --- */
.header {
    background-color: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(10px);
    height: var(--header-height);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

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

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

.nav__link {
    position: relative;
    color: var(--text-main);
}

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

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

.nav__link:hover::after {
    width: 100%;
}

.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.burger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 5px 0;
    transition: var(--transition);
}

/* Mobile Menu */
@media (max-width: 1024px) {
    .burger {
        display: block;
        z-index: 101;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-dark);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
    }

    .nav.active {
        right: 0;
    }

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

    .burger.toggle span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .burger.toggle span:nth-child(2) {
        opacity: 0;
    }

    .burger.toggle span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

/* --- Hero --- */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    /* Фото: Абстрактна біо-технологічна сітка в тонах Mint/Deep Ocean */
    background: url('images/hero-bg.jpeg') center/cover no-repeat;
    margin-top: var(--header-height);
    background-attachment: fixed;
    /* Додає ефект паралаксу (фон стоїть на місці при скролі) */
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11, 17, 32, 0.9) 0%, rgba(11, 17, 32, 0.7) 100%);
}

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

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

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

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

.hero__actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- UNIFIED CARDS (Features, Services, Reviews) --- */
/* Цей блок забезпечує однакову поведінку для всіх карток */

.card,
.service-item,
.review-card {
    background-color: var(--bg-light);
    border-radius: var(--radius);
    padding: 30px;
    /* Базова прозора рамка */
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Hover ефект однаковий для всіх */
.card:hover,
.service-item:hover,
.review-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.card {
    text-align: center;
    /* Features card background is default bg-light defined in unified block */
}

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

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

/* --- Services (Masonry) Specifics --- */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 200px;
    gap: 20px;
}

.service-item {
    background-color: var(--secondary-color);
    /* Override default bg */
    justify-content: center;
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.service-item:hover::before {
    box-shadow: 0 0 10px var(--primary-color);
}

.service-item--large {
    grid-row: span 2;
    background-color: #2D3B55;
}

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

@media(max-width: 768px) {
    .service-item--wide {
        grid-column: span 1;
    }
}

/* --- Reviews Specifics --- */
.reviews__slider {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.review-card {
    min-width: 300px;
    flex: 1;
    justify-content: space-between;
}

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

.review-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.review-text {
    font-style: italic;
    color: var(--text-muted);
}

/* --- Contact & Forms --- */
.contact__wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

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

.contact__info {
    margin-bottom: 200px;
}

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

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

.contact__form {
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: var(--radius);
}

.form-group {
    position: relative;
    margin-bottom: 25px;
    height: 56px;
    /* Фіксуємо висоту контейнера для стабільності */
}

.form-group input {
    width: 100%;
    height: 100%;
    /* Розтягуємо на всю висоту контейнера */
    padding: 0 15px;
    /* Прибираємо верхній/нижній паддінг, використовуємо height */
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--white);
    outline: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    z-index: 1;
    cursor: text;
    display: flex;
    align-items: center;
    /* Центруємо текст всередині інпуту */
}

/* Hover Effect for Inputs */
.form-group input:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.form-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s ease-out;
    font-size: 1rem;
    z-index: 10;
    background-color: transparent;
    padding: 0 5px;
    margin: 0;
    line-height: 1;
    /* ВАЖЛИВО: Забирає зайві відступи зверху/знизу тексту */
}

/* Focus & Filled State (Floating Label) */
.form-group input:focus~label,
.form-group input:not(:placeholder-shown)~label {
    top: 0;
    transform: translateY(-50%) scale(0.9);
    color: var(--primary-color);
    background-color: var(--bg-light);
    /* Перекриває рамку */
    border-radius: 4px;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(0, 233, 163, 0.2);
}

.form-group small {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Autofill Fix */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-light) inset !important;
    -webkit-text-fill-color: var(--white) !important;
    transition: background-color 5000s ease-in-out 0s;
    z-index: 1;
}

.captcha-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    margin-top: 35px;
    /* Додав відступ, бо змінив height у form-group */
}

.captcha-group input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #444;
    background: transparent;
    color: white;
}

.form-message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.form-message.success {
    color: var(--primary-color);
}

.form-message.error {
    color: var(--error);
}

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

.captcha-group input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #444;
    background: transparent;
    color: white;
}

.form-message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.form-message.success {
    color: var(--primary-color);
}

.form-message.error {
    color: var(--error);
}

/* --- Footer --- */
.footer {
    background-color: black;
    padding: 60px 0 20px;
    border-top: 1px solid #222;
}

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

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

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

.footer__col ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer__col ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* --- Cookie Popup --- */
.cookie-popup {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 50px);
    width: 90%;
    max-width: 600px;
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--primary-color);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.5s ease;
}

.cookie-popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

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

@media(max-width: 600px) {
    .cookie-popup {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Modals --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal__content {
    background-color: var(--bg-light);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: var(--radius);
    padding: 40px;
    position: relative;
    z-index: 2001;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.modal__close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
}

.modal__body {
    overflow-y: auto;
    padding-right: 10px;
}

.modal__body h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal__body p {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}