/* 认证页容器 */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 4rem);
    padding: 3rem 1rem;
}
.dark .auth-container {
    background-color: #000000;
}
.auth-container > div {
    width: 100%;
    max-width: 28rem;
}

/* 输入框统一风格：无圆角，黑色 focus ring */
.auth-input {
    width: 100%;
    padding: 0.4rem 1.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: transparent;
    outline: none;
    color: inherit;
}
.auth-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.dark .auth-input {
    border-color: #4b5563;
    background-color: #222224;
    color: #fff;
}
.dark .auth-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

/* ===== Floating Label ===== */
.fl-wrap {
    position: relative;
}
.fl-wrap .auth-input {
    padding-top: 1.2rem;
    padding-bottom: 0.1rem;
}
.fl-label {
    position: absolute;
    left: 1.25rem;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: #6b7280;
    pointer-events: none;
    transform-origin: left center;
    transform: translateY(0) scale(1);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                font-size 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.dark .fl-label { color: #9ca3af; }

/* 聚焦或有内容：上移 + 缩小 */
.fl-wrap .auth-input:focus ~ .fl-label,
.fl-wrap .auth-input:not(:placeholder-shown) ~ .fl-label {
    transform: translateY(-0.7rem) scale(0.72);
    color: #6b7280;
}
.dark .fl-wrap .auth-input:focus ~ .fl-label,
.dark .fl-wrap .auth-input:not(:placeholder-shown) ~ .fl-label {
    color: #9ca3af;
}

/* 密码显隐按钮：不用 transform 居中，避免 site.css button:hover { transform:none } 导致跳动 */
.auth-pwd-toggle {
    position: absolute;
    right: 0.75rem;
    top: 0;
    bottom: 0;
    margin-top: auto;
    margin-bottom: auto;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    flex-shrink: 0;
    line-height: 0;
}
.auth-pwd-toggle i {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.25rem;
    line-height: 1;
}
.auth-pwd-toggle:hover {
    color: #4b5563;
    background: transparent;
}
.dark .auth-pwd-toggle {
    color: #6b7280;
}
.dark .auth-pwd-toggle:hover {
    color: #d1d5db;
    background: transparent;
}

/* 验证码格子 */
.vcode-input {
    flex: 1;
    min-width: 0;
    height: 4.5rem;
    text-align: center;
    font-size: 1.5rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: transparent;
    color: inherit;
}
.vcode-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.vcode-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f3f4f6;
}
.dark .vcode-input:disabled { background-color: #1a1a1c; }
.vcode-input.filled {
    border-color: #d1d5db;
}
/* 验证码错误状态：整行红色 */
.vcode-error .vcode-input {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: none !important;
}
.dark .vcode-error .vcode-input {
    border-color: #f87171 !important;
    background-color: rgba(239,68,68,0.15) !important;
}
/* 验证码正确状态：整行绿色 */
.vcode-success .vcode-input {
    border-color: #22c55e !important;
    background-color: #f0fdf4 !important;
    box-shadow: none !important;
}
.dark .vcode-success .vcode-input {
    border-color: #4ade80 !important;
    background-color: rgba(34,197,94,0.15) !important;
}
.dark .vcode-input { border-color: #4b5563; background-color: #222224; color: #d1d5db; }
.dark .vcode-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
.dark .vcode-input.filled { border-color: #4b5563; }
.auth-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #000;
    transition: background 0.2s;
    cursor: pointer;
    white-space: nowrap;
}
.auth-btn-primary:hover { background-color: #1f2937; }
.auth-btn-primary:disabled { background-color: #9ca3af; cursor: not-allowed; }
.dark .auth-btn-primary { background-color: #fff; color: #000; }
.dark .auth-btn-primary:hover { background-color: #e5e7eb; }

/* 固定颜色按钮：暗黑模式下颜色保持不变 */
.btn-blue { background-color: #0071e3 !important; color: #fff !important; }
.btn-blue:hover { background-color: #0077ed !important; }
.dark .btn-blue { background-color: #0071e3 !important; color: #fff !important; }
.dark .btn-blue:hover { background-color: #0077ed !important; }

/* 黑色按钮：暗黑模式下反转为白底黑字 */
.btn-dark { background-color: #1d1d1f !important; color: #fff !important; }
.btn-dark:hover { background-color: #3a3a3c !important; }
.dark .btn-dark { background-color: #f5f5f7 !important; color: #1d1d1f !important; }
.dark .btn-dark:hover { background-color: #e5e5ea !important; }

/* 次按钮：灰色背景 */
.auth-btn-secondary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    margin-bottom: 1.5rem;
}
.auth-btn-secondary:hover { background-color: #e5e7eb; }
.dark .auth-btn-secondary { background-color: #222224; color: #d1d5db; }
.dark .auth-btn-secondary:hover { background-color: #333335; }

/* 密码强度条 */
.strength-bar-wrap {
    flex: 1;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}
.dark .strength-bar-wrap { background-color: #000; }
.strength-bar { height: 100%; border-radius: 9999px; transition: all 0.3s; }

/* Logo 图标 */
.auth-logo-svg path { fill: #000; transition: fill 0.2s; }
.dark .auth-logo-svg path { fill: #fff; }
/* 跳动小圆点 loading */
.vcode-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9ca3af;
    animation: vcode-bounce 0.6s ease-in-out infinite alternate;
}
.dark .vcode-dot { background: #6b7280; }
@keyframes vcode-bounce {
    from { transform: translateY(0); opacity: 0.5; }
    to   { transform: translateY(-5px); opacity: 1; }
}

/* Toast 提示 */
#auth-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0.5rem);
    background: #1f2937;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
    white-space: nowrap;
}
#auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.dark #auth-toast { background: #fff; color: #000; }
