/* =========================
   LOGIN PAGE STYLES - CLEAN
========================= */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Login Container */
.login-container {
    max-width: 400px;
    width: 100%;
    margin: 20px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    border: 2px solid #4d90fe;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Logo Container */
.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 8px;
}

.logo-fallback {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #4d90fe 0%, #357ae8 100%);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.logo-container h2 {
    color: #333;
    font-size: 1.8rem;
    margin: 5px 0;
    font-weight: 700;
    line-height: 1.2;
}

/* Alert Messages */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid transparent;
    animation: fadeIn 0.3s ease;
}

.alert-error {
    border: 1px solid #e74c3c;
    border-radius: 4px;
    color: #c53030;
    background: linear-gradient(to right, #fff5f5, white);
}

.alert-icon {
    background: #e74c3c;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Form Elements */
.auth-form {
    margin-bottom: 15px;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #444;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.label-icon {
    font-size: 1rem;
    opacity: 0.8;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.4;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #4d90fe;
    box-shadow: 0 0 0 3px rgba(77, 144, 254, 0.15);
    outline: none;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 45px;
}

.eye-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    z-index: 2;
}

.eye-toggle:hover {
    color: #333;
    transform: scale(1.1);
}

/* Password Requirements */
.password-requirements {
    margin: 10px 0 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 70px;
    transition: all 0.3s ease;
}

.requirements-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.requirements-list {
    list-style: none;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #718096;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
    max-height: 24px;
    overflow: hidden;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.requirement-item.hidden {
    opacity: 0;
    transform: translateX(-10px);
    max-height: 0;
    margin-bottom: 0;
}

.requirement-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.requirement-item.valid .requirement-icon {
    background: #48bb78;
}

.requirement-item.valid.hidden .requirement-icon {
    background: #48bb78;
}

.requirement-text {
    line-height: 1.4;
    transition: color 0.3s ease;
}

.requirement-item.valid .requirement-text {
    color: #48bb78;
}

/* Login Button Container */
.login-button-container {
    margin: 20px 0 15px 0;
}

/* Button Styles */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4d90fe 0%, #357ae8 100%);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #357ae8 0%, #2a65c4 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(77, 144, 254, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(77, 144, 254, 0.3);
}

/* Language Selector */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.lang-link {
    color: #4d90fe;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-link:hover {
    background: #f0f7ff;
    text-decoration: underline;
}

.lang-link.active {
    background: #4d90fe;
    color: white;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes slideOut {
    from { 
        opacity: 1;
        transform: translateX(0);
        max-height: 24px;
        margin-bottom: 8px;
    }
    to { 
        opacity: 0;
        transform: translateX(-10px);
        max-height: 0;
        margin-bottom: 0;
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* Progress Bar (Optional) */
.progress-container {
    margin: 10px 0;
    display: none;
}

.progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #48bb78;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Requirements Counter */
.requirements-counter {
    font-size: 0.75rem;
    color: #718096;
    text-align: right;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.counter-text {
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        margin: 15px;
        padding: 25px;
    }
    
    body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 10px;
        padding: 20px;
    }
    
    .login-logo,
    .logo-fallback {
        width: 60px;
        height: 60px;
    }
    
    .logo-fallback {
        font-size: 1.5rem;
    }
    
    .logo-container h2 {
        font-size: 1.5rem;
    }
    
    .password-requirements {
        padding: 12px;
    }
}

/* Authentication pages: on small screens, show only the form panel. */
@media (max-width: 900px) {
    body.login-page,
    body.register-page {
        background: #f5f9ff !important;
    }

    .login-shell,
    .register-shell {
        display: block !important;
        min-height: 100vh;
    }

    .login-brand,
    .register-brand {
        display: none !important;
    }

    .login-panel,
    .register-panel {
        width: 100%;
        min-height: 100vh;
    }
}

/* Keep one password visibility control in browsers that add their own. */
.password-wrapper input::-ms-reveal,
.password-wrapper input::-ms-clear { display: none; }
