/* ======================================
   CUSTOM AUTH PAGES CSS - COMPLETE REMAKE
   ====================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root Variables - Auth Specific */
:root {
    /* Colors */
    --auth-primary: #7c3aed;
    --auth-primary-dark: #6d28d9;
    --auth-primary-light: #a78bfa;
    --auth-secondary: #3b82f6;
    --auth-success: #10b981;
    --auth-danger: #ef4444;
    
    /* Backgrounds */
    --auth-bg: #f8fafc;
    --auth-card-bg: #ffffff;
    --auth-input-bg: #ffffff;
    --auth-input-focus-bg: #fafbff;
    
    /* Text */
    --auth-text-primary: #1e293b;
    --auth-text-secondary: #64748b;
    --auth-text-light: #94a3b8;
    
    /* Borders */
    --auth-border: #e2e8f0;
    --auth-border-focus: #7c3aed;
    
    /* Shadows */
    --auth-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --auth-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --auth-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --auth-space-xs: 0.5rem;
    --auth-space-sm: 0.75rem;
    --auth-space: 1rem;
    --auth-space-lg: 1.5rem;
    --auth-space-xl: 2rem;
    
    /* Transitions */
    --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body Styling */
body.guest-user {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--auth-bg);
    color: var(--auth-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body.guest-user::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(124, 58, 237, 0.04) 0%, transparent 50%);
    z-index: 0;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-20px, -20px) scale(1.02); }
    66% { transform: translate(20px, -10px) scale(0.98); }
}

/* Custom Header Specific Styles */
.custom-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 
                0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 100;
    transition: var(--auth-transition);
}

.custom-header.scrolled {
    height: 64px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                0 2px 4px rgba(0, 0, 0, 0.06);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--auth-space-xl);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Logo Styles */
.logo-section {
    display: flex;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: var(--auth-transition);
}

.logo-icon-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-secondary) 100%);
    border-radius: 12px;
    transition: var(--auth-transition);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper:hover .logo-icon-bg {
    transform: rotate(-10deg) scale(1.05);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.logo-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    z-index: 1;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Navigation Links */
.nav-links {
    display: none;
}

/* Header Buttons */
.header-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--auth-space-xs);
    padding: var(--auth-space-sm) var(--auth-space-lg);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--auth-transition);
    border: 2px solid transparent;
}

.header-btn-secondary {
    background: var(--auth-card-bg);
    color: var(--auth-text-primary);
    border-color: var(--auth-border);
}

.header-btn-secondary:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

/* Auth Page Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--auth-space-xl) var(--auth-space);
    position: relative;
    z-index: 1;
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 440px;
    background: var(--auth-card-bg);
    border-radius: 24px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    position: relative;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Larger container for register page */
body.guest-user:has(form[action*="register"]) .auth-container {
    max-width: 520px;
}

/* Hover effect for auth container */
.auth-container:hover {
    box-shadow: 
        0 30px 40px -10px rgba(0, 0, 0, 0.15),
        0 15px 15px -5px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Auth Header */
.auth-header {
    padding: var(--auth-space-xl);
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
}

/* Larger header for register */
body.guest-user:has(form[action*="register"]) .auth-header {
    padding: 2.5rem 2rem 2rem;
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--auth-text-primary);
    margin-bottom: var(--auth-space-xs);
    letter-spacing: -0.025em;
    position: relative;
    display: inline-block;
}

.auth-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--auth-primary);
    border-radius: 2px;
}

.auth-header p {
    color: var(--auth-text-secondary);
    font-size: 0.95rem;
    margin-top: 1rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--auth-text-primary);
    margin-bottom: var(--auth-space-xs);
    letter-spacing: -0.025em;
}

.auth-header p {
    color: var(--auth-text-secondary);
    font-size: 0.95rem;
}

/* Auth Form */
.auth-form {
    padding: 0 var(--auth-space-xl) var(--auth-space-xl);
}

/* More padding for register form */
body.guest-user:has(form[action*="register"]) .auth-form {
    padding: 0 2.5rem 2.5rem;
}

/* Form Groups */
.form-group {
    margin-bottom: var(--auth-space-lg);
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Larger spacing for register form */
body.guest-user:has(form[action*="register"]) .form-group {
    margin-bottom: 1.75rem;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Form Labels */
.form-label {
    display: block;
    margin-bottom: var(--auth-space-xs);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--auth-text-primary);
    letter-spacing: 0.025em;
}

/* Input Container */
.input-with-icon {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--auth-input-bg);
    border: 2px solid var(--auth-border);
    transition: var(--auth-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.input-with-icon:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.input-with-icon:focus-within {
    border-color: var(--auth-primary);
    box-shadow: 
        0 0 0 4px rgba(124, 58, 237, 0.1),
        0 4px 12px rgba(124, 58, 237, 0.15);
}

.input-with-icon i {
    position: absolute;
    left: var(--auth-space);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    color: var(--auth-text-light);
    transition: var(--auth-transition);
    z-index: 1;
}

.input-with-icon:focus-within i {
    color: var(--auth-primary);
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: var(--auth-space) 3.5rem var(--auth-space) 3rem;
    font-size: 1rem;
    color: var(--auth-text-primary);
    background: transparent;
    border: none;
    outline: none;
    transition: var(--auth-transition);
    font-weight: 500;
}

.form-input::placeholder {
    color: var(--auth-text-light);
    font-weight: 400;
}

/* Password Toggle - Fixed Position */
.password-toggle {
    position: relative;
}

.password-toggle .form-input {
    padding-right: 3.5rem;
}

.password-toggle .toggle-icon {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--auth-transition);
    color: var(--auth-text-light);
    z-index: 2;
}

.password-toggle .toggle-icon:hover {
    color: var(--auth-primary);
}

.password-toggle .toggle-icon i {
    font-size: 1.125rem;
    transition: var(--auth-transition);
}

/* Remember Me Section */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--auth-space-xl) 0;
    padding: var(--auth-space);
    background: linear-gradient(135deg, #f8f9ff 0%, #f3f4ff 100%);
    border-radius: 12px;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
    opacity: 0;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding-left: 32px;
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-primary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label::before {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--auth-border);
    border-radius: 6px;
    background: white;
    transition: var(--auth-transition);
}

.checkbox-label::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 8px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: var(--auth-transition);
}

.custom-checkbox input:checked ~ .checkbox-label::before {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.custom-checkbox input:checked ~ .checkbox-label::after {
    transform: rotate(45deg) scale(1);
}

/* Forgot Password Link */
.forgot-password {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-primary);
    text-decoration: none;
    transition: var(--auth-transition);
    position: relative;
}

.forgot-password:hover {
    color: var(--auth-primary-dark);
}

/* Submit Button */
.submit-button {
    width: 100%;
    padding: var(--auth-space) var(--auth-space-lg);
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--auth-transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    box-shadow: 
        0 4px 12px rgba(124, 58, 237, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(124, 58, 237, 0.35),
        0 4px 6px rgba(0, 0, 0, 0.1);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(124, 58, 237, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.08);
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.submit-button:hover::before {
    left: 100%;
}

/* Auth Footer */
.auth-footer {
    padding: var(--auth-space-lg);
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    border-top: 1px solid var(--auth-border);
}

.auth-footer p {
    color: var(--auth-text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.auth-footer a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--auth-transition);
}

.auth-footer a:hover {
    color: var(--auth-primary-dark);
}

/* Validation States */
.validation-error {
    display: block;
    margin-top: var(--auth-space-xs);
    font-size: 0.813rem;
    color: var(--auth-danger);
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.input-with-icon.error {
    border-color: var(--auth-danger);
}

.input-with-icon.error i {
    color: var(--auth-danger);
}

/* Session Status */
.session-status {
    padding: var(--auth-space);
    margin-bottom: var(--auth-space-lg);
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .custom-header {
        height: 64px;
    }
    
    .header-inner {
        padding: 0 var(--auth-space);
    }
    
    .logo-icon-wrapper {
        width: 38px;
        height: 38px;
    }
    
    .logo-icon {
        font-size: 18px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .header-btn {
        padding: 0.5rem 1rem;
        font-size: 0.813rem;
    }
    
    .header-btn span {
        display: none;
    }
    
    .auth-page {
        padding: var(--auth-space);
    }
    
    .auth-container {
        border-radius: 20px;
    }
    
    .auth-header {
        padding: var(--auth-space-lg);
    }
    
    .auth-form {
        padding: 0 var(--auth-space-lg) var(--auth-space-lg);
    }
}

/* Hide conflicting elements */
.cart, .cart-overlay, .top_cart, .items_in_cart, .bottom_Cart {
    display: none !important;
}

/* Override any Bootstrap conflicts */
.form-control, .btn, .btn-primary, .btn-outline {
    all: unset;
}

/* Form Row for Two Columns */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: 1.75rem;
}

/* Responsive Form Row */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
