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

#loginModal .modal-content {
    background: #ffffff;
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 30px 80px rgba(31, 111, 139, 0.18);
    overflow: hidden;
}

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

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

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

#loginModal .books-badge {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef5d73, #f37a5d);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 10px 25px rgba(239, 93, 115, 0.25);
}

#loginModal h2 {
    color: #1f6f8b;
    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 {
    background: #f4f8fb;
    color: #5f7280;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

#loginModal .nav-pills .nav-link:hover {
    background: #edf6fa;
    color: #1f6f8b;
}

#loginModal .nav-pills .nav-link.active {
    background: linear-gradient(135deg, #1f6f8b, #2c8cab);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(31, 111, 139, 0.22);
}

/* ==========================================
   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 {
    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 .merch-purchase-btn,
#loginModal .btn-primary {
    margin-top: 0;
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ef5d73, #f37a5d);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(239, 93, 115, 0.25);
    transition: all 0.25s ease;
}

#loginModal .merch-purchase-btn:hover,
#loginModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(239, 93, 115, 0.35);
    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;
}