@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');


.form-section-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;

    .image-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 36vw;
        height: 100%;

        img {
            width: 100%;
            height: 65vh;
            padding: 1rem 0 0 0;
        }
    }

    .form-container {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        width: 45vw;
        padding: 20px;
        margin-top: 50px;

        .form-header {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            width: 100%;

            h1, h3, h4 {
                color: var(--primary-color);
                text-align: center;
            }

            h1 {
                font-size: 3.7rem;
                font-weight: 600;
            }

            h3 {
                font-size: 2rem;
                font-weight: bold;
            } 

            h4 {
                font-size: 1.7rem;
                font-weight: 500;
            }
        }

        #container_form_contact {
            .content-form {
                display: flex;
                justify-content: center;
                align-items: center;
                width: 100%;

                #form_contact {
                    color: #004080;
                    display: flex;
                    flex-direction: column;
                    text-align: start;
                    width: 418px;
                    height: 100%;
                    border-radius: 10px;
                    margin-top: 30px;
                    z-index: 0;

                    .container-input-form,
                    .container-textarea-form {
                        position: relative;
                        margin-bottom: 1rem;
                        height: fit-content;
                        z-index: 0;

                        label {
                            margin-top: 20px;
                            color: #676767;
                            width: 172px;
                            margin-bottom: 12px;
                            font-weight: bold;
                            z-index: 2;
                        }

                        .input-wrapper {
                            display: flex;
                            flex-direction: column;
                            position: relative;

                            input {
                                background-color: #FFF;
                                color: #676767;
                                border: 1px solid #00B8E5;
                                width: 100%;
                                height: 3rem;
                                padding-left: 20px;
                                margin-top: 5px;
                                border-radius: 57px;
                                font-size: 1rem;
                            }
                        }
                    }

                    .container-textarea-form {
                        textarea {
                            font-family: 'Barlow', sans-serif;
                            background-color: #FFF;
                            border: 1px solid #00B8E5;
                            border-radius: 20px;
                            width: 100%;
                            height: 6rem !important; 
                            padding: 10px 20px;
                            margin-top: 5px;
                            font-size: 1.1rem;
                        }
                    }

                    #btn_form_contact {
                        background-color: #00B8E5;
                        color: #fff;
                        position: relative;
                        margin-top: 10px;
                        margin-left: auto;
                        width: 150px;
                        height: 50px;
                        border: none;
                        border-radius: 37px;
                        cursor: pointer;
                        font-size: 16px;
                    }

                    #btn_form_contact:disabled {
                        opacity: 0.5;
                        cursor: not-allowed;
                        pointer-events: none;
                        transition: opacity 0.3s ease;
                    }                      

                    .container-input-form[data-error] input,
                    .container-textarea-form[data-error] textarea {
                        border-color: #FF4444 !important;
                        background-color: rgba(255, 68, 68, 0.1) !important;
                    }
                }
            }
        }
    }
}

.field-feedback {
    display: flex;
    width: 100%;
    margin-top: 5px;
    gap: 2px;
}

/* Cuando hay solo error (sin contador) */
.field-feedback:has(.error-message):not(:has(.char-counter)) {
    justify-content: flex-start;
}

/* Cuando hay tanto error como contador */
.field-feedback:has(.error-message):has(.char-counter) {
    justify-content: space-between;
}

/* Cuando hay solo contador (sin error) */
.field-feedback:has(.char-counter):not(:has(.error-message)) {
    justify-content: flex-end;
}

.field-feedback .error-message {
    display: flex;
    align-items: center;
    color: #dc2626;
    font-size: 0.73rem;
    order: 1;
    flex-shrink: 0;
}

.field-feedback .char-counter {
    font-size: 0.73rem;
    display: flex;
    justify-content: flex-end;
    padding-right: 1px;
    align-items: center;
    color: #676767;
    order: 2;
    flex-shrink: 0;
    min-width: fit-content;
}

.error-message svg {
    width: 0.8rem;
    height: 0.8rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.error-message p {
    margin: 0;
    flex: 1;
}

/* Estilos legacy para mantener compatibilidad (cuando no hay contenedor padre) */
.char-counter:not(.field-feedback .char-counter) {
    font-size: 0.68rem;
    width: 100%;
    display: flex;
    justify-content: end;
    padding-right: 5px;
    align-items: center;
    color: #676767;
    margin-bottom: 0px;
}

.error-message:not(.field-feedback .error-message) {
    display: flex;
    width: 100%;
    align-items: center;
    color: #dc2626;
    font-size: 0.73rem;
    position: relative;
    margin-bottom: 2px;
}


.modal-something-went-wrong, .modal-success-data {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);

    .modal-content-contact {
        background: #CDCED0;
        padding: 2rem;
        border-radius: 20px;
        width: 90%;
        max-width: 500px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        transform: translateY(20px);
        opacity: 0;
        animation: modalAppear 0.3s ease forwards;

        .modal-header {
            text-align: center;
            margin-bottom: 1.5rem;

            .error-icon, .success-icon {
                width: 82px;
                height: 82px;
                margin-bottom: 1rem;
                animation: pulseIcon 5s infinite;
            }

            #title-something-went-wrong{
                color: #2C537F;
            }
        }

        .modal-body {
            text-align: center;
            color: #676767;
            line-height: 1.6;
            margin-bottom: 2rem;

            #success-message-data{
                color: #2C537F;
            }
        }
        
        .modal-footer {
            text-align: center;

            .close-modal-something-went-wrong,
            .close-modal-success-data {
                background-color: #00B8E5;
                color: white;
                border: none;
                padding: 0.8rem 2rem;
                border-radius: 50px;
                font-size: 1rem;
                cursor: pointer;
                transition: all 0.3s ease;
            }

            .close-modal-something-went-wrong:hover,
            .close-modal-success-data:hover {
                background-color: #0095b8;
                transform: translateY(-2px);
                box-shadow: 0 5px 15px rgba(0, 184, 229, 0.3);
            }
        }
    }
    
}

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

@keyframes pulseIcon {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}


/* Desktop pantallas pequeñas */
@media only screen and (min-width: 1000px) and (max-height: 670px) {

    .form-section-container {
        .image-container {

            img {
                height: 70vh;
            }
        }

        .form-container {
            padding: 20px;
            margin-top: 10px;

            .form-header {

                h1,h3 {
                    color: var(--primary-color);
                    text-align: center;
                }

                h1 {
                    font-size: 3rem !important;
                    font-weight: 600;
                }

                h3 {
                    font-size: 1.35rem !important;
                    font-weight: bold;
                } 

                h4 {
                    font-size: 1.6rem;
                    font-weight: 500;
                }
            }

            #container_form_contact{
                .content-form {
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    width: 100%;

                    #form_contact {
                        color: #004080;
                        display: flex;
                        flex-direction: column;
                        text-align: start;
                        width: 418px;
                        height: 100%;
                        border-radius: 10px;
                        margin-top: 10px;
                        z-index: 0;

                        .container-input-form,
                        .container-textarea-form {
                            .input-wrapper {
                                display: flex;
                                flex-direction: column;
                                position: relative;

                                input {
                                    height: 2.4rem;
                                }
                            }

                        }

                        .container-textarea-form {
                            textarea {
                                height: 4.8rem !important; 
                            }
                        }

                        #btn_form_contact {
                            width: 150px;
                            height: 45px;
                        }
                    
                    }
                }
                
            }

        }

    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 1000px) {
    
    .form-section-container {
        overflow: hidden;
        width: 100%;
        height: 100%;

        .image-container {
            display: none;
        }

        .form-container {
            width: 100%;
            margin-top: 10px;

            .form-header {
                width: 100%;
                display: flex;
                padding: 0px;

                h1 {
                    font-size: 4rem !important;
                    font-weight: 600;
                }
            
                h3 {
                    font-size: 2rem;
                }
            }

            #container_form_contact{
                .content-form {
                    width: auto;
                    min-width: 310px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    flex-direction: column;
                    padding: 0px;
                    margin-top: 3px;

                    #form_contact {
                        display: flex;
                        flex-direction: column;
                        flex-wrap: wrap;
                        width: 100%;
                        height: auto;
                        justify-content: center;
                        align-items: center;
                        width: 100%;
                        padding: 0 15px;

                        .container-input-form,
                        .container-textarea-form {
                            width: 70%;

                            .input-wrapper {
                                input{
                                    background-color: #FFF;
                                    height: 5vmin;
                                    padding: 10px;
                                }                               
                            }
 
                        }

                        #btn_form_contact {
                            position: relative;
                            justify-content: end;
                            left: 20% !important;
                            width: 30%;
                            font-size: 16px;
                            margin-left: 0;
                        }

                    }
                }
            }
        }
    }

    .error-message {
        font-size: 0.83rem;
        position: relative;
        margin-bottom: 1.5px;

        svg {
            width: 0.9rem;
            height: 0.9rem;
        }
    }

    #btn_form_contact {
        margin-left: 45%;
    }

}

@media (min-width: 800px) and (max-width: 1024px) {

    .image-container img {
        width: 200px;
        height: 400px;
        border-radius: 5px;
    }

    .form-container {
        width: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        padding: 0px;
        margin-top: 10px;
    }

}

@media only screen and (max-width : 480px) {


    .form-section-container {
        overflow: hidden;
        width: 100%;
        height: 100%;

        .image-container {
            display: none;
        }

        .form-container {
            width: 100%;
            padding: 0px;
            margin-top: 0px;

            .form-header {
                width: 90%;
                height: auto;
                min-width: 300px;
                display: flex;
                padding: 0px;
                gap: 8px;
                margin-bottom: 0px;
                margin-top: 20px;

                h1 {
                    font-size: 2.1rem !important;
                    font-weight: 600;
                }

                h3 {
                    font-size: 1.3rem !important;
                }
            }

            #container_form_contact{
                .content-form {
                    width: auto;
                    height: auto;
                    min-width: 310px;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    padding: 0px;
                    margin-top: 10px;

                    #form_contact {
                        display: flex;
                        flex-direction: column;
                        flex-wrap: wrap;
                        width: 100%;
                        height: auto;
                        justify-content: start;
                        align-items: start;
                        width: 100%;
                        padding: 0 15px;
                        margin-top: 25px;

                        .container-input-form,
                        .container-textarea-form {
                            width: 100%;
                        }

                        .container-input-form {
                            .input-wrapper {
                                input{
                                    height: 3rem !important;
                                }                                
                            }

                        }

                        .container-textarea-form {
                            .textarea-wrapper {
                                textarea{
                                    height: 6.5rem ! important;
                                    width: 100%;
                                }
                            }
 
                        }

                        #btn_form_contact {
                            width: 100%;
                            padding: 10px;
                            font-size: 16px;
                            margin-top: 5px;
                        }
                    
                    }
                
                }
            }
        }
    
    
    }

    .modal-content-contact {
        width: 95%;
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-body {
        font-size: 0.9rem;
    }
}

@media only screen and (max-width : 480px) and (max-height : 620px) {

    .content-form {
        padding: 0px;
        margin-top: 1px;
    }

    .container-input-form input {
        height: 4.2vh;
    }

    .container-select-form select {
        height: 4.2vh;
    }

    .container-select-form::after {
        transform: translateY(-35%) rotate(180deg);
    }
    
    .container-textarea-form textarea {
        height: 9vh ! important;
        width: 100%;
    }

    #btn_form_contact {
        width: 100%;
        padding: 2px;
        font-size: 16px;
        margin-top: 0px;
    }
}

#btn_form_contact.loading::after {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border: 4px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

#btn_form_contact.loading .button--text {
    display: none;
    opacity: 0;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }

    to {
        transform: rotate(1turn);
    }
}