/* assets/css/login.css - Modern Glassmorphism Emerald Theme (Compact & Mobile-Optimized) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@600;700;800&display=swap');

:root {
    --primary-emerald: #107c41;
    --primary-light: #22c55e;
    --primary-dark: #0b5a2f;
    --primary-glow: rgba(34, 197, 94, 0.3);
    
    --bg-dark: #06150f;
    --card-bg: rgba(14, 34, 25, 0.78);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-inner-glow: rgba(34, 197, 94, 0.05);
    
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.14);
    --input-focus-border: #22c55e;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page-body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Animated Glowing Background */
.login-bg-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: 
        radial-gradient(circle at 12% 18%, rgba(16, 124, 65, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 88% 82%, rgba(34, 197, 94, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(11, 90, 47, 0.3) 0%, transparent 60%),
        #06150f;
}

/* Grid Dots Overlay */
.login-bg-decor::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.75;
}

/* Animated Floating Luminous Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    animation: orbFloat 14s infinite alternate ease-in-out;
}

.glow-orb-1 {
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, #107c41, #22c55e);
    top: -60px;
    left: -60px;
    animation-duration: 12s;
}

.glow-orb-2 {
    width: 340px;
    height: 340px;
    background: linear-gradient(135deg, #059669, #10b981);
    bottom: -80px;
    right: -80px;
    animation-duration: 15s;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 20px) scale(1.05); }
    100% { transform: translate(-20px, 35px) scale(0.96); }
}

/* Main Container */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    margin: auto;
}

/* Glassmorphism Card (Compact) */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem 1.65rem 1.25rem;
    box-shadow: 
        0 20px 50px -15px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 0 30px var(--card-inner-glow);
    position: relative;
    overflow: hidden;
}

/* Top Accent Line */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: linear-gradient(90deg, transparent, #22c55e, #107c41, transparent);
}

/* Card Header (Compact) */
.login-header {
    text-align: center;
    margin-bottom: 1.15rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #107c41, #22c55e);
    border-radius: 12px;
    font-size: 20px;
    color: #ffffff;
    box-shadow: 
        0 8px 18px -4px rgba(34, 197, 94, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
    transition: transform 0.25s ease;
}

.brand-badge:hover {
    transform: scale(1.06);
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.2rem;
}

.system-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.22);
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 0.35rem;
}

.system-tag .pulse-dot {
    width: 5px;
    height: 5px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 6px #22c55e;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Compact Error Banner */
.alert-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #fca5a5;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    backdrop-filter: blur(8px);
    animation: alertShake 0.4s ease-in-out;
}

.alert-error i {
    color: #ef4444;
    font-size: 0.95rem;
    flex-shrink: 0;
}

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

/* Compact Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 0.85rem;
    color: var(--text-dim);
    font-size: 0.88rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 0.62rem 0.85rem 0.62rem 2.45rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    color: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: #64748b;
    font-size: 0.84rem;
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-container:focus-within .input-icon-left {
    color: var(--primary-light);
}

/* Password Toggle Button */
.password-toggle-btn {
    position: absolute;
    right: 0.65rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Remember Me & Auxiliary Actions */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -0.15rem;
}

.remember-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.remember-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary-light);
    width: 14px;
    height: 14px;
    border-radius: 3px;
    cursor: pointer;
}

/* Compact Submit Button */
.btn-submit {
    margin-top: 0.25rem;
    position: relative;
    width: 100%;
    padding: 0.7rem 1.25rem;
    background: linear-gradient(135deg, #107c41, #16a34a);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 
        0 8px 18px -4px rgba(22, 163, 74, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(30deg) translateY(-100%);
    transition: transform 0.6s ease;
}

.btn-submit:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 10px 22px -4px rgba(22, 163, 74, 0.6);
    background: linear-gradient(135deg, #128c4a, #22c55e);
}

.btn-submit:hover::after {
    transform: rotate(30deg) translateY(100%);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Sleek Compact Demo Credentials Bar */
.demo-credentials-card {
    margin-top: 0.95rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.demo-credentials-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(34, 197, 94, 0.3);
}

.demo-info {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.demo-info strong {
    color: #e2e8f0;
    font-family: monospace;
    font-size: 0.78rem;
}

.btn-quick-fill {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.32);
    color: #4ade80;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-quick-fill:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
    color: #ffffff;
}

.quick-fill-success {
    background: rgba(34, 197, 94, 0.9) !important;
    color: #06150f !important;
    border-color: #22c55e !important;
}

/* Card Footer */
.login-footer {
    margin-top: 0.85rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    color: var(--text-dim);
}

.login-footer i {
    color: #22c55e;
}

/* Mobile & Small Screen Optimizations */
@media (max-width: 480px) {
    body.login-page-body {
        padding: 0.5rem;
    }

    .glass-card {
        padding: 1.25rem 1.15rem 1rem;
        border-radius: 16px;
    }
    
    .brand-badge {
        width: 38px;
        height: 38px;
        font-size: 17px;
        margin-bottom: 0.35rem;
    }

    .brand-title {
        font-size: 1.2rem;
    }
    
    .brand-subtitle {
        font-size: 0.74rem;
    }

    .demo-credentials-card {
        padding: 0.4rem 0.6rem;
    }
    
    .demo-info {
        font-size: 0.7rem;
    }
}

/* Extreme Height Constraint (Landscape or Small Height Viewports < 640px) */
@media (max-height: 640px) {
    body.login-page-body {
        padding: 0.35rem;
    }

    .glass-card {
        padding: 0.9rem 1.2rem 0.8rem;
    }

    .login-header {
        margin-bottom: 0.7rem;
    }

    .brand-badge {
        display: none;
    }

    .login-form {
        gap: 0.6rem;
    }

    .demo-credentials-card {
        margin-top: 0.6rem;
        padding: 0.3rem 0.5rem;
    }

    .login-footer {
        margin-top: 0.5rem;
    }
}
