:root {
    --ink: #15111f;
    --muted: #5f6472;
    --line: #e7e2f2;
    --paper: #fffdf8;
    --soft: #f7f2ff;
    --primary: #6d28d9;
    --primary-strong: #4c1d95;
    --green: #16a34a;
    --danger: #b42318;
    --success: #15803d;
    --shadow: 0 18px 45px rgba(45, 27, 84, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--paper);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 12%, rgba(109, 40, 217, 0.09), transparent 32rem),
        radial-gradient(circle at 92% 88%, rgba(22, 163, 74, 0.07), transparent 28rem),
        var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.auth-nav,
.auth-footer {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.auth-nav {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-strong);
    font-weight: 800;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(109, 40, 217, 0.25);
}

.brand-mark svg,
.nav-action svg,
.auth-primary svg,
.auth-link svg,
.feature-item svg {
    width: 20px;
    height: 20px;
}

.nav-action {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    color: var(--primary-strong);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 750;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-action:hover,
.nav-action:focus-visible {
    color: var(--primary-strong);
    background: #f5efff;
    border-color: #d8c5ff;
    box-shadow: 0 8px 20px rgba(76, 29, 149, 0.08);
    outline: none;
}

.auth-main {
    width: min(1120px, calc(100% - 32px));
    margin: auto;
    padding: 34px 0 46px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(420px, 0.72fr);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.auth-intro {
    position: relative;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(36px, 5vw, 64px);
    color: #fff;
    background: var(--primary-strong);
}

.auth-intro::before,
.auth-intro::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    pointer-events: none;
}

.auth-intro::before {
    width: 360px;
    height: 360px;
    top: -180px;
    right: -120px;
}

.auth-intro::after {
    width: 240px;
    height: 240px;
    right: 40px;
    bottom: -150px;
}

.intro-content,
.feature-list {
    position: relative;
    z-index: 1;
}

.eyebrow {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: #ede9fe;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 750;
}

.intro-title {
    max-width: 520px;
    margin: 20px 0 14px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.intro-copy {
    max-width: 520px;
    margin: 0;
    color: #ddd6fe;
    font-size: 17px;
}

.feature-list {
    display: grid;
    gap: 12px;
    margin-top: 38px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f5f3ff;
    font-weight: 650;
}

.feature-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    color: #bbf7d0;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
}

.auth-panel {
    display: flex;
    align-items: center;
    padding: clamp(32px, 5vw, 58px);
}

.auth-form {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.form-heading {
    margin-bottom: 28px;
}

.form-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.2;
}

.form-heading p {
    margin: 0;
    color: var(--muted);
}

.form-fields {
    display: grid;
    gap: 17px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #3f3a49;
    font-size: 14px;
    font-weight: 720;
}

.form-group input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #d8d1e6;
    border-radius: 8px;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.form-group input::placeholder {
    color: #8a8495;
}

.form-group input:hover {
    border-color: #bcaed5;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.14);
}

.field-help {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.auth-primary {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 22px;
    padding: 0 18px;
    color: #fff;
    background: var(--green);
    border: 1px solid var(--green);
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(22, 163, 74, 0.22);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.auth-primary:hover,
.auth-primary:focus-visible {
    transform: translateY(-1px);
    filter: brightness(0.96);
    box-shadow: 0 16px 32px rgba(22, 163, 74, 0.28);
    outline: none;
}

.auth-primary:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

.form-message {
    display: none;
    margin: 14px 0 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
}

.form-message.is-error {
    display: block;
    color: var(--danger);
    background: #fff1f0;
    border-color: #fecaca;
}

.form-message.is-success {
    display: block;
    color: var(--success);
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.form-switch {
    margin: 22px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-weight: 750;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: color 180ms ease, text-decoration-color 180ms ease;
}

.auth-link:hover,
.auth-link:focus-visible {
    color: var(--primary-strong);
    text-decoration-color: currentColor;
    outline: none;
}

.auth-footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
}

.auth-footer a:hover,
.auth-footer a:focus-visible {
    color: var(--primary-strong);
    outline: none;
}

@media (max-width: 820px) {
    .auth-main {
        padding-top: 16px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-intro {
        min-height: auto;
        padding: 32px;
    }

    .intro-title {
        max-width: 640px;
        font-size: clamp(30px, 7vw, 46px);
    }

    .intro-copy {
        max-width: 640px;
    }

    .feature-list {
        grid-template-columns: repeat(3, 1fr);
        margin-top: 28px;
    }

    .feature-item {
        align-items: flex-start;
        font-size: 14px;
    }

    .auth-panel {
        padding: 38px 32px;
    }
}

@media (max-width: 600px) {
    .auth-nav,
    .auth-main,
    .auth-footer {
        width: min(100% - 24px, 1120px);
    }

    .brand > span:last-child {
        display: none;
    }

    .auth-intro {
        padding: 28px 22px;
    }

    .intro-copy {
        font-size: 16px;
    }

    .feature-list {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .feature-icon {
        width: 34px;
        height: 34px;
    }

    .auth-panel {
        padding: 32px 22px 36px;
    }

    .form-heading {
        margin-bottom: 24px;
    }

    .auth-footer {
        justify-content: center;
    }

    .auth-footer span:last-child {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
