/* Base Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --accent-color: #e74c3c;
    --text-color: #333;
    --text-light: #7f8c8d;
    --white: #fff;
    --black: #000;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

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

a:hover {
    color: #FFFFFF;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #35b014;
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.btn-play {
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    font-size: 1.2rem;
    padding: 15px 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-play:hover {
    background-color: var(--accent-color);
}

section {
    padding: 80px 0;
}

h1, h2, h3, h4 {
    margin-bottom: 20px;
    font-weight: 700;
    color: #3498db;
}

p {
    margin-bottom: 15px;
}

ul {
    list-style: none;
}

/* =================== FORM POPUP (НОВОЕ) =================== */
.form-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.form-popup.active {
    display: flex;
}

.form-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.form-popup-content {
    position: relative;
    background-color: #fff;
    border-radius: 20px;
    padding: 40px 35px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    animation: popupSlideIn 0.4s ease;
    z-index: 4001;
}

.form-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.form-popup-close:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.form-popup-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.form-popup-icon.success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.form-popup-icon.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.form-popup-content h3 {
    color: #2c3e50;
    font-size: 1.7rem;
    margin-bottom: 12px;
}

.form-popup-content p {
    color: #555;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.form-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    padding: 12px 35px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.3);
}

.form-popup-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

/* Navigation */
.navbar {
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
}

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    color: var(--dark-color);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.nav-menu a i {
    margin-right: 8px;
    font-size: 0.9rem;
}

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

.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 0px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero .container {
    position: relative;
    z-index: 1;
    color: var(--white);
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Camera Section */
.camera-section {
    background-color: var(--white);
}

.camera-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    position: relative;
}

.camera-preview {
    position: relative;
    padding-top: 56.25%;
    background-color: var(--black);
}

.camera-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    overflow: hidden;
}

.video-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px;
    transform: translateZ(0);
    will-change: transform;
    transform-style: preserve-3d;
}

.close-modal {
    position: absolute;
    top: -10px;
    right: 10px;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

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

.video-info-box {
    position: absolute;
    top: -20px;
    left: -20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 5px;
    z-index: 2001;
    max-width: 330px;
    font-size: 0.8rem;
    padding-right: 25px;
    position: relative;
}

.video-info-box-close {
    position: absolute;
    top: -5px;
    right: 5px;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.video-info-box-close:hover {
    opacity: 1;
    color: var(--accent-color);
}

.video-info-box p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.video-info-box i {
    margin-right: 5px;
}

#video-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* About Section */
.about-section {
    background-color: var(--white);
}

.about-content {
    display: flex;
    gap: 40px;
}

.about-text {
    flex: 2;
}

.about-text ul {
    margin: 20px 0;
}

.about-text li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.about-text li i {
    margin-right: 10px;
    color: var(--primary-color);
}

.testimonial {
    flex: 1;
    background-color: var(--light-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.testimonial blockquote {
    font-style: italic;
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--primary-color);
}

.testimonial footer {
    margin-top: 15px;
    font-weight: 600;
    text-align: right;
}

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

.contact-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

.contact-section h2 i {
    margin-right: 10px;
}

.contact-content {
    display: flex;
    gap: 40px;
    align-items: stretch;
}

.contact-form-wrapper {
    flex: 1;
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.contact-form-wrapper form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    width: 100%;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    background-color: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.captcha-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.captcha-group input[type="number"] {
    max-width: 200px;
}

.contact-form-wrapper .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.05rem;
    margin-top: 10px;
}

.contact-form-wrapper .btn i {
    margin-right: 8px;
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-map {
    flex: 1;
    min-height: 350px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.map-container {
    position: relative;
    padding-top: 56.25%;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    flex: 2;
}

.footer-logo .logo {
    color: var(--white);
}

.footer-logo .logo span {
    color: var(--primary-color);
}

.footer-logo p {
    margin-top: 15px;
    color: var(--light-color);
}

.footer-links {
    flex: 1;
}

.footer-links h4 {
    color: var(--white);
}

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

.footer-links a {
    color: var(--light-color);
    display: flex;
    align-items: center;
}

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

.footer-links a i {
    margin-right: 8px;
    font-size: 0.9rem;
}

.footer-social {
    flex: 1;
}

.footer-social h4 {
    color: var(--white);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.social-icons a {
    color: var(--white);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--light-color);
    font-size: 0.9rem;
}

/* User Info Popup */
.user-info-popup {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    max-width: 370px;
    width: 100%;
    animation: slideIn 0.5s ease;
}

.user-info-content {
    padding: 20px;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

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

.user-info-content h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.user-info-content h3 i {
    margin-right: 8px;
}

.user-info-content p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.user-info-content i {
    margin-right: 8px;
    color: var(--primary-color);
    width: 20px;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes popupSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .about-content,
    .contact-content {
        flex-direction: column;
    }
    
    .testimonial {
        margin-top: 40px;
    }
    
    .contact-form-wrapper,
    .contact-info {
        width: 100%;
    }
    
    .contact-map {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        background-color: var(--white);
        width: 100%;
        flex-direction: column;
        text-align: center;
        transition: var(--transition);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 15px 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .user-info-popup {
        max-width: calc(100% - 40px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .contact-form-wrapper {
        padding: 25px;
    }
    
    .form-popup-content {
        padding: 30px 25px;
    }
}

@media (max-width: 576px) {
    section {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .video-info-box {
        max-width: calc(100% - 60px);
    }
    
    .contact-content {
        gap: 25px;
    }
    
    .contact-form-wrapper {
        padding: 20px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="number"],
    .form-group textarea {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .form-popup-content {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .form-popup-content h3 {
        font-size: 1.4rem;
    }
    
    .form-popup-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
}

/* Video stream container */
#video-stream-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateZ(0);
    will-change: transform;
    display: block;
    background: #000;
}

#video-stream-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}