/**
 * PMODVN Login Page Styles
 * Modern Professional Login Interface with Theme Support
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --login-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --login-transition-fast: all 0.15s ease;
    --login-bg-gradient: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    --login-card-bg: rgba(31, 41, 55, 0.95);
    --login-input-bg: rgba(55, 65, 81, 0.9);
    --login-input-border: #4b5563;
    --login-text-primary: #f9fafb;
    --login-text-secondary: #d1d5db;
    --login-text-muted: #9ca3af;
    --login-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --login-input-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --login-button-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
}

[data-theme="light"] {
    --login-bg-gradient: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    --login-card-bg: #ffffff;
    --login-input-bg: #ffffff;
    --login-input-border: #e5e7eb;
    --login-text-primary: #111827;
    --login-text-secondary: #374151;
    --login-text-muted: #6b7280;
    --login-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    --login-input-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --login-button-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--login-bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    line-height: 1.6;
    color: var(--login-text-primary);
    transition: var(--login-transition);
}

.login-container {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.login-card {
    background: var(--login-card-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--login-card-shadow);
    border: 1px solid var(--login-input-border);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 20px 20px 0 0;
}

.theme-toggle-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.theme-toggle-container button {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--login-text-primary);
    transition: var(--login-transition-fast);
}

.theme-toggle-container button:hover {
    background: rgba(245, 158, 11, 0.1);
}

.theme-toggle-container button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.logo-section {
    text-align: center;
    margin-bottom: 1.75rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--login-text-secondary);
    font-size: 0.875rem;
}

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


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

.input-wrapper .form-input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.password-toggle:hover {
    background-color: rgba(245, 158, 11, 0.1);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--login-text-muted);
    transition: fill 0.2s ease;
}

.password-toggle:hover svg {
    fill: var(--login-text-secondary);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--login-text-secondary);
}

.checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
}

.login-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--login-transition);
    box-shadow: var(--login-button-shadow);
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

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

.button-loading {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    color: var(--login-text-muted);
    font-size: 0.875rem;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--login-input-border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-links {
    text-align: center;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.auth-links-separator {
    color: var(--login-text-muted);
}

.developer-credit {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--login-input-border);
    font-size: 0.75rem;
    color: var(--login-text-muted);
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

[data-theme="light"] .alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-input.required-hint {
    border-color: var(--warning-color) !important;
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    .login-title { font-size: 1.5rem; }
    .logo-img { width: 50px; height: 50px; }
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.strength-weak { color: #ef4444; }
.strength-medium { color: #f59e0b; }
.strength-strong { color: #10b981; }

[data-theme="light"] .strength-weak { color: #dc2626; }
[data-theme="light"] .strength-medium { color: #d97706; }
[data-theme="light"] .strength-strong { color: #059669; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--login-text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--login-input-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--login-transition);
    background: var(--login-input-bg);
    color: var(--login-text-primary);
    box-shadow: var(--login-input-shadow);
}

.form-input::placeholder {
    color: var(--login-text-muted);
    opacity: 0.7;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.form-input:hover {
    border-color: var(--primary-color);
}

