:root {
    --auth-bg: #eef5ff;
    --auth-surface: rgba(255, 255, 255, 0.84);
    --auth-surface-strong: rgba(255, 255, 255, 0.94);
    --auth-ink: #13213d;
    --auth-muted: #6d7690;
    --auth-line: rgba(157, 177, 219, 0.3);
    --auth-blue: #3267ff;
    --auth-blue-deep: #244fe0;
    --auth-cyan: #43d3e9;
    --auth-violet: #9b59f4;
    --auth-green: #14b86d;
    --auth-orange: #f59a3d;
    --auth-red: #e25555;
    --auth-shadow: 0 28px 90px rgba(56, 83, 172, 0.18);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-ink);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at 18% 14%, rgba(76, 123, 255, 0.22), transparent 26%),
        radial-gradient(circle at 88% 10%, rgba(154, 84, 242, 0.14), transparent 22%),
        linear-gradient(135deg, #f6fbff 0%, #edf4ff 46%, #f8f5ff 100%);
}
button, input { font: inherit; }
a { color: inherit; }

.auth-shell {
    width: min(1380px, 100%);
    min-height: 820px;
    display: grid;
    grid-template-columns: minmax(440px, 0.92fr) minmax(0, 1.08fr);
    grid-template-areas: "panel visual";
    overflow: hidden;
    border: 1px solid rgba(209, 220, 244, 0.8);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(20px);
}

.auth-panel {
    grid-area: panel;
    padding: 46px 44px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.96));
    border-right: 1px solid rgba(210, 221, 242, 0.8);
}

.auth-panel-inner {
    width: 100%;
    max-width: 460px;
}

.auth-page-register .auth-panel-inner { max-width: 520px; }

.auth-visual {
    grid-area: visual;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, #f1f7ff 0%, #deebff 38%, #edf1ff 72%, #f8fbff 100%);
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 38%, rgba(255, 255, 255, 0.58), transparent 16%),
        radial-gradient(circle at 80% 56%, rgba(80, 133, 255, 0.16), transparent 20%),
        radial-gradient(circle at 34% 88%, rgba(103, 85, 246, 0.08), transparent 24%);
    pointer-events: none;
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(249, 252, 255, 0.84) 0%, rgba(249, 252, 255, 0.18) 34%, rgba(249, 252, 255, 0.02) 50%),
        url('images/auth-hero-cloud-ai.png') right center / cover no-repeat;
    transform: scale(1.02);
    pointer-events: none;
}

.auth-brand,
.visual-copy,
.visual-board { display: none; }

.auth-switch {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    margin-bottom: 26px;
    border: 1px solid rgba(198, 210, 235, 0.8);
    border-radius: 16px;
    background: rgba(243, 247, 255, 0.88);
}

.auth-switch-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #66718c;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.auth-switch-link:hover,
.auth-switch-link.is-active {
    color: #2147da;
    background: #fff;
    box-shadow: 0 12px 26px rgba(30, 54, 125, 0.08);
}

.form-header { margin-bottom: 26px; }
.form-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border: 1px solid rgba(50, 103, 255, 0.16);
    border-radius: 999px;
    color: var(--auth-blue);
    background: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
}

.form-header h2 {
    margin: 16px 0 8px;
    color: #10182f;
    font-size: 31px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.form-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.7;
}

.auth-alert {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-alert-success {
    border: 1px solid rgba(20, 184, 109, 0.16);
    color: #15803d;
    background: #effcf5;
}

.auth-alert-error {
    border: 1px solid rgba(226, 85, 85, 0.18);
    color: #bf1f1f;
    background: #fff2f2;
}

.alert-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.auth-alert-success .alert-icon { background: var(--auth-green); }
.auth-alert-error .alert-icon { background: var(--auth-red); }

.auth-form {
    display: grid;
    gap: 18px;
}

.register-form { gap: 16px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    color: #33405d;
    font-size: 13px;
    font-weight: 700;
}

.required { color: var(--auth-red); }

.input-wrap {
    position: relative;
    min-width: 0;
}

.input-wrap > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    fill: none;
    stroke: #8a97ae;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    pointer-events: none;
}

.form-control {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    border: 1px solid rgba(197, 209, 230, 0.95);
    border-radius: 14px;
    outline: none;
    color: #14213b;
    background: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}

.form-control.has-action { padding-right: 48px; }

.form-control::placeholder { color: #a0abc0; }

.form-control:focus {
    border-color: rgba(50, 103, 255, 0.72);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(50, 103, 255, 0.12);
}

.form-hint {
    min-height: 17px;
    color: #7b8798;
    font-size: 12px;
    line-height: 1.45;
}

.form-hint.is-error { color: var(--auth-red); }
.form-hint.is-success { color: var(--auth-green); }

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #6e7890;
    background: transparent;
    cursor: pointer;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--auth-blue);
    border-color: rgba(50, 103, 255, 0.14);
    background: rgba(50, 103, 255, 0.08);
}

.icon-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.password-toggle {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }

.captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 46px;
    gap: 10px;
    align-items: center;
}

.captcha-image-button {
    height: 50px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(197, 209, 230, 0.95);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}

.captcha-image-button:hover,
.captcha-image-button:focus-visible {
    border-color: rgba(50, 103, 255, 0.72);
    box-shadow: 0 0 0 4px rgba(50, 103, 255, 0.1);
}

.captcha-image-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.captcha-refresh {
    width: 46px;
    height: 50px;
    border-color: rgba(197, 209, 230, 0.95);
    background: rgba(255, 255, 255, 0.86);
}

.code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 10px;
}

.code-button,
.auth-submit {
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}

.code-button {
    min-height: 50px;
    padding: 0 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-violet), var(--auth-blue));
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(91, 94, 233, 0.18);
}

.code-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #8a4fe8, #2d63eb);
}

.code-button:disabled {
    cursor: not-allowed;
    opacity: .64;
}

.auth-submit {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-violet) 0%, var(--auth-blue) 100%);
    box-shadow: 0 16px 32px rgba(64, 94, 222, 0.25);
    font-size: 15px;
}

.auth-submit:hover,
.auth-submit:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 20px 38px rgba(64, 94, 222, 0.3);
}

.auth-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.auth-benefits {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.auth-benefit {
    padding: 16px 14px;
    border: 1px solid rgba(204, 214, 236, 0.8);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 24px rgba(33, 61, 141, 0.06);
}

.auth-benefit i {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-blue), var(--auth-cyan));
    margin-bottom: 10px;
}

.auth-benefit strong {
    display: block;
    margin-bottom: 4px;
    color: #13213d;
    font-size: 13px;
}

.auth-benefit span {
    color: #8a92a6;
    font-size: 12px;
    line-height: 1.55;
}

.auth-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(209, 220, 240, 0.8);
    text-align: center;
}

.auth-footer p {
    margin: 0;
    color: #677086;
    font-size: 14px;
}

.auth-footer a {
    color: var(--auth-blue);
    font-weight: 800;
    text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

.back-home {
    display: inline-flex;
    margin-top: 12px;
    color: #6e7893;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 1100px) {
    body.auth-page { padding: 18px; }
    .auth-shell {
        min-height: auto;
        grid-template-columns: 1fr;
        grid-template-areas:
            "panel"
            "visual";
    }
    .auth-panel {
        border-right: 0;
        border-bottom: 1px solid rgba(210, 221, 242, 0.8);
    }
    .auth-visual { min-height: 420px; }
}

@media (max-width: 720px) {
    body.auth-page {
        padding: 12px;
        align-items: stretch;
    }

    .auth-shell {
        width: 100%;
        border-radius: 22px;
    }

    .auth-panel {
        padding: 30px 20px 28px;
    }

    .form-header h2 {
        font-size: 26px;
    }

    .form-grid,
    .captcha-row,
    .code-row,
    .auth-benefits {
        grid-template-columns: 1fr;
    }

    .captcha-image-button,
    .captcha-refresh {
        width: 100%;
    }

    .auth-visual {
        min-height: 300px;
    }
}

@media (max-width: 460px) {
    .auth-panel {
        padding: 24px 16px 24px;
    }

    .auth-visual {
        min-height: 260px;
    }

    .auth-benefit {
        padding: 14px 12px;
    }
}
