/* ========================================
   LOGIN PAGE STYLES - UNIFIED THEME
   Matching Dashboard Design System
   ======================================== */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-main: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    min-height: 600px;
}

/* Left Panel - Branding */
.login-left {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    padding: 60px 48px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.branding {
    margin-bottom: 48px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 48px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
    font-weight: 400;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.feature-icon {
    font-size: 32px;
    flex-shrink: 0;
    opacity: 0.95;
}

.feature-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
}

.feature-text p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
}

/* Right Panel - Login Form */
.login-right {
    padding: 60px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.form-header {
    margin-bottom: 32px;
    text-align: center;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.form-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.label-icon {
    font-size: 16px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.btn-toggle-password:hover {
    background: var(--bg-main);
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Footer */
.form-footer {
    margin-top: 32px;
    text-align: center;
}

.footer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.separator {
    color: var(--text-light);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: white;
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

#loadingMessage {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

.modal-small {
    max-width: 500px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 12px 0;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body ul {
    margin: 0 0 16px 20px;
    padding: 0;
}

.modal-body ul li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.modal-body p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.modal-body a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.modal-body a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-main);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-main);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Select Dropdown */
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Responsive */
@media (max-width: 968px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 48px 40px;
    }

    body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .login-right {
        padding: 32px 24px;
    }

    .form-header h2 {
        font-size: 24px;
    }

    .btn-login {
        padding: 12px 20px;
        font-size: 15px;
    }

    .login-form-container {
        max-width: 100%;
    }
}

/* Additional Utilities */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
