/* --- FORM BODY --- */
#msform fieldset select,
#msform fieldset input,
#msform fieldset .input-group {
    display: block;
    margin-bottom: 30px;
}

fieldset {
    display: none;
}

fieldset.active {
    display: block;
}

.fs-title {
    font-size: 2.5rem;
    font-weight: 400;
    color: #F0790F;
    /* Strong orange tone */
    margin-bottom: 0.5rem;
}

.fs-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    color: #333;
    margin-bottom: 2rem;
}


/* ---DROPDOWN--- */
.dropdown-container {
    padding-bottom: 20px;
}

.dropdown-button,
input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    box-sizing: border-box;
    border-radius: 10px;
    border-width: 1px 1px 2px 1px;
    /* Top, Right, Bottom, Left */
    border-style: solid;
    border-color: #ccc;
    border-bottom-width: 2px;
    background: #f9f9f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 2px rgba(227, 227, 227, 0.75);
    /* Subtle glow */
    transition: box-shadow 0.3s ease;
    /* Smooth transition */
}

input:focus::placeholder {
    color: transparent;
}

.dropdown-button:focus {
    outline: none;
    border-width: 1px 1px 2px 1px;
    /* Top, Right, Bottom, Left */
    border-style: solid;
    border-color: #2850a7;
}

.valid {
    border-color: lightgreen;
}

/* Dropdown menu */
.dropdown-menu {
    display: none;
    position: absolute;
    width: 100%;
    background-color: #fff;
    border-width: 1px 1px 2px 1px;
    /* Top, Right, Bottom, Left */
    border-style: solid;
    border-color: #ccc;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 5px;

}

.dropdown-item {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dropdown-item:hover {
    background-color: #f0f0f0;
}

/* Unique active backgrounds */
#amount-dropdown .dropdown-item.active,
#period-dropdown .dropdown-item.active,
#purpose-dropdown .dropdown-item.active {
    background-color: #adadad;
}

/* Icon rotation */
.icon {
    transition: transform 0.3s;
    width: 16px;
    height: 16px;
}

.dropdown-active .icon {
    transform: rotate(180deg);
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group input {
    margin-bottom: 5px !important;
}

.input-group span {
    color: #838282;
}

#error-message {
    color: red;
}

select,
input {
    width: 100% !important;
    padding: 10px !important;
    font-size: 16px;
    box-sizing: border-box;
    background: #f9f9f9;
    border-radius: 10px !important;
    border-width: 1px;
}

select:focus {
    outline: none;
    border-color: #333;
}

input:focus::placeholder {
    color: transparent;
}

.floating-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease;
    opacity: 0;
}

input:focus+.floating-label,
input:not(:placeholder-shown)+.floating-label {
    top: -10px;
    font-size: 12px;
    opacity: 1;
    color: #333;
}

input {
    border-width: 1px 1px 2px 1px !important;
    /* Top, Right, Bottom, Left */
    border-style: solid !important;
    border-color: gray !important;
    border-bottom-width: 2px !important;
    padding-left: 15px !important;
    transition: all 0.3s ease !important;
    outline: none !important;

}

/* Apply the glow effect to all input fields except buttons */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="file"]),
textarea,
select {
    box-shadow: 0 0 2px rgba(227, 227, 227, 0.75);
    /* Subtle glow */
    transition: box-shadow 0.3s ease;
    /* Smooth transition */
}

/**/
input:focus {
    border-width: 1px 1px 2px 1px;
    /* Top, Right, Bottom, Left */
    border-style: solid;
    border-color: #2850a7 !important;
}

input.valid {
    border-width: 1px 1px 2px 1px;
    /* Top, Right, Bottom, Left */
    border-style: solid;
    border-color: lightgreen !important;
    outline: none;
    /* Remove default outline */

}

input.invalid,
select.invalid {
    border-color: red !important;
    /* Highlight invalid fields with red */
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.75);
    /* Subtle red glow */
    outline: none;
    /* Remove default outline */
}

input.invalid:focus,
select.invalid:focus {
    border-color: red !important;
    /* Keep red border on focus */
}

#progress-bar {
    width: 100%;
    height: 5px;
    background-color: #f0f0f0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

#progress-bar-fill {
    /*MODIFICADO 12.02.2025*/
    width: 0%;
    max-width: 100%;
    height: 100%;
    /* Ensure it takes the full height of the progress bar */
    background-color: #4caf50;
    /* Green progress indicator */
    transition: width 0.3s ease-in-out;
    /* Smooth progress update */
}

/*#progress-bar-fill-2{
    width: 90%;
    height: 100%; /* Ensure it takes the full height of the progress bar 
    background-color: #4caf50; /* Green progress indicator 
    transition: width 0.3s ease-in-out; /* Smooth progress update 
}*/
/*
#progress-bar-fill-3{
    width: 100%;
    height: 100%;  Ensure it takes the full height of the progress bar 
    background-color: #4caf50;  Green progress indicator 
    transition: width 0.3s ease-in-out;  Smooth progress update 
}
*/

input.next {
    padding: 10px 20px;
    background-color: #ddd;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

input.next.disabled {
    background-color: rgba(0, 128, 0, 0.5);
    /*#ddd;*/
    cursor: default;
    /*pointer;*/
}

input.next:hover.disabled {
    background-color: #ddd !important;
    cursor: default;
    /*pointer;*/
}

input.next:hover:not(.disabled) {
    background-color: #45a049;
}

input.next:not(:disabled) {
    background-color: #4CAF50;
    /* Active state */
    color: white;
    cursor: pointer;
    background-color: green;
    padding: 10px 20px;
    /* Add padding for consistent sizing */
    font-size: 16px;
    border-radius: 5px;
    transition: width 0.4s ease;
    height: auto;
    /* Allow natural height */
}

#msform fieldset {
    margin-top: 30px;
    border: none;
    padding: 0;
}

.full-name,
.birth-date {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
}

.full-name input,
.apellido2-wrapper {
    flex: 1;
    min-width: 0;
}

.apellido2-wrapper {
    display: flex;
    flex-direction: column;
}

.input-with-tooltip {
    display: flex;
    align-items: center;
    width: 100%;
}

.tooltip-container {
    position: relative;
    margin-left: 6px;
    cursor: pointer;
}

.tooltip-icon {
    background-color: #ccc;
    color: #000;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    user-select: none;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    right: 0;
    background-color: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    max-width: 200px;
    white-space: normal;
    z-index: 100;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


.tooltip-container:hover .tooltip-text,
.tooltip-container:focus-within .tooltip-text {
    visibility: visible;
    opacity: 1;
}



.checkbox-container input,
label {
    display: flex !important;
    flex-direction: row;
    width: auto !important;
    gap: 5px !important;
}

.checkbox-container input[type="checkbox"] {
    transform: scale(1.5);
}

.checkbox-container input[type="checkbox"]:checked {
    color: lightgreen !important;
}

.checkbox-container a {
    color: #2850a7;
    text-decoration: none;
}



/*Offer Style*/
/* Logos Section */
.logos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.logo {
    max-width: 150px;
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    border-color: #2850a7;
}

.arrow {
    font-size: 30px;
    color: #555;
}

/* Countdown Section */
.countdown-container {
    text-align: center;
    font-size: 20px;
    margin-top: 20px;
    color: #333;
}

.offer-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

/*
button#btnSMS {
    padding: 10px 20px;
    background-color: #ddd;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

button#btnSMS.disabled {
    background-color: #ddd;
    cursor: not-allowed; 
}

button#btnSMS:hover:not(.disabled) {
    background-color: #45a049;
}

button#btnSMS:not(.disabled) {
    background-color: #4CAF50; 
    color: white;
    cursor: pointer;
}
*/


/* Responsive Styling MOBILE*/
@media (max-width: 768px) {
    .fs-title {
        font-size: 2rem;
    }

    .fs-subtitle {
        font-size: 1rem;
    }

    .logos-container {
        flex-direction: row;
    }

    .arrow {
        font-size: 20px;
    }

    /* 2nd fieldset - Full name vertically - padding between inputs 10px 
     * added tooltip with info that NIE second surname is optional
    */
    .full-name {
        flex-direction: column;
    }

    .full-name input[name="first_name"],
    .full-name input[name="last_name"] {
        margin-bottom: 15px !important;
    }

    .full-name input,
    .apellido2-wrapper {
        width: 100%;
        flex: 1;
        min-width: 0;
        margin-bottom: 10px;
    }

    .apellido2-wrapper {
        display: flex;
        flex-direction: column;
    }

    .input-with-tooltip {
        position: relative;
        display: flex;
        width: 100%;
    }

    .input-with-tooltip input {
        flex: 1;
        width: 100%;
        padding-right: 30px;
        /* space for the ? icon */
    }

    .tooltip-container {
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-70%);
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
    }


    .tooltip-icon {
        background-color: #ccc;
        color: #000;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 12px;
        font-weight: bold;
        user-select: none;
    }

    .tooltip-text {
        visibility: hidden;
        opacity: 0;
        position: absolute;
        bottom: 70%;
        right: 0;
        background-color: #333;
        color: #fff;
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 0.75rem;
        white-space: normal;
        max-width: 200px;
        z-index: 10;
        transition: opacity 0.3s ease;
    }

    .tooltip-container:hover .tooltip-text,
    .tooltip-container:focus-within .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
}


/*===== PRELOADER =====*/
#form-preloader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Add these: */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#form-preloader.show {
    opacity: 1;
    visibility: visible;
}

.form-wrapper {
    position: relative;
}

.preloader-container {
    display: flex;
    gap: 12px;
}

.circle {
    width: 15px;
    height: 15px;
    background: orange;
    border-radius: 50%;
    animation: dotAnim 1.2s ease-in-out infinite;
}

.circle:nth-child(2) {
    animation-delay: 0.15s;
}

.circle:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dotAnim {
    0% {
        transform: scale(1);
    }

    20% {
        transform: scale(1.5);
        z-index: 1;
    }

    50% {
        transform: translateY(15px);
    }

    75% {
        transform: scale(0.8);
        z-index: 0;
    }

    100% {
        transform: scale(1);
    }
}