:root {
    --primary-color: #00d2ff;
    --primary-hover: #00b8e6;
    --secondary-color: #7b2cbf;
    --bg-dark: #0a0a12;
    --bg-card: #151520;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --border-color: #2a2a35;
    --font-main: 'Sora', sans-serif;
    --container-width: 1200px;
    --header-height: 80px;
    --transition: all 0.3s ease;
}

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

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 {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section__title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section__subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 50px;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(123, 44, 191, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(123, 44, 191, 0.5);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 210, 255, 0.3);
    color: var(--text-main);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.2);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 2;
}

.btn-primary:hover::after {
    left: 120%;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
    border-radius: 14px;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 10px;
}

.btn-block {
    width: 100%;
}

/* Header */
.header {
    background: rgba(10, 10, 18, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

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

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

.logo__text {
    background: linear-gradient(90deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

.burger {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition);
    position: absolute;
}

.burger span:first-child {
    top: 0;
}

.burger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.burger span:last-child {
    bottom: 0;
}

.burger.active span:first-child {
    transform: rotate(45deg);
    top: 9px;
}

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

.burger.active span:last-child {
    transform: rotate(-45deg);
    bottom: 9px;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    background: url('images/hero-bg.jpg') no-repeat center center/cover;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 10, 18, 0.7), var(--bg-dark));
}

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

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

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

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

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

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

.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

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

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Services */
.services__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Masonry-like fallback */
    gap: 20px;
}

.service-item {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.service-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.service-item:hover img {
    transform: scale(1.1);
}

.service-item__content {
    padding: 20px;
}

.service-item h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

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

.review-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

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

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

.review-card__header h4 {
    margin: 0;
    font-size: 1rem;
}

.review-card__header span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

/* Contacts */
.contacts__wrapper {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

.contacts__info {
    flex: 1;
    min-width: 300px;
}

.contacts__info h3 {
    margin-bottom: 20px;
}

.contacts__info p {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.contacts__info i {
    color: var(--primary-color);
    width: 20px;
}

.contacts__note {
    margin-top: 30px;
    font-size: 0.9rem;
    padding: 15px;
    background: rgba(0, 210, 255, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
}

.contacts__form {
    flex: 1;
    min-width: 300px;
    background: var(--bg-card);
    padding: 30px;
    border-radius: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-main);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-page-wrapper {
    padding-top: 140px;
    padding-bottom: 80px;
    min-height: 80vh;
}

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

.captcha-group span {
    font-weight: 700;
    font-size: 1.2rem;
    white-space: nowrap;
}

.captcha-group input {
    width: 80px;
}

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

.form-success {
    display: none;
    margin-top: 15px;
    color: #4cd964;
    text-align: center;
}

/* Footer */
.footer {
    background: #050508;
    padding: 60px 0 20px;
    border-top: 1px solid var(--border-color);
}

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

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

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

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

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-card);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 20px;
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    /* Ensure the modal itself doesn't scroll */
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 9999;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-content {
    overflow-y: auto;
    padding: 30px;
    flex: 1;
    scroll-behavior: smooth;
    /* Top padding so the button doesn't overlap the header */
    padding-top: 60px;
}

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

.modal-content h4 {
    margin: 15px 0 10px;
}

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

.modal-content li {
    margin-bottom: 5px;
}

/* Cookie Popup */
.cookie-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 15px;
    z-index: 3000;
    border: 1px solid var(--primary-color);
    max-width: 400px;
    transform: translateY(150%);
    transition: transform 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.cookie-popup.active {
    transform: translateY(0);
}

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

.cookie-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

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

/* Mobile Responsive */
@media (max-width: 1024px) {
    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav__list {
        flex-direction: column;
        gap: 30px;
        font-size: 1.5rem;
        margin-top: 200px;
    }

    .burger {
        display: block;
    }

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

@media (max-width: 768px) {
    .hero__buttons {
        flex-direction: column;
    }

    .section__title {
        font-size: 2rem;
    }

    .contacts__wrapper {
        flex-direction: column;
    }
}