/* Custom Contact Form Styles */
.custom-contact-form {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    height: 100svh; /* Dynamic viewport height for modern browsers */
    background: #0a0a0a;
    z-index: 10001;
    transition: all 0.7s cubic-bezier(0.165, 0.85, 0.45, 1);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 1024px) {
    .custom-contact-form {
        width: 45%;
        right: -45%;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }
}

body.show-contact-form {
    overflow: hidden; /* Prevent background scroll when form is open */
}

body.show-contact-form .custom-contact-form {
    right: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Page content shift on desktop */
@media (min-width: 1024px) {
    body.show-contact-form .centrize.full-width,
    body.show-contact-form .video-bg,
    body.show-contact-form .header,
    body.show-contact-form .footer,
    body.show-contact-form .lines {
        width: 55% !important;
        transition: all 0.7s cubic-bezier(0.165, 0.85, 0.45, 1);
    }

    body.show-contact-form .section.started .started-content .h-title {
        bottom: 130px !important;
        left: calc(10% + 35px) !important;
        max-width: 400px !important;
        font-size: 18px !important;
    }

    body.show-contact-form .section.started .started-content .h-subtitle,
    body.show-contact-form .section.started .started-content .typed-subtitle {
        font-size: 45px !important;
        width: 100% !important;
        left: 0 !important;
        line-height: 1.1 !important;
    }
}

.custom-contact-form-inner {
    width: 100%;
    max-width: 450px;
    padding: 60px 0; /* Extra padding for top and bottom reachability */
}

.custom-contact-form h2 {
    font-size: clamp(30px, 5vw, 50px);
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
}

.custom-contact-form p {
    color: #888;
    font-size: 15px;
    margin-bottom: 35px;
}

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

.form-group label {
    display: block;
    font-size: 11px;
    color: #4bffa5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-group input, 
.form-group textarea,
.form-group select {
    width: 100%;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid #333 !important;
    padding: 12px 0 !important;
    color: #fff !important;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    border-radius: 0;
    line-height: 1.4 !important;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%234bffa5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 18px;
    padding-right: 25px !important;
    height: 55px !important;
    display: block;
    box-sizing: border-box !important;
}

.form-group select option {
    background: #111;
    color: #fff;
    padding: 15px;
}

.form-group input:focus, 
.form-group textarea:focus,
.form-group select:focus {
    border-bottom-color: #4bffa5 !important;
}

.form-group textarea {
    height: 80px;
    resize: none;
}

.submit-btn {
    width: 100%;
    background: #4bffa5 !important;
    color: #000 !important;
    border: none;
    padding: 18px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #3ee693 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(75, 255, 165, 0.3);
}

.close-custom-form {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #555;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.close-custom-form:hover {
    color: #fff;
}

/* Transitions for dynamic layout */
.wrapper, .header, .footer, .lines, .started-content, .video-bg, .centrize.full-width, .h-title, .h-subtitle, .typed-subtitle {
    transition: all 0.7s cubic-bezier(0.165, 0.85, 0.45, 1);
}

/* Mobile Optimizations */
@media (max-width: 1023px) {
    .custom-contact-form {
        display: block !important; /* Switch from flex to block for reliable scrolling */
        padding: 80px 30px !important;
        overflow-y: scroll !important;
    }
    
    .custom-contact-form h2 {
        font-size: 36px;
    }
}

/* Ensure footer slogan matches branding colors */
.footer .copy p strong {
    color: #4bffa5 !important;
}

@media (max-width: 1023px) {
    body.show-contact-form .wrapper,
    body.show-contact-form .header,
    body.show-contact-form .footer {
        transform: scale(0.9);
        opacity: 0.1;
    }
}

/* Positioning main slogan above typing text */
.section.started .started-content .h-title {
    position: absolute !important;
    top: calc(50% - 100px) !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    bottom: auto !important;
    font-size: 24px !important; /* Proper branding size */
    opacity: 1;
    z-index: 10;
}

@media (max-width: 768px) {
    .section.started .started-content .h-title {
        top: calc(50% - 80px) !important;
        font-size: 18px !important;
    }
}
