:root {
    --primary-color: #7123a8;
    --primary-dark: #5a1c87;
    --primary-light: #8b3cc5;
    --secondary-color: #10b981;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --bg-dark: #1F1F1F;
    --bg-gradient: linear-gradient(1turn, rgba(31,31,31,1) 0%, rgba(4,3,18,1) 100%);
    --bg-light: #2a2a2a;
    --bg-white: #1F1F1F;
    --border-color: #404040;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-gradient);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: transparent;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: none;
    border-bottom: none;
    transition: all 0.3s ease;
}

.header-over-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(31, 31, 31, 0.2);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header.scrolled {
    background: rgba(31, 31, 31, 0.3);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-over-hero.scrolled {
    background: rgba(31, 31, 31, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-over-hero .logo-text {
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.nav {
    display: flex;
    gap: 2rem;
}

.header-over-hero .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.header-over-hero .nav-link:hover {
    color: var(--primary-color);
    text-shadow: 0 1px 4px rgba(113, 35, 168, 0.5);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Hero Section */
.hero {
    padding: 0;
    text-align: center;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px; /* Отступ для фиксированного меню */
}

.hero-gallery-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(4, 3, 18, 0.7) 0%, rgba(31, 31, 31, 0.8) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    padding: 5rem 20px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero-logo-image {
    height: 360px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(113, 35, 168, 0.3));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hero Gallery Background */
.hero-gallery-bg .gallery-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-gallery-bg .gallery-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero .gallery-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 3;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
}

.gallery-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.gallery-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.gallery-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-dot.active {
    background: var(--primary-color);
    width: 12px;
    height: 12px;
    box-shadow: 0 0 8px rgba(113, 35, 168, 0.6);
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Services Section */
.services {
    padding: 5rem 0;
    background: rgba(42, 42, 42, 0.3);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: rgba(42, 42, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.service-title {
    color: var(--text-primary);
}

/* Calculator Section */
.calculator {
    padding: 5rem 0;
    background: transparent;
}

.calculator-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.calculator-form {
    background: rgba(42, 42, 42, 0.6);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(64, 64, 64, 0.5);
}

.form-group:last-of-type {
    border-bottom: none;
}

.form-group-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.input-label {
    color: var(--text-primary);
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.input-label {
    display: block;
}

.input-label-full {
    grid-column: 1 / -1;
}

.input-label span,
.input-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(31, 31, 31, 0.8);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input::placeholder {
    color: var(--text-secondary);
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

.input-value {
    width: 80px;
    text-align: center;
    margin-left: 1rem;
    padding: 0.5rem;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: rgba(64, 64, 64, 0.8);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.3s;
}

.slider:hover {
    background: rgba(64, 64, 64, 1);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(113, 35, 168, 0.5);
    transition: all 0.3s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(113, 35, 168, 0.8);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(113, 35, 168, 0.5);
    transition: all 0.3s;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(113, 35, 168, 0.8);
}

.slider::-moz-range-track {
    height: 8px;
    border-radius: 5px;
    background: rgba(64, 64, 64, 0.8);
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(113, 35, 168, 0.2);
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.checkbox-label:hover,
.radio-label:hover {
    background-color: rgba(113, 35, 168, 0.2);
}

.checkbox,
.radio {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    background-color: transparent;
    transition: all 0.3s;
}

.checkbox:checked,
.radio:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(113, 35, 168, 0.5);
}

.radio {
    border-radius: 50%;
}

.checkbox-label span,
.radio-label span {
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label,
.radio-label {
    color: var(--text-primary);
}

.calculator-result {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 0 20px rgba(113, 35, 168, 0.3);
}

.result-label {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.result-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

.btn-submit {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1.25rem;
    font-size: 1.25rem;
}

/* Contacts Section */
.contacts {
    padding: 5rem 0;
    background: rgba(42, 42, 42, 0.3);
}

.contacts-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.contact-image-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.contact-image {
    height: 150px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 4px 12px rgba(113, 35, 168, 0.2));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transition: transform 0.3s, opacity 0.3s;
}

.contact-image:hover {
    transform: scale(1.05);
    opacity: 1;
}

.contact-info {
    background: rgba(42, 42, 42, 0.6);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
}

.contact-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-title {
    color: var(--text-primary);
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.contact-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.contact-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.contact-text {
    color: var(--text-secondary);
}

.contact-social {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.3s;
}

.social-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.social-icon {
    font-size: 1.25rem;
}

/* Footer */
.footer {
    background: rgba(4, 3, 18, 0.8);
    color: var(--text-secondary);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.footer-logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.9;
}

.footer-text {
    opacity: 0.8;
    font-size: 0.875rem;
}

/* Popup успешной отправки */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.popup-content {
    background: var(--bg-gradient);
    border: 1px solid rgba(113, 35, 168, 0.3);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 24px rgba(113, 35, 168, 0.4);
    animation: popupIconBounce 0.6s ease-out;
}

@keyframes popupIconBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.popup-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.popup-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.popup-close {
    min-width: 200px;
}

/* Responsive Design */
/* Мобильная версия - скрыть текст логотипа и распределить меню */
@media (max-width: 768px) {
    .logo-text {
        display: none;
    }
    
    .header-content {
        padding: 0.75rem 0;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .nav {
        display: flex;
        flex: 1;
        justify-content: space-around;
        gap: 0.5rem;
        margin-left: 1rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.5rem;
        flex: 1;
        text-align: center;
        white-space: nowrap;
        min-width: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .gallery-slider {
        padding-bottom: 56.25%; /* Сохраняем 16:9 */
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-logo-image {
        height: 240px;
    }

    .contact-image {
        height: 100px;
    }

    .calculator-form {
        padding: 2rem 1.5rem;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .result-value {
        font-size: 2rem;
    }

    .contact-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-label {
        min-width: auto;
    }

    .contact-social {
        flex-direction: column;
    }

    .social-link {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 35px;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.3rem;
    }
    
    .hero {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-logo-image {
        height: 180px;
    }

    .gallery-slider {
        padding-bottom: 56.25%; /* Сохраняем 16:9 */
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .calculator-form {
        padding: 1.5rem 1rem;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

