/* Auth Modals — Sign In & Sign Up */

/* Modal shell */
#authSignInModal .modal-content,
#authSignUpModal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 32px 80px rgba(5, 6, 108, 0.22), 0 4px 24px rgba(36, 206, 252, 0.10);
    overflow: hidden;
}

/* Slide-down entrance */
#authSignInModal .modal-dialog,
#authSignUpModal .modal-dialog {
    transform: translateY(-40px) scale(0.97);
    transition: transform 0.38s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.28s ease;
    opacity: 0;
}
#authSignInModal.show .modal-dialog,
#authSignUpModal.show .modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Gradient header */
.auth-modal-header {
    background: linear-gradient(135deg, #24CEFC 0%, #05066C 100%);
    padding: 28px 28px 22px;
    text-align: center;
    color: #fff;
    position: relative;
}
.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.auth-modal-close:hover { background: rgba(255,255,255,0.32); }
.auth-modal-logo-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.20);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}
.auth-modal-title {
    font-size: 1.2rem; font-weight: 700; color: #fff;
    margin: 0 0 3px; letter-spacing: -0.2px;
}
.auth-modal-subtitle {
    font-size: 0.8rem; color: rgba(255,255,255,0.75); margin: 0 0 16px;
}
.auth-modal-tabs {
    display: inline-flex; gap: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 50px; padding: 4px;
}
.auth-modal-tab-btn {
    padding: 7px 26px; border-radius: 50px; border: none;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    transition: all 0.22s; background: transparent;
    color: rgba(255,255,255,0.75); text-decoration: none; display: inline-block;
}
.auth-modal-tab-btn.active,.auth-modal-tab-btn:hover {
    background: #fff; color: #05066C; text-decoration: none;
}

/* Form body */
.auth-modal-body { padding: 28px 30px 24px; background: #fff; }
.auth-modal-body .form-label { font-size: 0.82rem; font-weight: 600; color: #444; margin-bottom: 5px; }
.auth-modal-body .form-control {
    border-radius: 10px; border: 1.5px solid #e2e6ea;
    padding: 10px 14px; font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-modal-body .form-control:focus {
    border-color: #24CEFC;
    box-shadow: 0 0 0 3px rgba(36,206,252,0.15); outline: none;
}
.auth-modal-body .form-group { margin-bottom: 14px; }
.auth-modal-body .password-toggle { position: relative; }
.auth-modal-body .password-toggle-btn {
    position: absolute; top: 50%; right: 12px;
    transform: translateY(-50%); margin: 0; cursor: pointer; display: flex; align-items: center;
}

/* Divider */
.auth-modal-divider {
    display: flex; align-items: center; gap: 12px;
    color: #aaa; font-size: 0.78rem; margin: 16px 0;
}
.auth-modal-divider::before,.auth-modal-divider::after {
    content: ''; flex: 1; height: 1px; background: #e8e8e8;
}

/* Social buttons */
.auth-social-row { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-social-btn,.auth-otp-toggle-link {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    flex: 1; min-width: 120px;
    border: 1.5px solid #e2e6ea; border-radius: 10px;
    padding: 9px 12px; font-weight: 500; font-size: 0.82rem;
    color: #333; text-decoration: none; cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s; background: #fff;
}
.auth-social-btn:hover,.auth-otp-toggle-link:hover {
    border-color: #24CEFC; box-shadow: 0 2px 12px rgba(36,206,252,0.15);
    text-decoration: none; color: #05066C;
}
.auth-social-btn img,.auth-otp-toggle-link img { width: 20px; height: 20px; object-fit: contain; }

/* Submit button */
.auth-modal-submit-btn {
    background: linear-gradient(135deg, #24CEFC 0%, #05066C 100%);
    border: none; border-radius: 10px; color: #fff !important;
    font-weight: 700; font-size: 0.95rem; padding: 12px 24px; width: 100%;
    cursor: pointer; transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(5,6,108,0.2);
}
.auth-modal-submit-btn:hover {
    opacity: 0.92; transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5,6,108,0.28);
}
.auth-modal-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Switch link */
.auth-switch-link {
    text-align: center; margin-top: 18px; padding-top: 16px;
    border-top: 1px solid #f0f0f0; font-size: 0.85rem; color: #777;
}
.auth-switch-link a { color: #05066C; font-weight: 700; text-decoration: underline; cursor: pointer; }
.auth-switch-link a:hover { color: #24CEFC; }

/* Sign-up grid */
.auth-signup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.auth-modal-body .custom-control-label { font-size: 0.82rem; color: #555; }
.auth-modal-body .custom-control-label a { color: #05066C; font-weight: 600; }
.auth-modal-body .input-required-icon { color: #e74c3c; margin-left: 2px; }

@media (max-width: 480px) {
    .auth-modal-body { padding: 20px 16px; }
    .auth-modal-header { padding: 20px 16px 16px; }
    .auth-modal-tab-btn { padding: 6px 16px; font-size: 0.8rem; }
    .auth-signup-grid { grid-template-columns: 1fr; }
    .auth-social-row { flex-direction: column; }
}

/* -----------------------------------------------
   Full responsiveness — modal fills screen on phones
   ----------------------------------------------- */
@media (max-width: 575px) {
    #authSignInModal .modal-dialog,
    #authSignUpModal .modal-dialog {
        margin: 0;
        max-width: 100% !important;
        width: 100%;
        min-height: 100vh;
        align-items: flex-end;
    }
    #authSignInModal .modal-content,
    #authSignUpModal .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        overflow-y: auto;
    }
}

/* -----------------------------------------------
   Header auth button — click-toggle dropdown
   ----------------------------------------------- */
.header-account-dropdown {
    position: relative;
}

a.header-auth-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 10px;
    transition: background 0.18s;
    user-select: none;
}
a.header-auth-btn:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}
/* Remove any accidental Bootstrap dropdown arrow */
a.header-auth-btn::after { display: none !important; }

/* Arrow rotation when menu is open */
.header-account-dropdown.open .header-account-arrow {
    transform: rotate(180deg);
}
.header-account-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

/* -----------------------------------------------
   Account dropdown menu panel
   ----------------------------------------------- */
.header-account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(5, 6, 108, 0.15), 0 2px 8px rgba(0,0,0,0.08);
    padding: 8px 0;
    z-index: 1050;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.22s;
    pointer-events: none;
}
/* RTL support */
.header-account-menu.dropdown-menu-left {
    right: auto;
    left: 0;
}

/* Visible state */
.header-account-dropdown.open .header-account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Menu items */
.header-account-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, padding-left 0.2s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.header-account-menu-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: #05066C;
    transition: color 0.15s;
}
.header-account-menu-item:hover {
    background: linear-gradient(90deg, rgba(36,206,252,0.08), rgba(5,6,108,0.04));
    color: #05066C;
    text-decoration: none;
    padding-left: 22px;
}
.header-account-menu-item:hover i {
    color: #24CEFC;
}

/* Logout item */
.header-account-menu-item.logout {
    color: #e74c3c;
}
.header-account-menu-item.logout i {
    color: #e74c3c;
}
.header-account-menu-item.logout:hover {
    background: rgba(231, 76, 60, 0.06);
    color: #c0392b;
}

/* Divider */
.header-account-menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 6px 14px;
}
