*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding: 1rem;
}
.login-wrapper {
    width: 100%;
    max-width: 400px;
}
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #0f172a;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.login-logo-icon i { color: #818cf8; font-size: 1.5rem; }
.login-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
}
.login-logo p {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.login-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 2rem;
}
.login-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.375rem;
}
.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.form-input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
.form-input::placeholder { color: #94a3b8; }
.form-input-icon {
    position: relative;
}
.form-input-icon .form-input { padding-left: 2.5rem; }
.form-input-icon i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #4f46e5;
    cursor: pointer;
}
.form-check label {
    font-size: 0.8125rem;
    color: #64748b;
    cursor: pointer;
}
.btn-login {
    width: 100%;
    padding: 0.625rem 1rem;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}
.btn-login:hover { background: #4338ca; }
.btn-login:active { background: #3730a3; }
.btn-login:disabled { opacity: 0.65; cursor: not-allowed; }
.login-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #b91c1c;
}
.form-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

@media (prefers-reduced-motion: reduce) {
    .login-spinner { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
    .form-input { transition: none; }
    .btn-login { transition: none; }
}
