/* =====================================================
   AUTH MODAL
===================================================== */

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.auth-modal.is-open {
    display: flex;
}


/* Overlay */

.auth-modal__overlay {
    position: absolute;
    inset: 0;

    background: rgba(7, 30, 43, 0.65);

    backdrop-filter: blur(3px);
}


/* Container */

.auth-modal__container {
    position: relative;

    width: 100%;
    max-width: 760px;

    max-height: 90vh;

    background: #ffffff;

    border-radius: 18px;

    overflow: auto;

    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.22);

    z-index: 1;

    animation: authModalIn 0.25s ease;
}

@keyframes authModalIn {

    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Close */

.auth-modal__close {
    position: absolute;

    top: 18px;
    right: 18px;

    width: 34px;
    height: 34px;

    border: 0;

    background: transparent;

    color: #55717e;

    font-size: 28px;

    line-height: 1;

    cursor: pointer;

    z-index: 5;
}

.auth-modal__close:hover {
    color: #004f67;
}


/* Views */

.auth-view {
    display: none;
}

.auth-view--active {
    display: block;
}


/* Content */

.auth-modal__content {
    display: grid;

    grid-template-columns: 42% 58%;

    min-height: 500px;
}


/* Left section */

.auth-modal__illustration {
    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    padding: 45px 35px;

    text-align: center;

    background: #f5fafc;

    border-right: 1px solid #e4edf0;
}

.auth-modal__icon {
    width: 72px;
    height: 72px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 22px;

    border-radius: 50%;

    background: #e9f3ff;

    font-size: 32px;
}

.auth-modal__illustration h2 {
    margin: 0 0 14px;

    color: #064e68;

    font-size: 22px;

    line-height: 1.3;
}

.auth-modal__illustration > p {
    max-width: 280px;

    margin: 0;

    color: #607782;

    font-size: 14px;

    line-height: 1.6;
}


/* Benefits */

.auth-benefits {
    width: 100%;

    margin-top: 30px;
}

.auth-benefit {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 14px;

    text-align: left;
}

.auth-benefit span {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #e6f7f1;

    color: #0bb47a;

    font-size: 13px;

    font-weight: 700;
}

.auth-benefit p {
    margin: 0;

    color: #536d78;

    font-size: 13px;
}


/* Form section */

.auth-modal__form-container {
    padding: 45px 45px 35px;
}

.auth-modal__form-container h1 {
    margin: 0;

    color: #0a2d3c;

    font-size: 25px;

    font-weight: 700;
}

.auth-modal__subtitle {
    margin: 8px 0 28px;

    color: #70838b;

    font-size: 14px;
}


/* Form */

.auth-form {
    width: 100%;
}

.auth-form__group {
    margin-bottom: 18px;
}

.auth-form__row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 14px;
}

.auth-form__group label {
    display: block;

    margin-bottom: 7px;

    color: #274b59;

    font-size: 13px;

    font-weight: 600;
}

.auth-form__group input {
    width: 100%;

    height: 44px;

    padding: 0 13px;

    border: 1px solid #ccdce2;

    border-radius: 8px;

    outline: none;

    color: #193c4b;

    background: #fff;

    font-size: 14px;

    box-sizing: border-box;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.auth-form__group input::placeholder {
    color: #9aaeb7;
}

.auth-form__group input:focus {
    border-color: #0a79a0;

    box-shadow:
        0 0 0 3px rgba(10, 121, 160, 0.10);
}


/* Password */

.auth-password {
    position: relative;
}

.auth-password input {
    padding-right: 45px;
}

.auth-password__toggle {
    position: absolute;

    top: 50%;
    right: 10px;

    transform: translateY(-50%);

    border: 0;

    background: transparent;

    cursor: pointer;

    opacity: 0.65;
}


/* Forgot */

.auth-form__forgot {
    margin: -5px 0 18px;

    text-align: right;
}

.auth-form__forgot button,
.auth-modal__register button,
.auth-back {
    padding: 0;

    border: 0;

    background: transparent;

    color: #0073a1;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;
}

.auth-form__forgot button:hover,
.auth-modal__register button:hover,
.auth-back:hover {
    text-decoration: underline;
}


/* Buttons */

.auth-btn {
    width: 100%;

    min-height: 44px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 14px;

    font-weight: 600;

    transition: all 0.2s;
}

.auth-btn--primary {
    border: 1px solid #07566f;

    background: #07566f;

    color: #fff;
}

.auth-btn--primary:hover {
    background: #06485c;
}

.auth-btn--google {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    border: 1px solid #ccdce2;

    background: #fff;

    color: #26434f;
}

.auth-btn--google:hover {
    background: #f8fafb;
}

.google-icon {
    color: #4285f4;

    font-weight: 700;
}


/* Divider */

.auth-divider {
    display: flex;

    align-items: center;

    gap: 12px;

    margin: 20px 0;

    color: #92a3aa;

    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background: #e1e8eb;
}


/* Register */

.auth-modal__register {
    margin-top: 22px;

    text-align: center;

    color: #70838b;

    font-size: 13px;
}


/* Back */

.auth-back {
    display: inline-block;

    margin-bottom: 22px;

    color: #607b87;
}


/* Checkbox */

.auth-checkbox {
    display: flex;

    align-items: flex-start;

    gap: 8px;

    margin: 4px 0 20px;

    color: #647982;

    font-size: 12px;

    line-height: 1.5;

    cursor: pointer;
}

.auth-checkbox input {
    margin-top: 3px;
}

.auth-checkbox a {
    color: #0073a1;
}


/* Errors */

.auth-form__error {
    display: block;

    margin-top: 5px;

    color: #d64545;

    font-size: 12px;
}

/* Input en estado de error */

.auth-form__group input.auth-form__input--error {
    border-color: #d64545;

    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.10);
}

.auth-form__group input.auth-form__input--error:focus {
    border-color: #d64545;

    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.15);
}


/* Select */

.auth-form__group select {
    width: 100%;

    height: 44px;

    padding: 0 13px;

    border: 1px solid #ccdce2;

    border-radius: 8px;

    outline: none;

    color: #193c4b;

    background: #fff;

    font-size: 14px;

    box-sizing: border-box;

    appearance: none;
    -webkit-appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aaeb7' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;

    cursor: pointer;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.auth-form__group select:focus {
    border-color: #0a79a0;

    box-shadow:
        0 0 0 3px rgba(10, 121, 160, 0.10);
}

.auth-form__group select.auth-form__input--error {
    border-color: #d64545;

    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.10);
}

.auth-form__group select.auth-form__input--error:focus {
    border-color: #d64545;

    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.15);
}


/* Input date */

.auth-form__group input[type="date"] {
    color-scheme: light;
}

.auth-form__group input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;

    cursor: pointer;
}


/* Barra de fuerza de contraseña */

.auth-password-strength {
    display: flex;

    gap: 4px;

    margin-top: 7px;
}

.auth-password-strength__bar {
    flex: 1;

    height: 3px;

    border-radius: 2px;

    background: #e1e8eb;

    transition: background 0.25s;
}

.auth-password-strength__bar.weak   { background: #d64545; }
.auth-password-strength__bar.medium { background: #f5a623; }
.auth-password-strength__bar.strong { background: #0bb47a; }


/* Mobile */

@media (max-width: 700px) {

    .auth-modal {
        padding: 12px;
    }

    .auth-modal__container {
        max-height: 94vh;

        border-radius: 14px;
    }

    .auth-modal__content {
        grid-template-columns: 1fr;
    }

    .auth-modal__illustration {
        display: none;
    }

    .auth-modal__form-container {
        padding: 40px 25px 30px;
    }

    .auth-modal__form-container h1 {
        font-size: 22px;
    }

    .auth-form__row {
        grid-template-columns: 1fr;
        gap: 0;
    }

}