* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
}
.login-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100vh;
    position: relative;
    background: #1a1a2e;
}
.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    transition: background 0.8s ease, background-image 0.8s ease;
    z-index: 0;
}
.bg-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
}
.login-card {
    position: relative;
    z-index: 1;
    width: 420px;
    margin-right: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    animation: slideIn 0.6s ease-out;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.logo-icon { font-size: 36px; }
.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 1px;
}
.login-header .subtitle {
    color: #888;
    font-size: 14px;
    margin-top: 6px;
    letter-spacing: 2px;
}
.input-group {
    margin-bottom: 20px;
}
.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}
.input-wrapper {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}
.input-wrapper:focus-within {
    border-color: #4a6cf7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74, 108, 247, 0.1);
}
.input-icon {
    padding: 0 12px 0 16px;
    font-size: 18px;
    color: #aaa;
    user-select: none;
}
.input-wrapper input {
    flex: 1;
    padding: 14px 16px 14px 0;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
}
.input-wrapper input::placeholder { color: #bbb; }
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4a6cf7, #6a3de8);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    letter-spacing: 2px;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 108, 247, 0.35);
}
.login-btn:active { transform: translateY(0); }
.register-btn {
    background: linear-gradient(135deg, #00b894, #00a381);
}
.register-btn:hover {
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.35);
}
.login-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #888;
}
.login-footer a {
    color: #4a6cf7;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.login-footer a:hover { text-decoration: underline; }
.register-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.error-msg {
    background: #fee;
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.error-msg.show { display: block; }
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.loading-spinner {
    position: relative;
    width: 100px;
    height: 100px;
}
.loading-circle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #4a6cf7, #6a3de8);
    border-radius: 50%;
    animation: loadingOrbit 2s ease-in-out infinite;
}
@keyframes loadingOrbit {
    0% {
        transform: rotate(0deg) translateX(40px) rotate(0deg);
        opacity: 1;
        box-shadow: 0 0 10px rgba(74, 108, 247, 0.8);
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 20px rgba(74, 108, 247, 0.4);
    }
    100% {
        transform: rotate(360deg) translateX(40px) rotate(-360deg);
        opacity: 1;
        box-shadow: 0 0 10px rgba(74, 108, 247, 0.8);
    }
}
.loading-text {
    margin-top: 30px;
    color: #fff;
    font-size: 16px;
    letter-spacing: 2px;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .login-container { justify-content: center; padding: 20px; }
    .login-card {
        width: 100%;
        max-width: 400px;
        margin-right: 0;
        padding: 32px 24px;
    }
}
