/* Premium Login Page Styles */

/* CSS Variables - Premium Design System */
:root {
    /* Premium Color Palette */
    --primary: #3d4d71;
    --primary-hover: #2d3a5a;
    --primary-light: #e8eaf0;
    --primary-dark: #1e2438;
    --secondary: #7b7b7b;
    --secondary-hover: #6b6b6b;
    --accent: #4f7385;
    --accent-hover: #3f5d6b;
    
    /* Text Colors */
    --title: #1e293b;
    --text: #475569;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --text-white: #ffffff;
    --text-inverse-muted: rgba(255, 255, 255, 0.7);
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --bg-glass-subtle: rgba(255, 255, 255, 0.85);
    --bg-dark: #0f172a;
    --bg-dark-secondary: #1e293b;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: var(--primary);
    
    /* Premium Gradients */
    --gradient-primary: linear-gradient(135deg, #3d4d71 0%, #9d9d9d 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    --gradient-hero: linear-gradient(135deg, #3d4d71 0%, #9d9d9d 50%, #7b7b7b 100%);
    --gradient-mesh: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3), transparent 50%), 
                     radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3), transparent 50%), 
                     radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3), transparent 50%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    
    /* Premium Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-3xl: 0 35px 60px -12px rgba(0, 0, 0, 0.2);
    --shadow-colored: 0 10px 25px -5px rgba(99, 102, 241, 0.2), 0 10px 10px -5px rgba(99, 102, 241, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
    --radius-full: 9999px;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-secondary);
    background-image: var(--gradient-mesh);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    position: relative;
}

/* Background Elements */
.bg-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

.bg-circle-1 {
    width: 300px;
    height: 300px;
    background: var(--gradient-primary);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 200px;
    height: 200px;
    background: var(--gradient-secondary);
    top: 60%;
    right: 15%;
    animation-delay: -7s;
}

.bg-circle-3 {
    width: 150px;
    height: 150px;
    background: var(--gradient-hero);
    bottom: 20%;
    left: 20%;
    animation-delay: -14s;
}

.bg-gradient-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-mesh);
    opacity: 0.3;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

/* Main Container */
.login-container {
    min-height: 100vh;
    display: flex;
    position: relative;
    z-index: 1;
}

/* Left Side - Branding */
.login-brand {
    flex: 1;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

.login-brand::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: brandShine 8s ease-in-out infinite;
    z-index: 2;
}

@keyframes brandShine {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.1;
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        opacity: 0.3;
    }
}

.brand-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--text-white);
    max-width: 500px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-white);
    box-shadow: var(--shadow-2xl), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: logoShine 3s ease-in-out infinite;
}

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

.logo-text {
    text-align: left;
}

.logo-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.brand-description {
    margin-bottom: 3rem;
}

.brand-description h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.brand-description p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.brand-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-normal);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.feature-item i {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Login Brand Footer */
.login-brand-footer {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    padding: 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

/* Mobile Logo - Hidden by default */
.mobile-logo {
    display: none;
}

.feature-item span {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Right Side - Login Form */
.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    position: relative;
}

.login-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-glass);
    z-index: -1;
}

.login-form-wrapper {
    width: 100%;
    max-width: 450px;
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-3xl);
    box-shadow: var(--shadow-3xl), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.login-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-card);
    z-index: -1;
    border-radius: inherit;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--title);
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* Alert Styles */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-normal);
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
    border-color: var(--error);
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Form Styles */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--title);
    font-size: 0.9rem;
}

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

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    z-index: 2;
    transition: var(--transition-normal);
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-normal);
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: translateY(-1px);
}

.input-group input:focus + i,
.input-group.focused i {
    color: var(--primary);
    transform: scale(1.1);
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    position: relative;
    transition: var(--transition-normal);
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-normal);
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-colored);
    position: relative;
    overflow: hidden;
}

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

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow), var(--shadow-xl);
}

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

.login-btn i {
    transition: var(--transition-normal);
}

.login-btn:hover i {
    transform: translateX(4px);
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
    color: var(--text-white);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-brand {
        min-height: 40vh;
        padding: 2rem;
    }
    
    .brand-logo {
        flex-direction: row;
        gap: 1rem;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .logo-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .login-brand {
        display: none;
    }
    
    .login-form-container {
        flex: 1;
        width: 100%;
        max-width: none;
    }
    
    .mobile-logo {
        display: block;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .login-header {
        text-align: center;
    }
    
    .logo-title {
        font-size: 2rem;
    }
    
    .logo-subtitle {
        font-size: 1rem;
    }
    
    .brand-description h2 {
        font-size: 1.25rem;
    }
    
    .brand-description p {
        font-size: 1rem;
    }
    
    .login-form-container {
        padding: 1.5rem;
    }
    
    .login-form-wrapper {
        padding: 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .login-brand {
        min-height: 30vh;
        padding: 1rem;
    }
    
    .brand-logo {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-text {
        text-align: center;
    }
    
    .login-form-container {
        padding: 1rem;
    }
    
    .login-form-wrapper {
        padding: 1.5rem;
        border-radius: var(--radius-2xl);
    }
    
    .input-group input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    }
    
    .login-btn {
        padding: 0.875rem 1.5rem;
    }
}
