﻿:root {
    --auth-bg-start: #4f46e5;
    --auth-bg-end: #7c3aed;
    --auth-panel-tint: rgba(255, 255, 255, 0.14);
    --auth-card-bg: rgba(255, 255, 255, 0.96);
    --auth-card-border: rgba(255, 255, 255, 0.32);
    --auth-text-primary: #1f2546;
    --auth-text-secondary: #5a6287;
    --auth-accent: #22d3ee;
    --auth-shadow: 0 32px 60px rgba(31, 38, 135, 0.28);
    --auth-radius-lg: 28px;
    --auth-radius-sm: 14px;
}

/* 重置body样式以确保全屏背景 */
body {
    margin: 0;
    padding: 0;
    background: none;
}

.auth-wrapper {
    min-height: 100vh;
    width: 100vw;
    display: grid;
    grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(32px, 6vw, 88px);
    padding: clamp(32px, 6vw, 72px);
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 55%),
                radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.12), transparent 50%),
                linear-gradient(135deg, var(--auth-bg-start), var(--auth-bg-end));
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 160"><g fill="rgba(255,255,255,0.12)"><circle cx="20" cy="20" r="1.5"/><circle cx="90" cy="60" r="1.2"/><circle cx="140" cy="120" r="2"/></g></svg>');
    opacity: 0.35;
    pointer-events: none;
}

.auth-card,
.auth-hero {
    position: relative;
    z-index: 1;
    max-width: 1420px;
    margin: 0 auto;
}

.auth-wrapper {
    display: block;
}

.auth-wrapper .auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: clamp(40px, 8vw, 120px);
    padding: clamp(40px, 8vw, 80px);
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 1vh;
    padding-bottom: 16vh;
}

.auth-card {
    grid-column: 1;
    justify-self: end;
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius-lg);
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-shadow);
    padding: clamp(36px, 5vw, 56px);
    display: flex;
    flex-direction: column;
    gap: 26px;
    width: min(480px, 100%);
    max-width: 480px;
}

.auth-card__header h2 {
    margin: 0;
    font-size: 2.15rem;
    font-weight: 700;
    color: var(--auth-text-primary);
}

.auth-card__header p {
    margin: 0.4rem 0 0;
    color: var(--auth-text-secondary);
    font-size: 0.96rem;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0.95rem 1.1rem;
    border-radius: var(--auth-radius-sm);
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease-out;
}

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

.auth-alert i.material-icons {
    font-size: 22px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.form-field input {
    width: 100%;
    padding: 1.05rem 1.2rem;
    border-radius: 18px;
    border: 1.8px solid #dfe4fb;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--auth-text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.form-field input::placeholder {
    color: transparent;
}

.form-field label {
    position: absolute;
    left: 1.2rem;
    top: 1.15rem;
    padding: 0 0.45rem;
    background: #fff;
    color: #8690b5;
    font-size: 0.98rem;
    transition: transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
    pointer-events: none;
}

.form-field input:focus,
.form-field input:not(:placeholder-shown) {
    border-color: var(--auth-bg-end);
    box-shadow: 0 14px 32px rgba(147, 51, 234, 0.18);
    transform: translateY(-1px);
}

.form-field input:focus + label,
.form-field input:not(:placeholder-shown) + label {
    transform: translateY(-0.7rem);
    font-size: 0.8rem;
    color: var(--auth-bg-end);
    font-weight: 600;
}

.form-field--with-meter {
    gap: 0.55rem;
}

.form-meter {
    height: 5px;
    background: #e6ebff;
    border-radius: 999px;
    overflow: hidden;
}

.form-meter__bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.3s ease, background 0.3s ease;
}

.form-meter__bar.is-weak { background: linear-gradient(135deg, #fca5a5, #f97316); }
.form-meter__bar.is-medium { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.form-meter__bar.is-strong { background: linear-gradient(135deg, #34d399, #10b981); }

.form-tip {
    font-size: 0.82rem;
    color: var(--auth-text-secondary);
    line-height: 1.5;
}

.form-extras {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.form-checkbox {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.form-checkbox input {
    position: absolute;
    opacity: 0;
}

.form-checkbox__decor {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.6px solid #d7dcfa;
    display: grid;
    place-items: center;
    background: transparent;
    color: white;
    transition: all 0.2s ease;
}

.form-checkbox input:checked + .form-checkbox__decor {
    background: var(--auth-bg-end);
    border-color: var(--auth-bg-end);
}

.form-checkbox__decor i.material-icons {
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-checkbox input:checked + .form-checkbox__decor i.material-icons {
    opacity: 1;
}

.form-checkbox__label {
    color: var(--auth-text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.form-link {
    color: var(--auth-bg-end);
    text-decoration: none;
    font-weight: 600;
    position: relative;
}

.form-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.form-link:hover::after {
    transform: scaleX(1);
}

.form-button {
    width: 100%;
    border: none;
    border-radius: 20px;
    padding: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--auth-bg-end), var(--auth-bg-start));
    color: white;
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 22px 44px rgba(147, 51, 234, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 26px 50px rgba(147, 51, 234, 0.36);
}

.form-button.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.form-button.is-loading .form-button__label::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.6rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #fff;
    animation: spin 0.9s linear infinite;
}

.form-field input.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
    animation: shake 0.3s ease-in-out;
}

.form-field input.is-valid {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.auth-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--auth-text-secondary);
}

.auth-footer a {
    color: var(--auth-bg-end);
    text-decoration: none;
    font-weight: 600;
}

.auth-hero {
    grid-column: 2;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-inline: 0;
}

.auth-hero__card {
    max-width: 520px;
    width: min(100%, 520px);
    padding: clamp(32px, 5vw, 48px);
    border-radius: var(--auth-radius-lg);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(26px);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    box-shadow:
        0 25px 50px rgba(20, 20, 43, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.auth-hero__card h1 {
    margin-top: 0;
}

.auth-hero__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%);
}

.auth-hero__badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.auth-hero__title {
    font-size: clamp(2.2rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-hero__subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0 0 32px 0;
    opacity: 0.9;
    font-weight: 400;
}

.auth-hero__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.auth-hero__list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--auth-radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.auth-hero__list li:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.auth-hero__list i.material-icons {
    font-size: 20px;
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.auth-hero__footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    opacity: 0.7;
    text-align: center;
}

.auth-hero__list span {
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.95;
}

.auth-hero__footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    opacity: 0.7;
    text-align: center;
}


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

@media (max-width: 1024px) {
    .auth-wrapper .auth-grid {
        grid-template-columns: 1fr;
        gap: clamp(32px, 6vw, 60px);
        padding: clamp(32px, 6vw, 60px);
        text-align: center;
        padding-top: 1.5vh;
        padding-bottom: 10vh;
    }

    .auth-card {
        justify-self: center;
        width: min(500px, 100%);
        max-width: 500px;
    }

    .auth-hero {
        grid-column: 1;
        justify-content: center;
        order: -1;
    }

    .auth-hero__card {
        padding: 28px;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .auth-wrapper .auth-grid {
        padding: 24px 20px;
        gap: 24px;
        padding-top: 1vh;
        padding-bottom: 8vh;
    }

    .auth-card {
        padding: 30px 22px;
    }

    .auth-hero__card {
        padding: 24px;
    }
}
