/**
 * 登录弹窗(#modalSignBox)美化样式
 *
 * 说明: 原样式分散在 app.css/home.css/page.css 等页面样式包中(压缩状态),
 * 这里用独立样式表覆盖, 由 wp_enqueue_style 在页面样式之后输出, 因此优先级更高.
 * 定位方式沿用原有的 fixed + 负边距(不使用 transform, 避免与弹窗插件的缩放动画冲突).
 *
 * @since 2.7.0
 */

/* ---------------- 卡片 ---------------- */

/**
 * 定位说明: 用 top/left 50% + transform 做居中(自适应高度, 内容多时不会留空白).
 * 原 fadeScale 动画用 transform:scale() 实现, 这里加 !important 后动画的 transform 会被覆盖,
 * 只保留淡入效果(动画优先级低于 !important 声明), 不会出现跳动.
 */
body #modalSignBox {
    width: 400px !important;
    height: auto !important;
    max-height: 92vh;
    top: 50% !important;
    left: 50% !important;
    /* .modal 类默认 right/bottom:0, 会把卡片从 top:50% 拉伸到屏幕底部(屏幕越高底部空白越多), 这里复位 */
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(16, 42, 67, .06);
    box-shadow: 0 24px 64px rgba(16, 42, 67, .26), 0 2px 10px rgba(16, 42, 67, .08) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* ---------------- 头部 ---------------- */

body #modalSignBox > h2 {
    margin: 0 !important;
    padding: 26px 20px 0 !important;
    font-size: 2.2rem;
    line-height: 1.3;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
    color: #23384d;
    background: linear-gradient(160deg, #f2f8ff 0%, #ffffff 100%);
}

body #modalSignBox > .ct-modal-sub {
    margin: 0 !important;
    padding: 8px 24px 18px;
    font-size: 1.3rem;
    line-height: 1.5;
    text-align: center;
    color: #8c9aa8;
    letter-spacing: .3px;
    background: linear-gradient(160deg, #f2f8ff 0%, #ffffff 100%);
    border-bottom: 1px solid #edf3f9;
}

/* ---------------- 表单区 ---------------- */

body #modalSignBox > .local-signin {
    width: 100%;
    padding: 20px 24px 24px !important;
    background: #fff;
}

body #modalSignBox > .local-signin > .form-group {
    position: relative;
    margin-bottom: 14px;
}

body #modalSignBox > .local-signin > .form-group > .form-control {
    height: 46px !important;
    line-height: 46px !important;
    padding: 0 14px !important;
    font-size: 1.5rem;
    color: #2c3e50;
    background-color: #fbfdff !important;
    border: 1px solid #dde7f0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

body #modalSignBox > .local-signin > .form-group > .form-control::-webkit-input-placeholder {
    color: #a9b6c3;
}

body #modalSignBox > .local-signin > .form-group > .form-control::-moz-placeholder {
    color: #a9b6c3;
}

body #modalSignBox > .local-signin > .form-group > .form-control:focus {
    background-color: #fff !important;
    border-color: #3895D6 !important;
    box-shadow: 0 0 0 3px rgba(56, 149, 214, .16) !important;
}

body #modalSignBox > .local-signin > .form-group > .tip {
    top: 12px;
    right: 10px;
    background-color: #f1c40f;
    box-shadow: 0 2px 6px rgba(241, 196, 15, .35);
}

/* ---------------- 按钮 ---------------- */

body #modalSignBox > .local-signin > button {
    position: relative;
    width: 100%;
    height: 46px !important;
    margin-top: 4px;
    font-size: 1.6rem;
    letter-spacing: 1px;
    border: 0;
    border-radius: 10px !important;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}

/* 主登录按钮 */
body #modalSignBox > .local-signin > button.submit {
    color: #fff;
    background-image: linear-gradient(135deg, #46a6ea 0%, #2f86c9 100%);
    box-shadow: 0 8px 18px rgba(56, 149, 214, .28);
}

body #modalSignBox > .local-signin > button.submit:hover,
body #modalSignBox > .local-signin > button.submit:focus {
    opacity: 1 !important;
    color: #fff;
    background-image: linear-gradient(135deg, #55b0f0 0%, #3690d3 100%);
    box-shadow: 0 10px 22px rgba(56, 149, 214, .36);
    transform: translateY(-1px);
}

body #modalSignBox > .local-signin > button.submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(56, 149, 214, .3);
}

/* 通行密钥按钮(次级描边样式) */
body #modalSignBox > .local-signin > button.ct-webauthn-btn {
    margin-top: 12px;
    height: 44px !important;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0;
    color: #46617f !important;
    background: #fff !important;
    border: 1px solid #d9e5f0 !important;
    box-shadow: none;
}

body #modalSignBox > .local-signin > button.ct-webauthn-btn:hover {
    color: #2f86c9 !important;
    border-color: #a9cdec !important;
    background: #f7fbff !important;
}

body #modalSignBox > .local-signin > button.ct-webauthn-btn::before {
    content: "";
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 7px;
    vertical-align: -2px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15px 15px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2346617f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4'/%3E%3C/svg%3E");
}

/* ---------------- 底部提示链接 ---------------- */

body #modalSignBox > .local-signin > .login-help {
    margin-top: 18px !important;
}

body #modalSignBox > .local-signin > .login-help a {
    color: #7b8b9a !important;
    font-size: 1.35rem;
    transition: color .2s;
}

body #modalSignBox > .local-signin > .login-help a:hover {
    color: #3895D6 !important;
}

body #modalSignBox > .local-signin > .login-help a:before {
    background-color: #c3ced8 !important;
}

/* ---------------- 第三方登录 ---------------- */

body #modalSignBox > .open-login {
    padding: 16px 24px 22px !important;
    text-align: center;
    background: #f7fbff !important;
    border-top: 1px solid #eaf1f8;
}

body #modalSignBox > .open-login > p {
    margin-bottom: 10px;
    font-size: 1.3rem !important;
    color: #8c9aa8;
}

body #modalSignBox > .open-login > .social-items > a {
    width: 44px;
    height: 44px;
    margin: 0 8px;
    line-height: 44px;
    box-shadow: 0 4px 10px rgba(16, 42, 67, .12);
    transition: transform .15s ease, box-shadow .2s ease;
}

body #modalSignBox > .open-login > .social-items > a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 42, 67, .18);
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 480px) {
    body #modalSignBox {
        width: calc(100vw - 24px) !important;
        max-height: 90vh;
        border-radius: 14px !important;
    }

    body #modalSignBox > .local-signin {
        padding: 16px 18px 20px !important;
    }

    body #modalSignBox > .open-login {
        padding: 14px 18px 18px !important;
    }
}
