/* ========================================
   Login Page Styles - Rewards Management
   ======================================== */

:root {
    --login-bg-primary: #0f172a;
    --login-bg-secondary: #1e293b;
    --login-bg-card: #ffffff;
    --login-accent: #6366f1;
    --login-accent-hover: #4f46e5;
    --login-accent-light: rgba(99, 102, 241, 0.1);
    --login-text-primary: #0f172a;
    --login-text-secondary: #64748b;
    --login-text-white: #ffffff;
    --login-text-muted: #94a3b8;
    --login-border: #e2e8f0;
    --login-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --login-radius: 16px;
}

body.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'MiSans', 'MiSans Thai' !important;
}

/* Background Pattern */
.login-bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg-pattern .circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
}

.login-bg-pattern .circle-1 {
    width: 600px;
    height: 600px;
    background: var(--login-accent);
    top: -200px;
    right: -100px;
    animation: floatCircle 20s ease-in-out infinite;
}

.login-bg-pattern .circle-2 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    bottom: -100px;
    left: -100px;
    animation: floatCircle 15s ease-in-out infinite reverse;
}

.login-bg-pattern .circle-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatCircle 25s ease-in-out infinite;
}

@keyframes floatCircle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(10px, 10px) scale(1.02); }
}

/* Main Container */
.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-container {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: var(--login-radius);
    overflow: hidden;
    box-shadow: var(--login-shadow);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left Panel - Brand Info */
.login-brand {
    background: linear-gradient(135deg, var(--login-accent) 0%, #7c3aed 100%);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.login-brand-content {
    position: relative;
    z-index: 1;
}

.login-brand .brand-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.login-brand h1 {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.login-brand .brand-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.login-brand .brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-brand .brand-features li {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-brand .brand-features li i {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.login-brand .contact-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.login-brand .contact-info p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-brand .contact-info p i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.login-brand .contact-info a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s;
}

.login-brand .contact-info a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Right Panel - Login Form */
.login-form-panel {
    background: var(--login-bg-card);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-header {
    margin-bottom: 2rem;
}

.login-form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--login-text-primary);
    margin-bottom: 0.4rem;
}

.login-form-header p {
    color: var(--login-text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Form Inputs */
.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--login-text-primary);
    margin-bottom: 0.4rem;
    display: block;
}

.login-form .input-wrapper {
    position: relative;
}

.login-form .input-wrapper i.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--login-text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
    pointer-events: none;
    z-index: 2;
}

.login-form .form-control {
    height: 48px;
    padding: 0.5rem 0.875rem 0.5rem 2.6rem;
    border: 1.5px solid var(--login-border);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--login-text-primary);
    transition: all 0.2s ease;
    background: #f8fafc;
}

.login-form .form-control:focus {
    border-color: var(--login-accent);
    box-shadow: 0 0 0 3px var(--login-accent-light);
    background: #fff;
    outline: none;
}

.login-form .form-control:focus + i.input-icon,
.login-form .input-wrapper:focus-within i.input-icon {
    color: var(--login-accent);
}

.login-form .form-control::placeholder {
    color: var(--login-text-muted);
    font-size: 0.85rem;
}

/* Password Toggle */
.login-form .toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--login-text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    z-index: 2;
    transition: color 0.2s;
}

.login-form .toggle-password:hover {
    color: var(--login-text-primary);
}

/* Submit Button */
.login-form .btn-login {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--login-accent) 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.login-form .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.login-form .btn-login:active {
    transform: translateY(0);
}

.login-form .btn-login.loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-form .btn-login .spinner {
    display: none;
}

.login-form .btn-login.loading .spinner {
    display: inline-block;
}

.login-form .btn-login.loading .btn-text {
    display: none;
}

/* Alert Messages */
.login-alert {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border: none;
    animation: fadeIn 0.3s ease;
}

.login-alert.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.login-alert.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Footer Links */
.login-form-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.login-form-footer a {
    font-size: 0.8rem;
    color: var(--login-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-form-footer a:hover {
    color: var(--login-accent-hover);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 440px;
        margin: 0 auto;
    }

    .login-brand {
        padding: 2rem 1.5rem;
        text-align: center;
    }

    .login-brand .brand-icon {
        margin: 0 auto 1rem;
    }

    .login-brand .brand-features {
        display: none;
    }

    .login-brand .contact-info {
        display: none;
    }

    .login-brand h1 {
        font-size: 1.4rem;
    }

    .login-brand .brand-desc {
        margin-bottom: 0;
        font-size: 0.85rem;
    }

    .login-form-panel {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 1rem 0.75rem;
    }

    .login-form-panel {
        padding: 1.5rem 1.25rem;
    }

    .login-brand {
        padding: 1.5rem 1.25rem;
    }
}

/* Version Badge */
.login-version {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
}
