/* contact.css */
.contact-main {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    font-family: inherit;
    background-image: none;
    /* Moved to ::before */
}

.contact-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../images/optimize.webp);
    background-size: cover;
    background-position: center center;
    z-index: 0;
    /* Reveal Animation: Fade + Top to Bottom Slide/Clip */
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    animation: contactBgReveal 1.8s cubic-bezier(0.19, 1, 0.22, 1) 0.3s forwards;
}

@keyframes contactBgReveal {
    0% {
        opacity: 0;
        clip-path: inset(0 0 100% 0);
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        transform: translateY(0);
    }
}

.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Adjust opacity for readability */
    z-index: 1;
}

.contact-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    padding: 180px 20px 40px;
    text-align: center;
}

.contact-title {
    font-weight: 300;
    font-size: 4rem;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.contact-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    text-transform: uppercase;
    color: #dfdfdf;
}

.contact-instruction {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 70px;
}

.contact-form {
    width: 100%;
    text-align: left;
}

.form-row {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
}

.input-group {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.input-line {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s ease;
}

.input-group:focus-within .input-line {
    border-bottom-color: rgba(197, 160, 89, 0.65);
}

.input-group.is-invalid .input-line,
.input-group:has(.input-invalid) .input-line {
    border-bottom-color: #e8a090;
}

.input-group input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 10px 0;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}

.input-group input::placeholder {
    color: #e0e0e0;
    opacity: 1;
}

.field-error {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.75rem;
    color: white;
    margin-top: 6px;
    line-height: 1.35;
}

.field-error:empty {
    display: none;
}

.form-message {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 24px;
    min-height: 1.25rem;
}

.form-message--success {
    color: #b8d4b0;
}

.form-message--error {
    color: #e8a090;
}

.phone-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Country Selector Styles */
.country-selector {
    position: relative;
    cursor: pointer;
    padding: 10px 0;
    margin-right: 15px;
    user-select: none;
    display: flex;
    align-items: center;
}

.selected-flag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #e0e0e0;
}

.selected-flag .asterisk {
    color: #fff;
}

.selected-flag .arrow-down {
    font-size: 0.6rem;
    opacity: 0.6;
    margin-left: 2px;
}

.flag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    list-style: none;
    padding: 10px 0;
    margin: 5px 0 0;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.flag-dropdown.active {
    display: block;
}

.flag-dropdown li {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #ccc;
    transition: background 0.2s, color 0.2s;
}

.flag-dropdown li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.flag-dropdown li img {
    border-radius: 2px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    position: relative;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 14px;
    width: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-right: 15px;
    display: inline-block;
    position: relative;
    transition: background 0.3s;
}

.checkbox-container input:checked~.checkmark {
    background: transparent;
}

.checkbox-container input:checked~.checkmark:after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
}

.checkbox-label a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.checkbox-label a:hover {
    color: #fff;
}

.contact-container p {
    font-size: 16px;
    max-width: 380px;
    margin: auto;
    font-weight: 400;
    margin-bottom: 60px;
    color: #D5D1CC;
}

.submit-btn {
    background: white;
    color: #111;
    border: none;
    padding: 12px 45px;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s;
    text-transform: uppercase;
}

.submit-btn:hover {
    background: #8a8a8a;
}

@media (max-width: 768px) {
    .contact-container {
        padding: 120px 20px 60px;
    }

    .contact-title {
        font-size: 30px;
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .contact-container p {
        font-size: 14px;
        margin-bottom: 40px;
        padding: 0 10px;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 20px;
    }

    .input-group input {
        font-size: 14px;
    }

    .form-footer {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        /* Center button on mobile */
        margin-top: 30px;
    }

    .submit-btn {
        width: 100%;
        max-width: 200px;
        padding: 12px 0;
    }
}

.contact-addresses {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 60px;
    text-align: left;
}

.address-col {
    flex: 1;
}

.address-col h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #D5D1cc;
}

.address-col p {
    font-size: 14px;
    line-height: 1.6;
    color: #D5D1cc;
    margin: 0;
    letter-spacing: 1px;
}

.address-col a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.3s;
}

.address-col a:hover {
    color: #fff;
}

.queries-col p {
    line-height: 1.8;
}

@media (max-width: 768px) {
    .contact-addresses {
        flex-direction: column;
        gap: 40px;
    }

    .contact-main::before {
        height: 50%;
        background-position: left bottom;
    }
}