/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Login Container */
.login-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .background-shape {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-content {
        border: 2px solid;
    }
    
    .input-wrapper input {
        border: 2px solid;
    }
    
    .login-btn {
        border: 2px solid;
    }
}

/* Animated Background */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

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

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

/* Main Content */
.login-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    overflow: hidden;
    min-height: 600px;
}

/* Left Side - Branding */
.login-branding {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.login-branding::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 100"><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="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.brand-logo i {
    font-size: 48px;
    color: #60a5fa;
}

.brand-logo h1 {
    font-size: 32px;
    font-weight: 800;
}

.brand-tagline {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.brand-tagline h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.brand-tagline p {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.feature-highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

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

.feature-item i {
    font-size: 20px;
    color: #60a5fa;
    width: 24px;
    text-align: center;
}

.feature-item span {
    font-weight: 600;
    font-size: 15px;
}

/* Right Side - Login Form */
.login-form-container {
    padding: 60px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h3 {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.login-header p {
    color: #64748b;
    font-size: 16px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

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

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #6366f1;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: #6366f1;
    border-color: #6366f1;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.checkbox-label {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.forgot-password {
    color: #6366f1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #4f46e5;
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

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

.login-btn.loading {
    pointer-events: none;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .loading-spinner {
    display: block !important;
}

/* Divider */
.divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    background: white;
    padding: 0 16px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.social-btn:hover {
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
}

.microsoft-btn {
    color: #0078d4;
}

.microsoft-btn:hover {
    background: #f3f9ff;
    border-color: #0078d4;
}

.google-btn {
    color: #ea4335;
}

.google-btn:hover {
    background: #fef7f7;
    border-color: #ea4335;
}

.social-btn i {
    font-size: 18px;
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}

.login-footer p {
    color: #6b7280;
    font-size: 14px;
}

.signup-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.signup-link:hover {
    color: #4f46e5;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .login-content {
        max-width: 900px;
    }
}

@media (max-width: 1024px) {
    .login-content {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .login-branding {
        padding: 40px 30px;
        text-align: center;
    }
    
    .brand-tagline h2 {
        font-size: 20px;
    }
    
    .feature-highlights {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .feature-item {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 12px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .login-content {
        min-height: auto;
        width: 100%;
        max-width: 480px;
    }
    
    .login-branding {
        padding: 24px 20px;
    }
    
    .login-form-container {
        padding: 24px 20px;
    }
    
    .brand-logo {
        margin-bottom: 24px;
    }
    
    .brand-logo h1 {
        font-size: 22px;
    }
    
    .brand-logo i {
        font-size: 32px;
    }
    
    .brand-tagline {
        margin-bottom: 24px;
    }
    
    .brand-tagline h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .brand-tagline p {
        font-size: 14px;
    }
    
    .login-header {
        margin-bottom: 24px;
    }
    
    .login-header h3 {
        font-size: 22px;
    }
    
    .login-header p {
        font-size: 14px;
    }
    
    .login-form {
        gap: 20px;
    }
    
    .input-wrapper input {
        padding: 14px 14px 14px 42px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 48px; /* Better touch targets */
    }
    
    .login-btn {
        padding: 16px;
        font-size: 16px;
        min-height: 48px; /* Better touch targets */
    }
    
    .social-btn {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 48px; /* Better touch targets */
    }
    
    .password-toggle {
        width: 44px;
        height: 44px; /* Better touch target */
    }
    
    .feature-highlights {
        flex-direction: column;
        gap: 12px;
    }
    
    .feature-item {
        padding: 12px 16px;
    }
    
    .feature-item i {
        font-size: 18px;
    }
    
    .feature-item span {
        font-size: 14px;
    }
    
    .social-btn {
        padding: 12px 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 8px;
        padding-top: 16px;
    }
    
    .login-content {
        border-radius: 16px;
        max-width: 100%;
    }
    
    .login-branding {
        padding: 20px 16px;
    }
    
    .login-form-container {
        padding: 20px 16px;
    }
    
    .brand-logo {
        margin-bottom: 20px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .brand-logo h1 {
        font-size: 20px;
    }
    
    .brand-logo i {
        font-size: 28px;
    }
    
    .brand-tagline {
        margin-bottom: 20px;
    }
    
    .brand-tagline h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .brand-tagline p {
        font-size: 13px;
    }
    
    .login-header {
        margin-bottom: 20px;
    }
    
    .login-header h3 {
        font-size: 20px;
    }
    
    .login-header p {
        font-size: 13px;
    }
    
    .login-form {
        gap: 16px;
    }
    
    .form-group {
        gap: 6px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .input-wrapper input {
        padding: 12px 12px 12px 38px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .input-wrapper i {
        left: 12px;
        font-size: 14px;
    }
    
    .password-toggle {
        right: 12px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .checkbox-wrapper {
        gap: 6px;
    }
    
    .checkmark {
        width: 18px;
        height: 18px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
    
    .forgot-password {
        font-size: 13px;
    }
    
    .login-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .divider {
        margin: 20px 0;
    }
    
    .divider span {
        font-size: 13px;
        padding: 0 12px;
    }
    
    .social-login {
        gap: 6px;
    }
    
    .social-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .social-btn i {
        font-size: 16px;
    }
    
    .feature-highlights {
        gap: 10px;
    }
    
    .feature-item {
        padding: 10px 14px;
        gap: 10px;
    }
    
    .feature-item i {
        font-size: 16px;
        width: 20px;
    }
    
    .feature-item span {
        font-size: 13px;
    }
    
    .login-footer {
        margin-top: 24px;
        padding-top: 20px;
    }
    
    .login-footer p {
        font-size: 13px;
    }
    
    .demo-content {
        padding: 10px 12px;
        border-radius: 10px;
    }
    
    .demo-content i {
        font-size: 14px;
    }
    
    .demo-content strong {
        font-size: 13px;
    }
    
    .demo-content span {
        font-size: 12px;
    }
    
    /* Handle very small screens */
    .background-shape {
        display: none; /* Hide animated shapes on very small screens for better performance */
    }
    
    .login-branding::before {
        opacity: 0.2; /* Reduce grid opacity */
    }
}

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

/* Focus States for Accessibility */
.login-btn:focus,
.social-btn:focus,
.forgot-password:focus,
.signup-link:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}