/* ---------- Global Fix ---------- */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* Prevent horizontal scrolling globally */
}

/* ==============================
   CONTACT US SECTION (SECTION 1)
============================== */
/* === Clean Validation Indicators === */
input.invalid,
textarea.invalid {
    border: 2px solid #ff4d4d;
    background-color: rgba(255, 77, 77, 0.05);
    transition: all 0.3s ease;
}

input.valid,
textarea.valid {
    border: 2px solid #2ecc71;
    background-color: rgba(46, 204, 113, 0.05);
    transition: all 0.3s ease;
}

#contactSec1 {
    position: relative;
    height: 130vh;
    /* Full viewport height */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: -100px;

    background-image: url('/images/contactus.png');
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;

    overflow: hidden;
}

/* ==============================
   Text Overlay
============================== */
#contactSec1 .contact-overlay {
    color: #FEFFFF;
    max-width: 700px;
    padding: 20px;
    animation: fadeUp 1.5s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
}

#contactSec1 .contact-overlay h1 {
    font-size: 55px;
    line-height: 70px;
    font-weight: 700;
    margin: 20px 0;
}

#contactSec1 .contact-overlay p {
    font-size: 20px;
    line-height: 1.5;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    #contactSec1 {
        margin-top: -300px;
    }

    .contact-container {
        gap: 30px;
    }
}

/* ==============================
   SECTION 2: CONTACT FORM + IMAGE
============================== */
#contactSec2 {
    margin-top: -100px;
    padding: 0 50px;
}

.contact-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
    gap: 50px;
    flex-wrap: wrap;
}

/* Left Side - Form */
.contact-form {
    flex: 1 1 400px;
    opacity: 0;
    transform: translateX(-60px);
    min-width: 300px;
    /* Ensure minimum width on mobile */
}

.contact-form.animate-left {
    animation: fadeInLeft 1.2s ease forwards;
}

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

.contact-form input,
.contact-form textarea,
.contact-form select {
    background: transparent;
    border: 1px solid transparent;
    /* Add transparent border by default */
    border-bottom: 1px solid #F9FCFF;
    color: #fff;
    font-size: 16px;
    padding: 12px;
    /* Increased padding for better mobile experience */
    outline: none;
    transition: border-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

/* Remove focus effect */
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    border: 1px solid transparent;
    border-bottom: 1px solid #F9FCFF;
    background: transparent;
}

/* Placeholder styling */
.contact-form input::placeholder,
.contact-form textarea::placeholder,
.contact-form select::placeholder {
    color: #FEFFFF;
    opacity: 1;
}

/* Red border for invalid fields - UPDATED */
.contact-form input.invalid,
.contact-form textarea.invalid,
.contact-form select.invalid {
    border: 3px solid #ff0000 !important;
    /* Thick bright red border all sides */
    border-radius: 6px !important;
    padding: 10px !important;
    /* Add padding when border appears */
    background: rgba(255, 0, 0, 0.08) !important;
    /* Subtle red background */
}

/* Phone input grouping */
.phone-input {
    display: flex;
    gap: 10px;
}

/* Submit button */
.submit-btn {
    background: #F9FCFF;
    color: #030311;
    padding: 14px;
    /* Slightly larger for mobile */
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #1a2432;
    color: #fff;
}

/* Error message styling */
#errorMsg {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    background: rgba(255, 77, 77, 0.1);
    font-size: 14px;
    line-height: 1.6;
}

/* Right Side - Image */
.contact-image {
    flex: 1 1 400px;
    text-align: center;
    opacity: 0;
    transform: translateX(60px);
}

.contact-image.animate-right {
    animation: fadeInRight 1.2s ease forwards;
    animation-delay: 0.15s;
}

.contact-image img {
    width: 100%;
    max-width: 550px;
}

/* Fade animations */
@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    #contactSec2 {
        padding: 0 20px;
    }

    .contact-container {
        gap: 30px;
    }
}

/* Mobile-specific form improvements */
@media (max-width: 768px) {
    #contactSec2 {
        padding: 0 20px;
    }

    .contact-form {
        flex: 1 1 100%;
        width: 100%;
    }

    .contact-form input,
    .contact-form textarea,
    .contact-form select {
        font-size: 16px;
        /* Prevent zoom on iOS */
        padding: 14px;
    }

    .contact-form textarea {
        min-height: 120px;
    }

    .submit-btn {
        padding: 16px;
        font-size: 18px;
    }

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

    .contact-image img {
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    #contactSec2 {
        padding:  15px;
    }

    #contactSec1 {
        height: 60vh;
        margin-top: 0px;
        background-size: contain;
    }

    .contact-form input,
    .contact-form textarea {
        font-size: 16px;
        padding: 15px;
    }

    .contact-form input.invalid,
    .contact-form textarea.invalid {
        padding: 12px !important;
        /* Account for thicker border */
    }

    .submit-btn {
        padding: 18px;
        font-size: 18px;
    }
}

/* ==============================
   SECTION 3: OUR MISSION
============================== */
#contactSec3 {
    position: relative;
    overflow: hidden;
    z-index: 5;
}

#contactSec3 .missions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#contactSec3 .mission-box {
    text-align: center;
    padding: 20px;
    border-right: 2px solid #4F4F58;

    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

/* Staggered animation delays */
#contactSec3 .mission-box:nth-child(1).visible {
    transition-delay: 0.3s;
}

#contactSec3 .mission-box:nth-child(2).visible {
    transition-delay: 0.6s;
}

#contactSec3 .mission-box:nth-child(3).visible {
    transition-delay: 0.9s;
}

#contactSec3 .mission-box:last-child {
    border-right: none;
}

#contactSec3 .mission-box img {
    width: 75px;
    height: 75px;
    margin-bottom: 40px;
}

#contactSec3 .mission-box h6 {
    font-weight: bold;
    font-size: 24px;
    color: #E6E6E7;
}

#contactSec3 .mission-box p {
    font-weight: 400;
    font-style: Regular;
    font-size: 20px;
    color: #B3B3B8;
}

/* Visible state triggered by JS */
#contactSec3 h2.visible,
#contactSec3 .mission-box.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================
   KEYFRAMES
============================== */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==============================
   Section 3 Responsive
============================== */
@media (max-width: 480px) {
    #contactSec3 {
        margin-top: 70px;
    }

    #contactSec3 h2 {
        font-size: 55px;
        line-height: 60px;
    }

    #contactSec3 h6 {
        font-size: 23px;
        line-height: 30px;
    }

    #contactSec3 .mission-box {
        border: none;
        margin-bottom: 30px;
        flex: 1 1 100%;
    }

    #contactSec3 .mission-box img {
        max-height: 60px;
    }

    #contactSec3 .mission-box p {
        font-size: 22px;
        line-height: 30px;
    }
}