/* ============================================================
   登录 / 创建密码库
   版式参考 guohaolian/animatedlogin：左侧 4 个互动角色 + 右侧极简表单
   配色沿用 start 的青绿玻璃体系
   ============================================================ */

.auth {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
    animation: auth-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes auth-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- 左侧 ---------- */

.auth__panel--left {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 34px 40px 0;
    overflow: hidden;
    border-right: 1px solid var(--border);
    background-image:
        linear-gradient(180deg, var(--glass-sheen-soft) 0%, rgba(255, 255, 255, 0) 30%),
        linear-gradient(160deg, var(--glass-pane-1) 0%, var(--glass-pane-2) 100%);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
    box-shadow: inset -1px 0 0 var(--glass-edge-light);
}

.auth__panel--left::before,
.auth__panel--left::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(70px);
}

.auth__panel--left::before {
    top: 6%;
    right: -6%;
    width: 320px;
    height: 320px;
    background: rgba(94, 224, 200, 0.28);
}

.auth__panel--left::after {
    bottom: 4%;
    left: -8%;
    width: 360px;
    height: 360px;
    background: rgba(140, 160, 255, 0.24);
}

[data-theme="dark"] .auth__panel--left::before {
    background: rgba(94, 224, 200, 0.16);
}

[data-theme="dark"] .auth__panel--left::after {
    background: rgba(120, 130, 255, 0.16);
}

.auth__brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 11px;
}

.auth__brand--inline {
    display: none;
}

.auth__mark {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #23c69f 0%, #0d9488 100%);
    box-shadow: 0 10px 24px -14px rgba(13, 148, 136, 0.85);
}

.auth__mark .icon {
    width: 19px;
    height: 19px;
}

.auth__brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.auth__brand-text strong {
    font-size: 0.98rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.auth__brand-text small {
    color: var(--text-faint);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.09em;
}

.auth__lede {
    position: relative;
    z-index: 2;
    max-width: 392px;
    margin: 38px 0 0;
}

.auth__lede h2 {
    margin: 0;
    font-size: 1.82rem;
    font-weight: 700;
    line-height: 1.34;
    letter-spacing: -0.022em;
}

.auth__lede p {
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 0.79rem;
    line-height: 1.78;
}

.auth__scene {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: 10px;
}

.auth__foot {
    position: relative;
    z-index: 2;
    max-width: 400px;
    margin: 0;
    color: var(--text-faint);
    font-size: 0.73rem;
    line-height: 1.7;
}

/* ---------- 角色 ---------- */

.characters-scene {
    position: relative;
    width: 480px;
    height: 372px;
    flex: none;
    transform-origin: bottom center;
}

.character {
    position: absolute;
    bottom: 0;
    transition: all 0.7s ease-in-out;
    transform-origin: bottom center;
}

.char-purple {
    left: 60px;
    width: 170px;
    height: 370px;
    background: #6c3ff5;
    border-radius: 10px 10px 0 0;
    z-index: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.char-black {
    left: 220px;
    width: 115px;
    height: 290px;
    background: var(--char-dark, #2d2d2d);
    border-radius: 8px 8px 0 0;
    z-index: 2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] {
    --char-dark: #4b4b55;
}

.char-orange {
    left: 0;
    width: 230px;
    height: 190px;
    background: #ff9b6b;
    border-radius: 115px 115px 0 0;
    z-index: 3;
}

.char-yellow {
    left: 290px;
    width: 135px;
    height: 215px;
    background: #e8d754;
    border-radius: 68px 68px 0 0;
    z-index: 4;
}

.eyes {
    position: absolute;
    display: flex;
    transition: all 0.7s ease-in-out;
}

.eyeball {
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: height 0.15s ease;
}

.pupil {
    border-radius: 50%;
    background: #2d2d2d;
    transition: transform 0.1s ease-out;
}

.bare-pupil {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2d2d2d;
    transition: transform 0.7s ease-in-out;
}

.yellow-mouth {
    position: absolute;
    width: 50px;
    height: 4px;
    background: #2d2d2d;
    border-radius: 2px;
    transition: all 0.7s ease-in-out;
}

.orange-mouth {
    position: absolute;
    width: 28px;
    height: 14px;
    border: 3px solid #2d2d2d;
    border-top: none;
    border-radius: 0 0 14px 14px;
    opacity: 0;
    transition: all 0.7s ease-in-out;
}

.orange-mouth.visible {
    opacity: 1;
}

@keyframes shakeHead {
    0%, 100% { translate: 0 0; }
    10% { translate: -9px 0; }
    20% { translate: 7px 0; }
    30% { translate: -6px 0; }
    40% { translate: 5px 0; }
    50% { translate: -4px 0; }
    60% { translate: 3px 0; }
    70% { translate: -2px 0; }
    80% { translate: 1px 0; }
    90% { translate: -0.5px 0; }
}

.eyes.shake-head,
.yellow-mouth.shake-head,
.orange-mouth.shake-head {
    animation: shakeHead 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ---------- 右侧 ---------- */

.auth__panel--right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background-image: linear-gradient(180deg, var(--auth-pane-1) 0%, var(--auth-pane-2) 100%);
}

:root {
    --auth-pane-1: rgba(255, 255, 255, 0.74);
    --auth-pane-2: rgba(255, 255, 255, 0.46);
}

[data-theme="dark"] {
    --auth-pane-1: rgba(15, 26, 29, 0.72);
    --auth-pane-2: rgba(10, 18, 21, 0.46);
}

.auth__form {
    width: 100%;
    max-width: 372px;
    animation: form-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.auth__sparkle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent);
}

.auth__sparkle svg {
    width: 28px;
    height: 28px;
}

.auth__head {
    margin-bottom: 30px;
    text-align: center;
}

.auth__head h1 {
    margin: 0 0 6px;
    font-size: 1.62rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.auth__head p {
    margin: 0;
    color: var(--text-faint);
    font-size: 0.82rem;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field > label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.auth-field > label.is-error {
    color: var(--danger);
}

.auth-field__box {
    position: relative;
}

.auth-field input {
    width: 100%;
    height: 46px;
    padding: 0 40px 0 0;
    border: 0;
    border-bottom: 1.5px solid var(--border-strong);
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.25s ease;
}

.auth-field input::placeholder {
    color: var(--input-placeholder);
}

.auth-field input:focus {
    border-bottom-color: var(--accent);
}

.auth-field input.is-error {
    border-bottom-color: var(--danger);
}

.auth-field input[type="password"]:not(:placeholder-shown) {
    letter-spacing: 0.14em;
}

.auth-field input::-ms-reveal,
.auth-field input::-ms-clear {
    display: none;
}

.auth-eye {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.auth-eye:hover {
    color: var(--accent);
    background: var(--hover);
}

.auth-eye .icon {
    width: 17px;
    height: 17px;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 22px;
    margin-bottom: 18px;
}

.auth-hint {
    color: var(--text-faint);
    font-size: 0.7rem;
    line-height: 1.5;
}

.auth-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.auth-link:hover {
    opacity: 0.75;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-error {
    margin: 0 0 14px;
    padding: 9px 12px;
    border: 1px solid rgba(209, 75, 75, 0.22);
    border-radius: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 0.75rem;
    line-height: 1.6;
    animation: err-in 0.2s ease both;
}

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

/* 主按钮：悬停时文字滑出、箭头滑入 */

.btn-login {
    position: relative;
    width: 100%;
    height: 50px;
    margin-bottom: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-size: 0.92rem;
    font-weight: 620;
    letter-spacing: 0.01em;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.3s ease, opacity 0.2s ease;
}

.btn-login:hover {
    box-shadow: 0 18px 34px -20px rgba(15, 155, 134, 0.9);
}

.btn-login:active {
    transform: scale(0.99);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: progress;
}

.btn-login .btn-text,
.btn-login .btn-hover-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.btn-login .btn-text {
    height: 100%;
}

.btn-login .btn-hover-content {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #16b79b 0%, #0b8270 100%);
    color: #fff;
    opacity: 0;
    transform: translateY(100%);
}

.btn-login:hover .btn-text,
.btn-login:focus-visible .btn-text {
    transform: translateY(-100%);
    opacity: 0;
}

.btn-login:hover .btn-hover-content,
.btn-login:focus-visible .btn-hover-content {
    opacity: 1;
    transform: none;
}

.auth-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--code-bg);
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.7;
    animation: err-in 0.2s ease both;
}

.auth-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 22px;
}

.auth-alt__dot {
    color: var(--text-faint);
    font-size: 0.7rem;
}

.auth-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 26px 0 0;
    color: var(--text-faint);
    font-size: 0.68rem;
    line-height: 1.6;
    text-align: center;
}

.auth-privacy .icon {
    width: 12px;
    height: 12px;
}

/* ---------- 响应式 ---------- */

@media (max-height: 860px) and (min-width: 901px) {
    .auth__lede {
        margin-top: 26px;
    }

    .auth__lede h2 {
        font-size: 1.55rem;
    }

    .auth__lede p {
        margin-top: 10px;
        font-size: 0.75rem;
    }

    .characters-scene {
        transform: scale(0.88);
    }

    .auth__head {
        margin-bottom: 24px;
    }

    .auth-field {
        margin-bottom: 15px;
    }
}

@media (max-height: 700px) and (min-width: 901px) {
    .auth__lede p {
        display: none;
    }

    .characters-scene {
        transform: scale(0.74);
    }
}

@media (max-width: 1180px) {
    .characters-scene {
        transform: scale(0.86);
    }
}

@media (min-width: 1280px) and (min-height: 880px) {
    .characters-scene {
        transform: scale(1.14);
    }
}

@media (max-width: 1024px) {
    .auth {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
    }
}

@media (max-width: 900px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth__panel--left {
        display: none;
    }

    .auth__panel--right {
        min-height: 100svh;
        padding: 36px 22px;
    }

    .auth__form {
        max-width: 400px;
    }

    .auth__brand--inline {
        display: flex;
        justify-content: center;
        margin-bottom: 26px;
    }

    .auth__sparkle {
        display: none;
    }
}

@media (max-width: 460px) {
    .auth__head h1 {
        font-size: 1.42rem;
    }

    .auth__form {
        max-width: 100%;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
