/* ===== MODERN LOGIN PAGE STYLES ===== */

/* Page Container */
.login-page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Animated Background Elements */
.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 6s ease-in-out infinite;
}

.element-1 {
    width: 120px;
    height: 120px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.element-2 {
    width: 80px;
    height: 80px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.element-3 {
    width: 60px;
    height: 60px;
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Main Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 10;
    animation: slideInUp 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* Brand Section */
.login-brand {
    text-align: center;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="20" fill="url(%23grid)"/></svg>') repeat;
    opacity: 0.3;
}

.brand-icon {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.icon-wrapper [data-lucide] {
    width: 28px;
    height: 28px;
    color: white;
}

.brand-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

/* Form Section */
.login-form-section {
    padding: 1.5rem 2rem 2rem 2rem;
}

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

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.025em;
}

.login-header p {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
}

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

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

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    z-index: 2;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #f9fafb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-input:focus + .input-icon {
    color: #667eea;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.toggle-icon {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

/* Login Button */
.login-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.25rem;
}

.login-button::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 ease;
}

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

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px rgba(102, 126, 234, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-icon {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.login-button:hover .button-icon {
    transform: translateX(2px);
}

/* Button loading state */
.button-icon.spinning {
    animation: spin 1s linear infinite;
}

/* Button success state */
.button-icon.success {
    color: #10b981;
}

/* Input icon states */
.input-icon.focused {
    color: #667eea;
}

.input-icon.active {
    color: #667eea;
}

.input-icon.inactive {
    color: #9ca3af;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    display: none;
    animation: errorShake 0.5s ease-in-out;
}

.error-message.visible {
    display: block;
}

.error-message i {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Input error state */
.form-input.error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Footer */
.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.footer-text {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
}

.footer-text p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.footer-text strong {
    color: #374151;
    font-weight: 600;
}

.footer-copyright p {
    color: #9ca3af;
    font-size: 0.8rem;
    margin: 0;
}

/* Loading State */
.loading {
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Spinner Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Laptop Screen Optimization */
@media (max-height: 800px) {
    .login-brand {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .brand-icon {
        margin-bottom: 0.75rem;
    }
    
    .icon-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .icon-wrapper [data-lucide] {
        width: 24px;
        height: 24px;
    }
    
    .brand-title {
        font-size: 1.5rem;
        margin-bottom: 0.125rem;
    }
    
    .brand-subtitle {
        font-size: 0.85rem;
    }
    
    .login-form-section {
        padding: 1.25rem 1.5rem 1.5rem 1.5rem;
    }
    
    .login-header {
        margin-bottom: 1.25rem;
    }
    
    .login-header h2 {
        font-size: 1.25rem;
    }
    
    .login-form {
        gap: 1rem;
    }
    
    .login-footer {
        margin-top: 1.25rem;
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .login-page-container {
        padding: 1rem;
    }
    
    .login-card {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .login-brand {
        padding: 2rem 1.5rem 1.5rem 1.5rem;
    }
    
    .brand-title {
        font-size: 2rem;
    }
    
    .brand-subtitle {
        font-size: 1rem;
    }
    
    .login-form-section {
        padding: 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .icon-wrapper [data-lucide] {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .background-elements .floating-element {
        display: none;
    }
    
    .form-input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
    }
    
    .input-icon {
        left: 0.75rem;
    }
    
    .password-toggle {
        right: 0.75rem;
    }
}

/* Timeout Message Styling */
.timeout-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.timeout-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

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