/* 登录页 · 3a 奶油底 · 厚边框 · 立体按钮
 *
 * 配色直接沿用 listening-home.css 的既有 token，不新造色板：
 *   底色 #FFF9F1 / 卡片描边 #F3E3C8 / 标题 #3D3428 / 主按钮 #FF9600 + #D97E00 下沿
 *   信息条走 .continue-banner 的 #EDF3FF+#D6E3FF；微信按钮走 .signed-badge 的 #E9F8EC+#BFEBC8
 *
 * 相对 listening-home 有两处刻意的对比度修复（该文件的原值不过 WCAG AA）：
 *   1. #FF9600 上的白字只有 2.2:1 → 主按钮文字改用深棕 #3D3428（5.6:1）
 *   2. 正文灰 #97876F / #A79375 → 加深为 #6B5B44 / #7A6A52
 */

body {
    background: #FFF9F1;
}

.login-card {
    max-width: 460px;
    margin: 64px auto;
    padding: 36px 40px 32px;
    background: #fff;
    border: 2px solid #F3E3C8;
    border-radius: 24px;
    box-shadow: none;
}

/* ---------- 标题 ---------- */

.login-title {
    margin-bottom: 4px;
    font-size: 28px;
    font-weight: 800;
    color: #3D3428;
    text-align: center;
}

.login-subtitle {
    margin-bottom: 24px;
    font-size: 14px;
    color: #6B5B44;
    text-align: center;
}

/* ---------- 登录方式 tab（分段控件） ---------- */

.login-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: #FFF1D6;
    border: none;
    border-radius: 14px;
}

.login-tab {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: none;
    border-radius: 10px;
    color: #7A6A52;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.login-tab:hover {
    color: #3D3428;
}

.login-tab.active {
    background: #fff;
    color: #3D3428;
    box-shadow: 0 1px 3px rgba(61, 52, 40, 0.12);
}

.login-tab:focus-visible {
    outline: 3px solid #4A7CF0;
    outline-offset: 2px;
}

/* ---------- 表单 ---------- */

.login-card label {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #3D3428;
}

.login-card .form-control {
    height: auto;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #F3E3C8;
    border-radius: 14px;
    font-size: 15px;
    color: #3D3428;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card .form-control::placeholder {
    color: #A79375;
}

.login-card .form-control:focus {
    border-color: #4A7CF0;
    box-shadow: 0 0 0 3px rgba(74, 124, 240, 0.25);
}

/* 验证码输入框与「获取验证码」并排：Bootstrap input-group 会削平相邻圆角，这里接管回来 */
.login-card .input-group .form-control {
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

.login-card .input-group-append {
    margin-left: 10px;
}

/* ---------- 「获取验证码」次级按钮 ---------- */

.login-card .btn-outline-primary {
    padding: 0 20px;
    background: #EDF3FF;
    border: 2px solid #D6E3FF;
    border-radius: 14px;
    color: #2F66D0;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.15s;
}

.login-card .btn-outline-primary:hover:not(:disabled) {
    background: #D6E3FF;
    border-color: #CCE0FF;
    color: #2F66D0;
}

.login-card .btn-outline-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-card .btn-outline-primary:focus,
.login-card .btn-outline-primary:focus-visible {
    outline: 3px solid #4A7CF0;
    outline-offset: 2px;
    box-shadow: none;
}

/* ---------- 主按钮（立体下沿） ---------- */

.login-card .btn-primary.btn-block {
    padding: 13px 24px;
    background: #FF9600;
    border: none;
    border-bottom: 4px solid #D97E00;
    border-radius: 14px;
    color: #3D3428;
    font-size: 16px;
    font-weight: 800;
    transition: background 0.15s;
}

.login-card .btn-primary.btn-block:hover:not(.disabled) {
    background: #FFA51F;
    color: #3D3428;
}

.login-card .btn-primary.btn-block:active:not(.disabled) {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.login-card .btn-primary.btn-block.disabled,
.login-card .btn-primary.btn-block:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-card .btn-primary.btn-block:focus,
.login-card .btn-primary.btn-block:focus-visible {
    outline: 3px solid #4A7CF0;
    outline-offset: 2px;
    box-shadow: none;
}

/* ---------- 字段说明 tooltip ---------- */

.field-tip {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}

.field-tip-trigger {
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid #C9B896;
    border-radius: 50%;
    background: transparent;
    color: #8A7A63;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

.field-tip-trigger:focus-visible {
    outline: 2px solid #2F66D0;
    outline-offset: 2px;
}

/* 左对齐而非居中：触发器左侧仅 91px，居中需要 105px，会溢出卡片边框 */
.field-tip-bubble {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 10;
    width: max-content;
    max-width: 220px;
    padding: 8px 12px;
    background: #EDF3FF;
    border: 2px solid #D6E3FF;
    border-radius: 12px;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    color: #2F66D0;
    text-align: left;
    opacity: 0;
    visibility: hidden;
}

/* hover 只在真有鼠标的设备生效：触屏上 :hover 会粘滞，
   与 JS 的 .is-open 叠加成"点一次不关、点两次才关" */
@media (hover: hover) and (pointer: fine) {
    .field-tip-trigger:hover + .field-tip-bubble {
        opacity: 1;
        visibility: visible;
    }
}

.field-tip-bubble.is-open {
    opacity: 1;
    visibility: visible;
}

/* ---------- 协议勾选 ---------- */

.agreement-group {
    margin-top: 18px;
    margin-bottom: 18px;
}

.agreement-label {
    font-size: 13px;
    color: #6B5B44;
    font-weight: normal !important;
}

.agreement-label::before {
    border: 2px solid #F3E3C8 !important;
    border-radius: 6px !important;
}

.custom-control-input:checked ~ .agreement-label::before {
    background-color: #FF9600 !important;
    border-color: #FF9600 !important;
}

.custom-control-input:focus ~ .agreement-label::before {
    box-shadow: 0 0 0 3px rgba(74, 124, 240, 0.25) !important;
}

.agreement-label::before,
.agreement-label::after {
    top: 0.05rem;
}

.agreement-link {
    color: #2F66D0;
    font-weight: 600;
    text-decoration: none;
}

.agreement-link:hover {
    color: #2F66D0;
    text-decoration: underline;
}

.agreement-link:focus-visible {
    outline: 2px solid #4A7CF0;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ---------- 「忘记密码？改用验证码登录」 ---------- */

.login-links {
    margin-top: 16px;
    margin-bottom: 0;
}

.login-card .btn-link {
    color: #2F66D0;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.login-card .btn-link:hover {
    color: #2F66D0;
    text-decoration: underline;
}

.login-card .btn-link:focus-visible {
    outline: 2px solid #4A7CF0;
    outline-offset: 2px;
    border-radius: 3px;
    box-shadow: none;
}

/* ---------- 微信扫码 tab ----------
 *
 * 内嵌的是微信官方 qrconnect iframe，面板内部样式只能靠授权 URL 的 href
 * 参数挂 /css/wechat-qrconnect.css 去调，这里只负责外框尺寸与留白。
 */

.wechat-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 4px;
}

.wechat-qr-mount {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 220px;
    font-size: 13px;
    color: #7A6A52;
}

.wechat-qr-frame {
    width: 100%;
    height: 220px;
    border: 0;
    overflow: hidden;
}

.wechat-qr-hint {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: #6B5B44;
}

/* 扫码即视为同意：微信 tab 没有勾选框，同意通过这行小字体现 */
.wechat-qr-terms {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #7A6A52;
    text-align: center;
}

/* ---------- 错误提示 ---------- */

.error-message {
    display: none;
    margin-top: 8px;
    padding: 8px 14px;
    background: #FFE9E5;
    border: 2px solid #FFD2CA;
    border-radius: 10px;
    color: #C05B4B;
    font-size: 12px;
    animation: fadeIn 0.3s ease-in;
}

.error-message.show {
    display: block;
}

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

.login-card .form-control.error {
    border-color: #E0523E !important;
    box-shadow: 0 0 0 3px rgba(224, 82, 62, 0.2) !important;
}

/* 禁用浏览器默认校验样式，避免与自定义 .error 冲突 */
input:invalid,
input:required:invalid,
input[type="email"]:invalid {
    box-shadow: none !important;
    border-color: #F3E3C8 !important;
}

input::-webkit-validation-bubble-message,
input::-webkit-validation-bubble-arrow {
    display: none !important;
}

input:invalid {
    -moz-box-shadow: none !important;
    box-shadow: none !important;
}

/* ---------- 密码显隐 ---------- */

.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-group .form-control {
    padding-right: 48px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #7A6A52;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.password-toggle-btn:hover {
    color: #3D3428;
    background: #FFF1D6;
}

.password-toggle-btn:focus-visible {
    outline: 2px solid #4A7CF0;
    outline-offset: 1px;
}

.eye-icon {
    transition: opacity 0.2s ease;
}

/* ---------- 图形验证码弹窗 ---------- */

.captcha-image {
    cursor: pointer;
    height: 40px;
    border: 2px solid #F3E3C8;
    border-radius: 10px;
}

/* ---------- 通用 ---------- */

.hidden {
    display: none !important;
}

/* ---------- 移动端 ---------- */

@media (max-width: 576px) {
    .login-card {
        margin: 32px 16px;
        padding: 28px 22px 24px;
        border-radius: 20px;
    }

    .login-title {
        font-size: 24px;
    }
}

@media (max-width: 400px) {
    .login-card {
        margin: 20px 12px;
        padding: 24px 18px 20px;
    }

    .login-title {
        font-size: 22px;
    }

    .login-card .input-group-append {
        margin-left: 8px;
    }

    .login-card .btn-outline-primary {
        padding: 0 14px;
        font-size: 13px;
    }
}

/* ---------- 注销成功页 ---------- */

.account-deleted-card {
    text-align: center;
}

.account-deleted-icon {
    margin-bottom: 12px;
    color: #3FA76A;
}

.account-deleted-text {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.7;
    color: #3D3428;
}

.account-deleted-note {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #8A7A63;
}

.account-deleted-note a {
    color: #2F66D0;
}

.account-deleted-thanks {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6B5B44;
}

.account-deleted-actions .btn + .btn {
    margin-top: 12px;
}
