/**
 * Modern Login Page - Following 4 Design Principles
 * 1. INTUITIV: Clear visual hierarchy, obvious interactions
 * 2. STRATEGISCH: Security-focused, performance-optimized
 * 3. SCHÖN: Modern gradient design, smooth animations
 * 4. EMPATHISCH: Helpful feedback, accessible, user-friendly
 */

/* === LAYOUT & CONTAINER === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

/* Animated Background Particles */
.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

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

/* === LOGIN CARD === */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

/* === HEADER === */
.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    text-align: center;
    color: #fff;
}

.login-logo {
    width: 110px;
    height: 110px;
    margin: 0 auto 20px;
    background: rgba(0, 0, 0, 1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    backdrop-filter: blur(10px);
    animation: pulse 5s ease-in-out infinite;
    padding: 5px;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

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

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* === FORM BODY === */
.login-body {
    padding: 40px 30px;
}

/* === FORM GROUPS === */
.form-group-modern {
    margin-bottom: 24px;
    position: relative;
}

.form-label-modern {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 8px;
}

.form-label-modern .required {
    color: #dc3545;
    margin-left: 2px;
}

/* === INPUT FIELDS === */
.input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 18px;
    color: #98a2b3;
    font-size: 18px;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 1;
}

.input-wrapper .form-control {
    padding-left: 48px;
}

.input-wrapper .form-control:focus ~ .input-icon {
    color: #667eea;
}

.form-control-modern {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    border: 2px solid #e4e7ec;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #fff;
    color: #344054;
}

.form-control-modern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

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

.form-control-modern.error {
    border-color: #dc3545;
}

.form-control-modern.error:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

/* === PASSWORD TOGGLE === */
.password-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 10px;
    background: none;
    border: none;
    color: #98a2b3;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    transition: color 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #667eea;
}

.password-toggle:focus {
    outline: none;
    color: #667eea;
}

/* === CHECKBOX === */
.checkbox-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.checkbox-modern input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #e4e7ec;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-modern input[type="checkbox"]:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.checkbox-modern label {
    font-size: 14px;
    color: #475467;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* === BUTTONS === */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

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

.btn-login .btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.btn-login .btn-spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

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

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

/* Spinner Animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === LINKS === */
.login-links {
    margin-top: 20px;
    text-align: center;
}

.login-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* === ALERTS === */
.alert-modern {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: start;
    gap: 12px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

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

.alert-modern.error {
    background: #fee;
    color: #dc3545;
    border: 1px solid #fcc;
}

.alert-modern.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-modern .alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-modern .alert-message {
    flex: 1;
}

/* === FOOTER === */
.login-footer {
    padding: 20px 30px;
    background: #f9fafb;
    text-align: center;
    border-top: 1px solid #e4e7ec;
}

.login-footer-text {
    font-size: 13px;
    color: #667085;
    margin: 0;
}

/* === RESPONSIVE === */
@media (max-width: 576px) {
    .login-container {
        padding: 10px;
    }
    
    .login-header {
        padding: 30px 20px;
    }
    
    .login-body {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid #000;
    }
    
    .form-control-modern {
        border-width: 3px;
    }
}

/* === FOCUS VISIBLE === */
.form-control-modern:focus-visible,
.btn-login:focus-visible,
.password-toggle:focus-visible,
.login-link:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}
