/* ==========================================================================
   sign.css —— 登录 / 注册页：左右分栏、表单控件、密码强度、校验状态
   ========================================================================== */

body.page-auth {
    min-height: 100dvh;
    background: #fff;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
    min-height: 100dvh;
}

/* ---------------- 左侧视觉区 ---------------- */
.auth-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(28px, 4vw, 48px);
    background: linear-gradient(160deg, #f7fbff, #e8f1fd 58%, #d9e7f8);
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url("../images/decor/seigaiha.svg") repeat;
    background-size: 160px 80px;
    opacity: 0.4;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 72%);
    mask-image: linear-gradient(180deg, #000, transparent 72%);
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(100deg,
            rgba(247, 251, 255, 0.96) 0%,
            rgba(247, 251, 255, 0.86) 32%,
            rgba(247, 251, 255, 0.2) 58%,
            rgba(247, 251, 255, 0) 78%);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 3;
    align-self: flex-start;
}

.auth-visual-copy {
    position: relative;
    z-index: 3;
    max-width: 380px;
    margin-top: clamp(40px, 9vh, 104px);
}

.auth-visual .eyebrow {
    color: var(--navy);
}

.auth-quote {
    margin-top: 16px;
    font-family: var(--font-serif);
    font-size: clamp(32px, 3.2vw, 46px);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.04em;
    color: var(--navy-deep);
}

.auth-visual-text {
    max-width: 320px;
    margin-top: 18px;
    font-size: 13.5px;
    line-height: 1.9;
    color: #4d647c;
}

.auth-visual-img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 55% 22%;
    opacity: 0.95;
}

.auth-visual-chip {
    position: absolute;
    left: clamp(28px, 4vw, 48px);
    bottom: clamp(28px, 5vh, 56px);
    z-index: 4;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    color: #3f5a77;
}

/* ---------------- 右侧表单区 ---------------- */
.auth-main {
    display: grid;
    place-items: center;
    padding: clamp(32px, 5vw, 64px) clamp(20px, 5vw, 72px);
    background: #fff;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 12.5px;
    color: var(--muted);
}

.auth-back,
.auth-toplink {
    transition: color 0.25s var(--ease);
}

.auth-back:hover,
.auth-toplink:hover {
    color: var(--brand);
}

.auth-toplink {
    color: var(--navy);
}

.auth-eyebrow {
    margin-top: clamp(28px, 5vh, 48px);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--brand);
}

.auth-title {
    margin: 10px 0 10px;
    font-family: var(--font-serif);
    font-size: clamp(34px, 3.4vw, 42px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.03em;
    color: var(--navy-deep);
}

.auth-lead {
    margin-bottom: 30px;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--muted);
}

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

.field {
    display: grid;
    gap: 8px;
}

.field-label {
    font-size: 12.5px;
    color: #4a5260;
    letter-spacing: 0.02em;
}

.field-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-inline: 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f4f6f9;
    transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
                box-shadow 0.25s var(--ease);
}

.field-control:focus-within {
    border-color: var(--navy);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 50, 79, 0.08);
}

.field-control input {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--ink);
}

.field-control input::placeholder {
    color: #a3aab4;
}

.field.has-error .field-control {
    border-color: var(--brand);
    background: #fff8f9;
    box-shadow: 0 0 0 4px rgba(228, 0, 43, 0.06);
}

.field-error {
    display: none;
    font-size: 12px;
    line-height: 1.5;
    color: var(--brand);
}

.field.has-error .field-error {
    display: block;
    animation: error-in 0.25s var(--ease);
}

@keyframes error-in {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 密码可见性切换 */
.toggle-password {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 8px;
    color: #7c8593;
    transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.toggle-password:hover {
    color: var(--navy);
    background: rgba(22, 50, 79, 0.06);
}

.toggle-password svg {
    width: 19px;
    height: 19px;
}

.toggle-password .eye-closed {
    display: none;
}

.toggle-password[aria-pressed="true"] .eye-open {
    display: none;
}

.toggle-password[aria-pressed="true"] .eye-closed {
    display: block;
}

/* 验证码按钮 */
.field-control--code input {
    letter-spacing: 0.16em;
}

.code-btn {
    flex-shrink: 0;
    height: 36px;
    padding-inline: 16px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    transition: background-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.code-btn:hover {
    background: #2b2d34;
}

.code-btn:disabled {
    background: #c7cdd6;
    cursor: not-allowed;
}

/* 密码强度 */
.strength {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.strength span {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #e4e8ee;
    transition: background-color 0.3s var(--ease);
}

.strength[data-level="1"] span:nth-child(1) { background: #e4595a; }
.strength[data-level="2"] span:nth-child(-n + 2) { background: #e9a13b; }
.strength[data-level="3"] span:nth-child(-n + 3) { background: #7fa6d8; }
.strength[data-level="4"] span { background: #2f9e6f; }

.strength-text {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--muted);
}

/* 选项与说明 */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    font-size: 13px;
    color: var(--muted);
}

.auth-row a {
    color: var(--navy);
    transition: color 0.25s var(--ease);
}

.auth-row a:hover {
    color: var(--brand);
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.65;
    color: #4a5260;
    cursor: pointer;
}

.checkbox input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--navy);
    cursor: pointer;
}

.checkbox a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.checkbox--agree {
    font-size: 12.5px;
    color: var(--muted);
}

.field--plain {
    gap: 6px;
}

.auth-submit {
    width: 100%;
    height: 50px;
    margin-top: 4px;
    font-size: 15px;
}

.auth-switch {
    margin-top: 4px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.auth-switch a {
    color: var(--navy);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-note {
    margin-top: 22px;
    font-size: 11.5px;
    line-height: 1.75;
    text-align: center;
    color: var(--muted-light);
}

.auth-note a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 236px;
        padding: 24px clamp(20px, 5vw, 40px);
    }

    .auth-visual-img {
        display: none;
    }

    .auth-visual::after {
        display: none;
    }

    .auth-visual-copy {
        margin-top: 22px;
    }

    .auth-quote {
        font-size: 27px;
        line-height: 1.5;
    }

    .auth-quote br {
        display: none;
    }

    .auth-visual-text {
        display: none;
    }

    .auth-visual-chip {
        position: static;
        align-self: flex-start;
        margin-top: 16px;
        padding: 6px 12px;
        font-size: 11px;
        background: rgba(255, 255, 255, 0.6);
    }

    .auth-main {
        padding: 32px 20px 56px;
    }

    .auth-eyebrow {
        margin-top: 26px;
    }
}

@media (max-width: 560px) {
    .auth-visual {
        min-height: 196px;
    }

    .auth-quote {
        font-size: 23px;
    }

    .auth-title {
        font-size: 32px;
    }

    .auth-lead {
        margin-bottom: 24px;
    }

    .auth-form {
        gap: 16px;
    }

    .auth-topline {
        font-size: 12px;
    }
}
