:root {
    --auth-blue: #075ee8;
    --auth-blue-deep: #044dc5;
    --auth-ink: #0c1c35;
    --auth-muted: #69768a;
    --auth-line: #cbd8e8;
    --auth-surface: #ffffff;
}

* { box-sizing: border-box; }

html,
body.auth-portal-page {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body.auth-portal-page {
    color: var(--auth-ink);
    background: var(--auth-surface);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.auth-portal-page a { text-decoration: none; }

.auth-portal-shell {
    display: grid;
    grid-template-columns: 48.4% 51.6%;
    min-height: 100vh;
    background: #fff;
}

.auth-portal-brand-pane {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background-color: #e7f2ff;
    background-image: url("../img/portal/brand-v3/hero-light-curtain.png");
    background-repeat: no-repeat;
    background-position: 67% center;
    background-size: cover;
}

.auth-portal-brand-content {
    position: relative;
    z-index: 1;
    width: min(100% - 96px, 560px);
    margin: 0 auto;
    padding-top: clamp(210px, 27vh, 310px);
}

.auth-portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    color: var(--auth-ink);
    font-size: clamp(24px, 2.15vw, 34px);
    font-weight: 860;
    letter-spacing: -.05em;
}

.auth-portal-brand img {
    width: clamp(38px, 3vw, 48px);
    height: clamp(38px, 3vw, 48px);
    object-fit: contain;
}

.auth-portal-brand-content h1 {
    margin: 46px 0 0;
    color: var(--auth-ink);
    font-size: clamp(48px, 4.4vw, 70px);
    font-weight: 850;
    letter-spacing: -.07em;
    line-height: 1.08;
}

.auth-portal-form-pane {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 100vh;
    place-items: center;
    padding: 118px 7.4vw 72px;
    background: #fff;
}

.auth-portal-links {
    position: absolute;
    top: 42px;
    right: 5vw;
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 15px;
    font-weight: 650;
}

.auth-portal-links a { color: var(--auth-ink); }
.auth-portal-links a:hover { color: var(--auth-blue); }

.auth-portal-links i {
    width: 1px;
    height: 18px;
    background: var(--auth-line);
}

.auth-portal-form-wrap {
    width: min(100%, 580px);
    margin-top: -12px;
}

.auth-portal-form-wrap h2 {
    margin: 0 0 34px;
    color: var(--auth-ink);
    font-size: clamp(36px, 3vw, 48px);
    font-weight: 850;
    letter-spacing: -.055em;
    line-height: 1.12;
}

.auth-portal-page .auth-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
    gap: 0;
    width: 100%;
    height: auto;
    min-height: 62px;
    margin: 0 0 34px;
    padding: 3px;
    overflow: hidden;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    background: #fff;
}

.auth-portal-page .auth-mode-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 7px;
    color: #58657a;
    font-size: 15px;
    font-weight: 720;
    line-height: 1;
    text-align: center;
}

.auth-portal-page .auth-mode-switch a.is-active {
    color: #fff;
    background: var(--auth-blue);
    box-shadow: 0 8px 18px -14px rgba(7, 94, 232, .78);
}

.auth-portal-page form { margin: 0; }

.auth-portal-page .auth-field {
    margin: 0 0 24px;
}

.auth-portal-page .auth-field label {
    display: block;
    margin: 0 0 10px;
    color: var(--auth-ink);
    font-size: 15px;
    font-weight: 720;
}

.auth-portal-page .auth-input {
    width: 100%;
    height: 60px;
    padding: 0 18px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    outline: none;
    color: var(--auth-ink);
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-portal-page .auth-input::placeholder { color: #8c96a7; }

.auth-portal-page .auth-input:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(7, 94, 232, .12);
}

.auth-portal-page .password-input-wrap .auth-input {
    padding-right: 56px;
}

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

.auth-email-suffix {
    display: flex;
    align-items: center;
    min-width: 94px;
    padding: 0 16px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    color: var(--auth-muted);
    background: #f7faff;
    font-size: 14px;
    white-space: nowrap;
}

.auth-portal-page .auth-code-img {
    width: 122px;
    height: 60px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    object-fit: contain;
    background: #f7faff;
}

.auth-portal-page .primary-btn,
.auth-portal-page .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 740;
}

.auth-portal-page .primary-btn {
    color: #fff;
    background: var(--auth-blue);
}

.auth-portal-page .primary-btn:hover { background: var(--auth-blue-deep); }

.auth-portal-page .secondary-btn {
    min-width: 132px;
    height: 60px;
    border: 1px solid #b8cff0;
    color: var(--auth-blue);
    background: #f2f7ff;
}

.auth-portal-page .secondary-btn:hover {
    border-color: var(--auth-blue);
    background: #eaf3ff;
}

.auth-portal-page .auth-submit {
    width: 100%;
    min-height: 60px;
    margin-top: 8px;
    border: 0;
    box-shadow: 0 18px 34px -20px rgba(7, 94, 232, .9);
}

.auth-portal-page .auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 24px;
    font-size: 14px;
    font-weight: 650;
}

.auth-portal-page .auth-links a { color: var(--auth-blue); }
.auth-portal-page .auth-links a:hover { color: var(--auth-blue-deep); }

.auth-portal-register .auth-portal-form-pane { padding-top: 94px; padding-bottom: 42px; }
.auth-portal-register .auth-portal-form-wrap { width: min(100%, 600px); }
.auth-portal-register .auth-portal-form-wrap h2 { margin-bottom: 26px; font-size: clamp(34px, 2.5vw, 44px); }
.auth-portal-register .auth-field { margin-bottom: 16px; }
.auth-portal-register .auth-field label { margin-bottom: 7px; }
.auth-portal-register .auth-input,
.auth-portal-register .secondary-btn { height: 52px; }
.auth-portal-register .auth-submit { min-height: 54px; margin-top: 4px; }
.auth-portal-register .auth-links { margin-top: 18px; }

@media (prefers-reduced-motion: no-preference) {
    .auth-portal-brand-pane {
        animation: auth-portal-drift 16s ease-in-out infinite alternate;
    }
}

@keyframes auth-portal-drift {
    from { background-position: 64% center; }
    to { background-position: 70% center; }
}

@media (max-width: 960px) {
    .auth-portal-shell { grid-template-columns: 42% 58%; }
    .auth-portal-brand-content { width: min(100% - 52px, 420px); }
    .auth-portal-form-pane { padding-right: 6vw; padding-left: 6vw; }
    .auth-portal-links { right: 4vw; }
}

@media (max-width: 720px) {
    .auth-portal-shell {
        display: block;
        min-height: 100vh;
    }

    .auth-portal-brand-pane {
        min-height: 164px;
        background-position: 62% 58%;
    }

    .auth-portal-brand-content {
        width: calc(100% - 40px);
        padding-top: max(24px, env(safe-area-inset-top));
    }

    .auth-portal-brand { gap: 11px; font-size: 24px; }
    .auth-portal-brand img { width: 36px; height: 36px; }
    .auth-portal-brand-content h1 { margin-top: 20px; font-size: 34px; }

    .auth-portal-form-pane {
        display: block;
        min-height: auto;
        padding: 58px max(20px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    }

    .auth-portal-links {
        top: 24px;
        right: 20px;
        font-size: 13px;
    }

    .auth-portal-form-wrap { width: 100%; margin: 0; }
    .auth-portal-form-wrap h2 { margin-bottom: 26px; font-size: 36px; }
    .auth-portal-page .auth-mode-switch { margin-bottom: 26px; }
    .auth-portal-page .auth-field { margin-bottom: 20px; }
    .auth-portal-page .auth-input { height: 56px; font-size: 16px; }
    .auth-portal-page .auth-submit { min-height: 56px; }
    .auth-portal-register .auth-portal-form-pane { padding-top: 58px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
    .auth-portal-register .auth-input,
    .auth-portal-register .secondary-btn { height: 52px; }
}

@media (max-width: 420px) {
    .auth-portal-brand-pane { min-height: 146px; }
    .auth-portal-brand-content { width: calc(100% - 32px); padding-top: max(20px, env(safe-area-inset-top)); }
    .auth-portal-brand { font-size: 22px; }
    .auth-portal-brand-content h1 { margin-top: 16px; font-size: 30px; }
    .auth-portal-form-pane { padding-right: 16px; padding-left: 16px; }
    .auth-portal-page .auth-code-row { grid-template-columns: minmax(0, 1fr) 116px; }
    .auth-email-suffix { min-width: 0; padding: 0 10px; }
    .auth-portal-page .secondary-btn { min-width: 0; padding: 0 10px; }
    .auth-portal-page .auth-links { gap: 14px; font-size: 13px; }
}
