/* ============ Auth Pages ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    padding: 2rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.auth-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-logo a {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    color: #1a1a2e;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.auth-logo a span {
    color: #e94560;
}

.auth-card h1 {
    text-align: center;
    color: #1a1a2e;
    margin-bottom: 0.3rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.auth-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-message {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    display: none;
    font-weight: 500;
}

.auth-message.error {
    background: linear-gradient(135deg, #fff5f5, #fee2e2);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-message.success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-message.show {
    display: block;
}

.auth-form .form-group {
    margin-bottom: 1.3rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
    color: #1a1a2e;
    font-family: inherit;
}

.auth-form input:focus {
    outline: none;
    border-color: #e94560;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
}

.auth-form input::placeholder {
    color: #9ca3af;
}

.btn-auth-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

.btn-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-links {
    text-align: center;
    margin-top: 1.8rem;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.8;
}

.auth-links a {
    color: #e94560;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: #d63851;
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
}

.password-requirements {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.3rem;
}

/* ============ User Widget (Header) ============ */
.user-widget {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #ffffff;
    font-size: 1.0rem;
}

.user-greeting {
    font-weight: 500;
    white-space: nowrap;
}

.user-btn {
    padding: 0.8rem 0.9rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.user-btn-login {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.user-btn-login:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-btn-admin {
    background: rgba(233, 69, 96, 0.3);
    color: #ffffff;
}

.user-btn-admin:hover {
    background: rgba(233, 69, 96, 0.5);
}

.user-btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.user-btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-btn-changepw {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.user-btn-changepw:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============ Admin Header Bar ============ */
.admin-user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-user-bar .user-name {
    font-weight: 600;
    color: #333;
}

.admin-user-bar .btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    margin: 0;
}

/* ============================================================
   Header Nav — Desktop
   
   Use #mainNav to match ID specificity.
   Keep link color WHITE on desktop; only underline animates.
   ============================================================ */
@media (min-width: 769px) {
    .header-container {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    #mainNav {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    #mainNav .nav-close {
        display: none;
    }

    #mainNav ul {
        display: flex;
        gap: 0.5rem;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #mainNav ul li a {
        font-size: 1.05rem;
        font-weight: 600;
        color: #ffffff;
        text-decoration: none;
        padding: 0.6rem 1.2rem;
        border-radius: 20px;
        transition: all 0.3s ease;
        position: relative;
    }

    /* ★ FIX: keep text white on hover, only add subtle bg */
    #mainNav ul li a:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.1);
    }

    /* ★ FIX: underline effect uses the ::after from style.css.
       Re-declare here at ID specificity so it actually works. */
    #mainNav ul li a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 2px;
        background-color: #e94560;
        transition: all 0.3s ease;
    }

    #mainNav ul li a:hover::after {
        width: 60%;
    }
}

/* ============================================================
   Header Nav — Mobile  (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    .header-container {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    #mainNav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 5rem 1.5rem 2rem;
        transition: all 0.3s ease;
        z-index: 999;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        flex: none;
    }

    #mainNav.active {
        left: 0;
    }

    #mainNav .nav-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: #ffffff;
        font-size: 1.8rem;
        cursor: pointer;
        padding: 0.3rem;
        line-height: 1;
    }

    #mainNav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #mainNav ul li a {
        display: block;
        padding: 1rem 1.5rem;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        color: #ffffff;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    #mainNav ul li a:hover {
        background-color: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    /* No underline in mobile drawer */
    #mainNav ul li a::after {
        display: none;
    }

    .user-widget {
        margin-left: auto;
        order: 1;
    }

    .cart-widget {
        order: 2;
    }

    .menu-toggle {
        order: 10;
    }
}

/* ============ Responsive Auth ============ */
@media (max-width: 480px) {
    .auth-page {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 3rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 18px;
    }

    .auth-card h1 {
        font-size: 1.3rem;
    }

    .user-widget {
        gap: 0.3rem;
        font-size: 0.8rem;
    }

    .user-greeting {
        display: none;
    }

    .user-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .admin-user-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
}