@font-face {
    font-family: 'AlibabaPuHuiTi';
    src: url('/AlibabaPuHuiTi-3-55-RegularL3.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f6f6f9;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #5e6ad2 0%, #7c6dd8 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(94, 106, 210, 0.3);
}

.brand-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1a1a2e;
}

.brand-header p {
    color: #8a8a9a;
    font-size: 0.875rem;
    margin-top: 0.4rem;
}

.login-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 2rem;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.03);
}

.alert-error {
    background: #fff4f4;
    border: 1px solid #fdd;
    color: #c53030;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error::before {
    content: '⚠';
    font-size: 0.9rem;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success::before {
    content: '✓';
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4a4a5a;
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    color: #1a1a2e;
    background: #fafafe;
    transition: all 0.15s ease;
    outline: none;
}

.form-group input::placeholder {
    color: #b0b0be;
}

.form-group input:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.form-group input:focus {
    border-color: #5e6ad2;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.1);
}

.btn-login {
    width: 100%;
    padding: 0.65rem 1rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #5e6ad2 0%, #6c6dd8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(94, 106, 210, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    box-shadow: 0 2px 8px rgba(94, 106, 210, 0.4);
    transform: translateY(-0.5px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(94, 106, 210, 0.2);
}

.btn-login.loading {
    pointer-events: none;
    opacity: 0.75;
    cursor: not-allowed;
}

/* Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}

.btn-login.loading .spinner {
    display: inline-block;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loading-text {
    display: inline;
}

.btn-loading-text {
    display: none;
}

.footer-note {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #b0b0be;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.footer-note a {
    display: inline-flex;
    align-items: center;
    color: #9a9aae;
    transition: color 0.15s ease;
}

.footer-note a:hover {
    color: #5e6ad2;
}
