/* ==========================================
   LOGIN / SIGN UP MODAL
========================================== */

#loginModal .modal-content {
    background: #ffffff;
    border: none;
    border-radius: 1.5rem;
    box-shadow:
        0 35px 90px rgba(13, 44, 84, .16),
        0 10px 25px rgba(13, 44, 84, .08);
    overflow: hidden;
}

#loginModal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#loginModal .modal-body {
    padding-top: 0.5rem;
}

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

#loginModal .books-badge {

    display: inline-flex;
    align-items: center;

    padding: 0.55rem 1.15rem;

    border-radius: 999px;

    background:
        linear-gradient(135deg,
            #c93b47 0%,
            #b72f3c 100%);

    color: #ffffff;

    font-size: 0.72rem;

    font-weight: 800;

    letter-spacing: 0.09em;

    text-transform: uppercase;

    box-shadow:
        0 8px 18px rgba(189, 54, 64, 0.16);

}

#loginModal .books-badge::before {
    content: none;
}

#loginModal h2 {
    color: #173f73;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#loginModal .text-muted {
    color: #6c757d !important;
}

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

#loginModal .btn-close {
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#loginModal .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}


/* ==========================================
   NAV TABS
========================================== */

#loginModal .nav-pills {
    gap: 0.75rem;
}

#loginModal .nav-pills .nav-link {
    padding: 0.75rem 1.25rem;

    border:
        1px solid transparent;

    border-radius: 18px;

    background: #f4f7fb;

    color: #5f7280;

    font-weight: 650;

    box-shadow: none;

    transition:
        background-color 0.4s ease,
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease,
        transform 0.4s ease;
}

#loginModal .nav-pills .nav-link:hover {
    background: #edf3fa;

    color: #244f82;

    border-color:
        rgba(47, 105, 200, 0.10);
}

#loginModal .nav-pills .nav-link.active {
    position: relative;

    background: #2f69c8;

    color: #ffffff;

    border-color:
        rgba(23, 63, 115, 0.18);

    box-shadow:
        0 8px 20px rgba(47, 105, 200, 0.18);

    font-weight: 800;

    transform: none;
}

#loginModal .nav-pills .nav-link.active::before {
    content: none;
    display: none;
}

#loginModal .nav-pills .nav-link.active:hover {
    background: #285fb8;

    color: #ffffff;

    border-color:
        rgba(23, 63, 115, 0.22);

    box-shadow:
        0 10px 24px rgba(47, 105, 200, 0.22);

    transform: none;
}

/* ==========================================
   FORM LABELS
========================================== */

#loginModal .form-label {
    color: #1f6f8b;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

/* ==========================================
   FORM INPUTS
========================================== */

#loginModal .form-control,
#loginModal .form-select {
    background: #fafbfd;
    border: 1px solid rgba(31, 111, 139, 0.12);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    box-shadow: none;
    transition: all 0.25s ease;
}

#loginModal .form-control::placeholder {
    color: #9aa7b2;
}

#loginModal .form-control:focus,
#loginModal .form-select:focus {
    border-color: rgba(31, 111, 139, 0.35);
    box-shadow: 0 0 0 0.25rem rgba(31, 111, 139, 0.10);
}

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

#loginModal a {
    color: #1f6f8b;
    font-weight: 600;
    transition: color 0.2s ease;
}

#loginModal a:hover {
    color: #ef5d73;
}

/* ==========================================
   BUTTONS
========================================== */

#loginModal .login-glossy-btn,
#loginModal .merch-purchase-btn,
#loginModal .btn-primary {

    margin-top: 0;

    position: relative;

    overflow: hidden;

    border: 1px solid rgba(20, 82, 105, 0.18);

    border-radius: 999px;

    padding: 0.9rem 1.5rem;

    font-weight: 700;

    color: #ffffff;

    background:
        linear-gradient(180deg,
            #2f69c8 0%,
            #2359b1 40%,
            #1d4f9d 70%,
            #173f73 100%);

    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, .28),
        inset 0 -2px 0 rgba(12, 46, 89, .18),
        0 12px 28px rgba(31, 88, 173, .24);

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        background .22s ease;
}

#loginModal .login-glossy-btn::before,
#loginModal .merch-purchase-btn::before,
#loginModal .btn-primary::before {

    content: "";

    position: absolute;

    left: 10%;
    right: 10%;
    top: 3px;

    height: 42%;

    border-radius: 999px;

    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, .40),
            rgba(255, 255, 255, .08));

    pointer-events: none;
}

#loginModal .login-glossy-btn:hover,
#loginModal .merch-purchase-btn:hover,
#loginModal .btn-primary:hover {

    transform: translateY(-2px);

    background:
        linear-gradient(180deg,
            #3976d8 0%,
            #2962bf 40%,
            #2054a8 70%,
            #19467f 100%);

    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, .34),
        inset 0 -2px 0 rgba(12, 46, 89, .18),
        0 16px 34px rgba(31, 88, 173, .34);

    color: #ffffff;
}

/* ==========================================
   FOOTER NOTE
========================================== */

#loginModal small {
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ==========================================
   MODAL BACKDROP
========================================== */

.modal-backdrop.show {
    opacity: 0.6;
}

/* ==========================================
   AVATAR PREVIEW
========================================== */

.avatar-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-preview-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: block;
    border: 3px solid #d9e6ee;
    box-shadow: 0 8px 20px rgba(31, 111, 139, 0.12);
}

/* ==========================================
   AVATAR DROPDOWN
========================================== */

#signupAvatar {
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1f6f8b;
    background-color: #ffffff;
    border: 2px solid #d9e6ee;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    box-shadow: 0 6px 16px rgba(31, 111, 139, 0.08);
    transition: all 0.3s ease;
}

#signupAvatar:focus {
    border-color: #1f6f8b;
    box-shadow: 0 0 0 0.25rem rgba(31, 111, 139, 0.15);
    outline: none;
}

#signupAvatar option {
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #1f6f8b;
}

/* ==========================================
   PASSWORD TOGGLE
========================================== */

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #7a8a99;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 5;
    transition: color 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus {
    color: #1f6f8b;
    outline: none;
}

/* ==========================================
   USER AVATAR IN NAVBAR
========================================== */

.user-avatar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.user-avatar-nav img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    display: block;
    border: 2px solid #ffffff;
    box-shadow:
        0 6px 16px rgba(31, 111, 139, 0.18),
        0 0 0 2px rgba(31, 111, 139, 0.08);
    transition: all 0.3s ease;
}

.user-avatar-nav img:hover {
    transform: scale(1.05);
    box-shadow:
        0 8px 20px rgba(31, 111, 139, 0.22),
        0 0 0 2px rgba(31, 111, 139, 0.12);
}

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

@media (max-width: 1199.98px) {
    .user-avatar-nav {
        margin-top: 0.75rem;
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    #loginModal .modal-dialog {
        margin: 1rem;
    }

    #loginModal .modal-content {
        border-radius: 1.25rem;
    }

    #loginModal .modal-header,
    #loginModal .modal-body {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    #loginModal h2 {
        font-size: 1.35rem;
    }

    #loginModal .nav-pills .nav-link {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }

    #loginModal .form-control,
    #loginModal .form-select {
        padding: 0.8rem 0.95rem;
        font-size: 0.95rem;
    }

    .avatar-preview-img {
        width: 80px;
        height: 80px;
    }
}

/* ==========================================
   PASSWORD REQUIREMENTS POPUP
========================================== */

.password-requirements {
    margin-top: 0.75rem;
    padding: 1rem 1.25rem 1rem 1.25rem;
    position: relative;

    /* Soft background */
    background: linear-gradient(135deg, #fff8fa 0%, #fffdfd 100%);

    /* Border */
    border: 1px solid rgba(233, 75, 90, 0.18);
    border-left: 5px solid #e94b5a;

    /* Rounded corners */
    border-radius: 14px;

    /* Shadow */
    box-shadow:
        0 12px 30px rgba(233, 75, 90, 0.08),
        0 4px 10px rgba(0, 0, 0, 0.03);

    /* Text */
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.6;

    animation: fadeInUp 0.25s ease;
}

/* Header */
.password-requirements strong {
    display: block;
    margin-bottom: 0.65rem;
    color: #0b4f6c;
    font-size: 0.95rem;
    font-weight: 700;
}

/* List */
.password-requirements ul {
    margin: 0;
    padding-left: 1.25rem;
}

.password-requirements li {
    margin-bottom: 0.35rem;
    color: #5b6470;
}

/* Valid rule */
.password-requirements li.valid {
    color: #198754;
    font-weight: 600;
}

/* Invalid rule */
.password-requirements li.invalid {
    color: #e94b5a;
    font-weight: 500;
}

/* Example text */
.password-requirements small {
    display: block;
    margin-top: 0.75rem;
    color: #64748b;
    font-size: 0.82rem;
}

/* Close button */
.password-popup-close {
    position: absolute;
    top: 0.55rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(233, 75, 90, 0.08);
    color: #e94b5a;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.password-popup-close:hover {
    background: #e94b5a;
    color: #ffffff;
    transform: scale(1.08);
}

/* Fade animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ==========================================
   RESET PASSWORD PAGE
========================================== */

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

.password-toggle:hover {
    color: #e94b5a;
}

.password-match-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #e94b5a;
}

#resetSuccessMessage {
    border-radius: 1rem;
    font-weight: 600;
}

/* ==========================================
   PREMIUM AUTH SUBMIT BUTTON
========================================== */

#loginModal .login-glossy-btn {
    position: relative;

    width: 100%;
    min-height: 56px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border:
        1px solid rgba(23, 63, 115, 0.24);

    border-radius: 999px;

    background:
        linear-gradient(180deg,
            #3976d8 0%,
            #2f69c8 36%,
            #2359b1 68%,
            #173f73 100%);

    color: #ffffff;

    font-size: 1rem;
    font-weight: 800;

    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.30),
        inset 0 -2px 0 rgba(8, 42, 87, 0.18),
        0 14px 30px rgba(31, 88, 173, 0.26);

    cursor: pointer;

    transition:
        transform 0.22s ease,
        background 0.22s ease,
        box-shadow 0.22s ease;
}


#loginModal .login-glossy-btn::before {
    content: "";

    position: absolute;

    top: 3px;
    left: 10%;
    right: 10%;

    height: 42%;

    border-radius: 999px;

    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.42),
            rgba(255, 255, 255, 0.07));

    pointer-events: none;
}


#loginModal .login-glossy-btn:hover {
    transform: translateY(-2px);

    background:
        linear-gradient(180deg,
            #4380e2 0%,
            #3477d5 36%,
            #2865b8 68%,
            #1a477f 100%);

    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.34),
        inset 0 -2px 0 rgba(8, 42, 87, 0.18),
        0 18px 38px rgba(31, 88, 173, 0.34);
}


#loginModal .login-glossy-btn:focus-visible {
    outline:
        3px solid rgba(52, 119, 213, 0.28);

    outline-offset: 3px;
}