/* =========================================================
   AUTH MODALS
   Login / Register / Forgot Password

   IMPORTANT:
   All rules are scoped under .auth-modal so that
   other application modals are not affected.
   ========================================================= */


/* =========================================================
   MODAL DIALOG
   ========================================================= */

.auth-modal .modal-dialog {
    width: 100%;
    max-width: 520px;
    margin: 1.75rem auto;
}


/* =========================================================
   MODAL CONTENT
   ========================================================= */

.auth-modal .modal-content {

    width: 100%;

    border: 0;

    border-radius: 16px;

    overflow: hidden;

    /*
     * style.css contains a global:
     *
     * .modal-content {
     *     padding: 16px;
     * }
     *
     * Do not allow that padding to affect auth modal.
     */

    padding: 0 !important;

    background: #ffffff;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.20);

}


/* =========================================================
   MODAL HEADER
   ========================================================= */

.auth-modal .modal-header {

    width: 100%;

    display: flex !important;

    align-items: center !important;

    justify-content: space-between !important;

    flex-wrap: nowrap !important;

    gap: 12px;

    border-bottom: 0 !important;

    padding: 22px 25px 5px !important;

    margin: 0;

}


/*
 * If title is wrapped inside a div, keep that
 * wrapper flexible but don't let it push the
 * close button to the left.
 */

.auth-modal .modal-header > div:first-child {

    min-width: 0;

    flex: 1 1 auto;

}


/* =========================================================
   MODAL TITLE
   ========================================================= */

.auth-modal .modal-title {

    margin: 0;

    font-size: 26px;

    line-height: 1.25;

    font-weight: 700;

    color: #222;

}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

/*
 * This is the main fix.
 *
 * Bootstrap's default close button positioning is
 * explicitly overridden so it always stays on the
 * RIGHT side of the auth modal header.
 */

.auth-modal .modal-header .btn-close {
    margin-left: auto;

    position: relative !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    flex: 0 0 40px !important;

    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
    min-height: 40px !important;

    margin-left: auto !important;

    margin-right: 0 !important;

    margin-top: 0 !important;
    margin-bottom: 0 !important;

    padding: 0 !important;

    border: 0 !important;

    border-radius: 50% !important;

    background-color: #f1f5f9 !important;

    background-image: none !important;

    opacity: 1 !important;

    display: inline-flex !important;

    align-items: center !important;

    justify-content: center !important;

    position: relative !important;

    flex-shrink: 0 !important;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;

}


/*
 * Custom X.
 *
 * background-image:none above ensures Bootstrap's
 * default SVG does not interfere.
 */

.auth-modal .modal-header .btn-close::before,
.auth-modal .modal-header .btn-close::after {

    content: "";

    position: absolute;

    top: 50%;
    left: 50%;

    width: 18px;
    height: 2px;

    border-radius: 2px;

    background-color: #475569;

    transform-origin: center;

}


.auth-modal .modal-header .btn-close::before {

    transform:
        translate(-50%, -50%)
        rotate(45deg);

}


.auth-modal .modal-header .btn-close::after {

    transform:
        translate(-50%, -50%)
        rotate(-45deg);

}


/* =========================================================
   CLOSE BUTTON HOVER
   ========================================================= */

.auth-modal .modal-header .btn-close:hover {

    background-color: #e2e8f0 !important;

    transform: rotate(90deg);

    opacity: 1 !important;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.10);

}


/* =========================================================
   CLOSE BUTTON FOCUS
   ========================================================= */

.auth-modal .modal-header .btn-close:focus {

    outline: none !important;

    box-shadow:
        0 0 0 4px rgba(7, 118, 189, 0.15) !important;

}


/* =========================================================
   MODAL BODY
   ========================================================= */

.auth-modal .modal-body {

    padding: 15px 30px 30px;

}


/* =========================================================
   AUTH SUBTITLE
   ========================================================= */

.auth-modal .auth-subtitle {

    color: #777;

    margin-bottom: 22px;

    font-size: 14px;

}


/* =========================================================
   FORM CONTROLS
   ========================================================= */

.auth-modal .form-control {

    min-height: 46px;

    border: 1px solid #d8d8d8;

    border-radius: 7px;

    padding: 10px 13px;

    box-shadow: none;

}


.auth-modal .form-control:focus {

    border-color: #0776bd;

    box-shadow:
        0 0 0 0.15rem
        rgba(7, 118, 189, 0.12);

}


/* =========================================================
   AUTH BUTTON
   ========================================================= */

.auth-modal .btn-auth {

    width: 100%;

    min-height: 46px;

    border: 0;

    border-radius: 7px;

    background: #0776bd;

    color: #fff;

    font-weight: 600;

}


.auth-modal .btn-auth:hover {

    background: #065f99;

    color: #fff;

}


/* =========================================================
   AUTH LINKS
   ========================================================= */

.auth-modal .auth-links {

    margin-top: 18px;

    text-align: center;

    font-size: 14px;

}


.auth-modal .auth-links a {

    color: #0776bd;

    font-weight: 600;

    text-decoration: none;

    cursor: pointer;

}


.auth-modal .auth-links a:hover {

    text-decoration: underline;

}


/* =========================================================
   ALERT
   ========================================================= */

.auth-modal .alert {

    font-size: 14px;

    border-radius: 7px;

}


/* =========================================================
   PASSWORD FIELD
   ========================================================= */

.auth-modal .password-field {

    position: relative;

}


.auth-modal .password-toggle {

    position: absolute;

    right: 10px;

    top: 50%;

    transform: translateY(-50%);

    border: 0;

    background: transparent;

    padding: 5px;

    color: #666;

    cursor: pointer;

}


.auth-modal .password-field .form-control {

    padding-right: 45px;

}


/* =========================================================
   REGISTER GRID
   ========================================================= */

.auth-modal .register-grid {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;

}


/* =========================================================
   PRICING BOX
   ========================================================= */

.auth-modal .pricing-box {

    border: 1px dashed #28a745;

    border-radius: 10px;

    background: #f8fff9;

    padding: 14px;

    margin-top: 15px;

    margin-bottom: 20px;

    text-align: center;

}


/* =========================================================
   TERMS
   ========================================================= */

.auth-modal .terms-text {

    font-size: 13px;

    color: #555;

}


.auth-modal .terms-text a {

    color: #0776bd;

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 575px) {

    .auth-modal .modal-dialog {

        width: auto;

        max-width: none;

        margin: 10px;

    }


    .auth-modal .modal-header {

        padding: 18px 20px 5px !important;

    }


    .auth-modal .modal-title {

        font-size: 23px;

    }


    .auth-modal .modal-body {

        padding: 10px 20px 25px;

    }


/*    .auth-modal .modal-header .btn-close {

        flex-basis: 38px !important;

        width: 38px !important;

        height: 38px !important;

        min-width: 38px !important;

        min-height: 38px !important;

    }*/


    .auth-modal .modal-header .btn-close::before,
    .auth-modal .modal-header .btn-close::after {

        width: 17px;

    }


    .auth-modal .register-grid {

        grid-template-columns: 1fr;

        gap: 0;

    }

}

/* =========================================================
   AUTH MODAL ANIMATION
   ========================================================= */

.auth-modal.fade .modal-dialog {
    transform: translate3d(0, -80px, 0) !important;
    transition: transform 0.3s ease-out !important;
}

.auth-modal.show .modal-dialog {
    transform: translate3d(0, 0, 0) !important;
}