/* ================================================
   LEEK FOOD - Premium Auth Pages
   ================================================ */

:root {
    --auth-primary: #f97316;
    --auth-primary-dark: #ea580c;
    --auth-primary-light: #fdba74;
    --auth-primary-glow: rgba(249, 115, 22, 0.35);
    --auth-dark: #0f0f23;
    --auth-dark-mid: #1a1a3e;
    --auth-dark-light: #252545;
    --auth-accent: #8b5cf6;
    --auth-accent-glow: rgba(139, 92, 246, 0.3);
    --auth-surface: rgba(255, 255, 255, 0.97);
    --auth-surface-glass: rgba(255, 255, 255, 0.12);
    --auth-border: rgba(255, 255, 255, 0.15);
    --auth-text: #1f2937;
    --auth-text-muted: #6b7280;
    --auth-radius: 20px;
    --auth-radius-sm: 14px;
    --auth-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }

body.auth-page {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Animated gradient background */
    background: linear-gradient(-45deg, 
        var(--auth-dark) 0%, 
        var(--auth-dark-mid) 25%, 
        #1e1b4b 50%, 
        var(--auth-dark-light) 75%,
        #312e81 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

/* =========================================
   ANIMATED BACKGROUND PARTICLES
   ========================================= */
.auth-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.auth-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}

.auth-bg .orb-1 {
    width: 400px; height: 400px;
    background: var(--auth-primary);
    top: -10%; right: -5%;
    animation-delay: 0s;
    animation-duration: 18s;
}

.auth-bg .orb-2 {
    width: 300px; height: 300px;
    background: var(--auth-accent);
    bottom: -10%; left: -5%;
    animation-delay: -5s;
    animation-duration: 22s;
}

.auth-bg .orb-3 {
    width: 200px; height: 200px;
    background: #06b6d4;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.05); }
}

/* =========================================
   BACK LINK
   ========================================= */
.auth-back {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    background: var(--auth-surface-glass);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--auth-border);
    transition: var(--auth-transition);
}

.auth-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
}

/* =========================================
   AUTH WRAPPER
   ========================================= */
.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    animation: authFadeIn 0.6s ease-out;
}

.auth-wrapper.auth-wrapper--wide {
    max-width: 500px;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================
   LOGO / BRANDING
   ========================================= */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand-icon {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px var(--auth-primary-glow), 0 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    padding: 12px;
}

.auth-brand-icon::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
    animation: iconShine 3s ease-in-out infinite;
}

@keyframes iconShine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

.auth-brand-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.auth-brand-icon i {
    font-size: 1.8rem;
    color: var(--auth-primary);
    position: relative;
    z-index: 1;
}

.auth-brand h1 {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    letter-spacing: -0.5px;
}

.auth-brand p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin: 0;
}

/* =========================================
   CARD — Glass morphism
   ========================================= */
.auth-card {
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    padding: 2.25rem;
    box-shadow: 
        0 24px 64px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-accent), var(--auth-primary));
    background-size: 200% 100%;
    animation: gradientBar 4s ease infinite;
}

@keyframes gradientBar {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.auth-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 0.35rem;
    text-align: center;
}

.auth-card-subtitle {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    text-align: center;
    margin-bottom: 1.75rem;
}

/* =========================================
   FORM GROUPS
   ========================================= */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #c4c9d4;
    font-size: 0.95rem;
    transition: var(--auth-transition);
    pointer-events: none;
}

.auth-input-wrap input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--auth-text);
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--auth-radius-sm);
    transition: var(--auth-transition);
    outline: none;
}

.auth-input-wrap input::placeholder {
    color: #b0b8c4;
}

.auth-input-wrap input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.auth-input-wrap input:focus {
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

.auth-input-wrap input:focus ~ .input-icon {
    color: var(--auth-primary);
}

/* Password toggle */
.auth-input-wrap .toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border: none;
    background: none;
    font-size: 1rem;
    transition: var(--auth-transition);
    z-index: 2;
}

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

.auth-input-wrap input[type="password"] ~ .toggle-password .fa-eye { display: none; }
.auth-input-wrap input[type="password"] ~ .toggle-password .fa-eye-slash { display: inline; }
.auth-input-wrap input[type="text"] ~ .toggle-password .fa-eye { display: inline; }
.auth-input-wrap input[type="text"] ~ .toggle-password .fa-eye-slash { display: none; }

/* Two-column row */
.auth-row {
    display: flex;
    gap: 0.85rem;
}
.auth-row .auth-field {
    flex: 1;
}

/* =========================================
   ROLE SELECTOR (Register)
   ========================================= */
.auth-role {
    border-radius: var(--auth-radius-sm);
    border: 2px solid #e2e8f0;
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: #f8fafc;
}

.auth-role:hover {
    border-color: var(--auth-primary-light);
    background: #fff8f3;
}

.auth-role.active {
    border-color: var(--auth-primary);
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

.auth-role input[type="checkbox"] {
    width: 1.3rem;
    height: 1.3rem;
    margin-top: 0.15rem;
    accent-color: var(--auth-primary);
    flex-shrink: 0;
    cursor: pointer;
}

.auth-role-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--auth-text);
    margin-bottom: 0.15rem;
}

.auth-role-text span {
    font-size: 0.82rem;
    color: var(--auth-text-muted);
    line-height: 1.4;
}

/* =========================================
   SUBMIT BUTTON
   ========================================= */
.auth-submit {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    border: none;
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

.auth-submit::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 300%; height: 300%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
    border-radius: 50%;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--auth-primary-glow);
}

.auth-submit:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.auth-submit:active {
    transform: translateY(0) scale(0.98);
}

.auth-submit i {
    position: relative;
    z-index: 1;
}

.auth-submit span {
    position: relative;
    z-index: 1;
}

/* =========================================
   DIVIDER
   ========================================= */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--auth-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* =========================================
   FOOTER LINK
   ========================================= */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
}

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

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

/* =========================================
   ALERTS
   ========================================= */
.auth-alert {
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-alert--error {
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-alert--error i {
    color: #ef4444;
}

.auth-alert--warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 1px solid #fde68a;
}

.auth-alert--warning i {
    color: #f59e0b;
}

/* =========================================
   TRUST BADGES
   ========================================= */
.auth-trust {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.75rem;
}

.auth-trust-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

.auth-trust-item i {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 480px) {
    body.auth-page {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: 4.5rem;
    }

    .auth-back {
        top: 1rem;
        left: 1rem;
    }

    .auth-brand {
        margin-bottom: 1.25rem;
    }

    .auth-brand-icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .auth-brand-icon i {
        font-size: 1.4rem;
    }

    .auth-brand h1 {
        font-size: 1.4rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .auth-row {
        flex-direction: column;
        gap: 0;
    }

    .auth-trust {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .auth-bg .orb {
        filter: blur(60px);
        opacity: 0.3;
    }
}

@media (min-width: 768px) {
    .auth-card {
        padding: 2.5rem;
    }
}
