/* Contact Form Component Styles */
.contact-form-section {
    position: relative;
    width: 100%;
    overflow: clip; /* clip without creating a scroll container */
}

.contact-form-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to left, #d8faff 20%, rgba(255, 255, 255, 0.6862745098) 90%);
    z-index: -1;
}

.contact-form-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 75%;
    height: 100%;
    background-image: url('https://static.medicanainternational.com/static/assets/images/home-page-banner.png');
    background-size: cover;
    background-position: inherit;
    background-repeat: no-repeat;
    opacity: 0.2;
    z-index: 1;
}

.contact-form-container {
    max-width: 1378px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: end;
}

/* Left Section - Image & Text */
.contact-form-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-form-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-form-title {
    font-family: var(--font-family);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
    margin: 0;
    letter-spacing: -0.5px;
}

.contact-form-description {
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
    margin: 0;
}

.contact-form-image-wrapper {
    margin-top: 30px;
    position: relative;
    overflow: visible;
    transition: transform 0.4s ease;
}


.contact-form-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Right Section - Form */
.contact-form-right {
    padding: 60px 0px;
}

.contact-form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 179, 179, 0.1);
    position: relative;
}



.contact-form-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 179, 179, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.contact-form-card > * {
    position: relative;
    z-index: 2;
}

.form-card-title {
    font-family: var(--font-family);
    font-size: 32px;
    font-weight: 700;
    color: #092347;
    margin: 0 0 8px 0;
}

.form-card-subtitle {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    color: #092347;
    opacity: 0.7;
    margin: 0 0 30px 0;
}

/* Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-label {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    display:none;
    color: #092347;
    margin: 0;
    letter-spacing: 0.3px;
}

.form-input {
    font-family: var(--font-family);
    font-size: 15px;
    margin:0;
    font-weight: 400;
    color: #092347;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(9, 35, 71, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    outline: none !important;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: rgba(9, 35, 71, 0.4);
}

.form-input:focus {
    background: #ffffff;
    border-color: #20B2BB !important;
    box-shadow: none !important;
    outline: none !important;
}

.form-input.error {
    border-color: #ff4757;
    animation: shake 0.3s ease;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

/* Phone Input */
.phone-input-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
}

.country-select {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(9, 35, 71, 0.2);
    border-radius: 12px;
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 110px;
    position: relative;
}

.country-select:hover {
    background: #ffffff;
    border-color: var(--accent-color);
}

.flag-icon {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
}

.country-code {
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    color: #092347;
}

.dropdown-arrow {
    color: #092347;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.country-select.active .dropdown-arrow {
    transform: rotate(180deg);
}

.phone-input {
    flex: 1;
    padding-left: 16px !important;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-width: 300px;
    background: #ffffff;
    border: 2px solid rgba(9, 35, 71, 0.15);
    border-radius: 12px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.country-dropdown.show {
    display: flex;
}

.country-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country-option:hover {
    background: rgba(0, 179, 179, 0.15);
}

.country-name {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    color: #092347;
    flex: 1;
}

/* Checkbox Styles */
.checkbox-group {
    margin-top: 5px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.form-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-custom {
    min-width: 20px;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(9, 35, 71, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-top: 2px;
    background: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.form-checkbox:checked + .checkbox-custom {
    background: #20B2BB;
    border-color: #20B2BB;
}

.form-checkbox:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-label:hover .checkbox-custom {
    border-color: #20B2BB;
}

.checkbox-text {
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 400;
    color: #092347;
    line-height: 1.5;
    opacity: 0.8;
}

.checkbox-error {
    margin-top: -5px;
}

/* Error Messages */
.form-error {
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: 500;
    color: #ff4757;
    display: none;
    animation: fadeIn 0.3s ease;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

.form-error.show {
    display: block;
}

/* Submit Button */
.form-submit-btn {
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #20B2BB, #0FDFEB);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.form-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.form-submit-btn:hover::before {
    left: 100%;
}

.form-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 179, 179, 0.4);
}

.form-submit-btn:active {
    transform: translateY(0);
}

.form-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.form-submit-btn.loading .btn-text {
    opacity: 0;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-color);
    border-radius: 50%;
    display: none;
    animation: spin 0.8s linear infinite;
}

.form-submit-btn.loading .btn-loader {
    display: block;
}

/* Success Message */
.form-success-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 24px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    z-index: 10;
    animation: fadeInScale 0.5s ease;
}

.form-success-message.show {
    display: flex;
}

.success-icon {
    color: var(--accent-color);
    animation: scaleIn 0.5s ease;
}

.success-title {
    font-family: var(--font-family);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.success-text {
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
    color: var(--text-color);
    opacity: 0.9;
    text-align: center;
    margin: 0;
    max-width: 400px;
}

.success-close-btn {
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #20B2BB, #0FDFEB);
    border: none;
    border-radius: 10px;
    padding: 12px 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.success-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 179, 179, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Country Divider (priority vs alphabetical) */
.country-divider {
    height: 1px;
    background: rgba(9, 35, 71, 0.12);
    margin: 4px 10px;
}

/* Scrollbar Styling for Dropdown */
.country-dropdown::-webkit-scrollbar {
    width: 8px;
}

.country-dropdown::-webkit-scrollbar-track {
    background: rgba(9, 35, 71, 0.05);
    border-radius: 10px;
}

.country-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #20B2BB, #0FDFEB);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.country-dropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0FDFEB, #20B2BB);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .contact-form-container {
        gap: 40px;
    }

    .contact-form-title {
        font-size: 36px;
    }
}

@media (max-width: 968px) {
    .contact-form-bg::before {
        background-position: center;
        width: 100%;
    }
    .contact-form-right {
        padding:  0px;
    }

    .contact-form-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .contact-form-left {
        order: 2;
    }

    .contact-form-right {
        order: 1;
    }

    .contact-form-title {
        font-size: 32px;
        text-align: center;
    }

    .contact-form-description {
        text-align: center;
    }

    .contact-form-image-wrapper {
        max-width: 500px;
        margin: 20px auto 0;
    }
}

@media (max-width: 600px) {
    .contact-form-section {
        padding: 0px 15px;
    }

    .contact-form-card {
        padding: 30px 20px;
    }

    .form-card-title {
        font-size: 26px;
    }

    .contact-form-title {
        font-size: 28px;
    }

    .phone-input-wrapper {
        flex-direction: column;
    }

    .country-select {
        width: 100%;
    }

    .country-dropdown {
        max-width: 100%;
    }
}
