/* ==========================================================================
   注册页样式（reg-page.css）
   作用范围：仅 templates/htmls/reg/regperson.html、reguserb.html 两页。
   约定：全部选择器以 .rg- 前缀，不覆盖站内其它页面的类名。
   设计 token 与 company_center.css 对齐（主色 #ff6000 / 边框 #dcdfe6 / 页面底 #dedede）。
   契约：.rg-page 内的表单 id、name 与 #code_input / #go_code / #_s / #captcha-element
   都不能改名，页面脚本与阿里云验证码依赖它们。
   ========================================================================== */

.rg-page {
    --rg-primary: #ff6000;
    --rg-primary-hover: #e85600;
    --rg-primary-weak: #fff3ec;
    --rg-text: #212529;
    --rg-text-2: #4a5056;
    --rg-muted: #868e96;
    --rg-border: #dcdfe6;
    --rg-divider: #eceef2;
    --rg-soft: #f7f8fa;
    --rg-danger: #e54d42;

    /* base2 的中间列口径：960 宽、浮在左右两侧 150 广告栏之间，上下各留 16px */
    float: left;
    width: 960px;
    padding: 0 0 16px;
    color: var(--rg-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   1. 卡片与卡头
   -------------------------------------------------------------------------- */
.rg-card {
    max-width: 960px; /* 960 通栏，与登录/找回密码页统一 */
    margin: 0 auto;
    padding: 34px 44px 38px;
    background: #fff;
    border-radius: 0; /* 外层直角，与站点老页面口径一致 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 28px rgba(0, 0, 0, .06);
    box-sizing: border-box;
}

.rg-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.rg-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--rg-text);
    letter-spacing: .01em;
}

.rg-sub {
    margin: 0;
    font-size: 13px;
    color: var(--rg-muted);
    white-space: nowrap;
}

.rg-link {
    color: var(--rg-primary);
    text-decoration: none;
    transition: color .15s;
}

.rg-link:hover {
    color: var(--rg-primary-hover);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   2. 企/个注册切换（等宽两段）
   -------------------------------------------------------------------------- */
.rg-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 26px;
    border: 1px solid var(--rg-border);
    border-radius: 4px;
    overflow: hidden;
}

.rg-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    background: var(--rg-soft);
    color: var(--rg-text-2);
    font-size: 14px;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}

.rg-tab + .rg-tab {
    border-left: 1px solid var(--rg-border);
}

.rg-tab:hover {
    color: var(--rg-primary);
    background: #fff;
    text-decoration: none;
}

.rg-tab.is-active {
    position: relative;
    background: #fff;
    color: var(--rg-primary);
    font-weight: 600;
}

/* 选中态底部橙条：盖住容器下边框 */
.rg-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--rg-primary);
}

/* --------------------------------------------------------------------------
   3. 表单字段
   -------------------------------------------------------------------------- */
.rg-form {
    margin: 0;
}

.rg-field {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.rg-label {
    flex: 0 0 96px;
    margin: 0; /* 站点随页加载的 bootstrap 会给 label 加 margin-bottom:8px，这里显式清零 */
    text-align: right;
    font-size: 14px;
    line-height: 44px;
    color: var(--rg-text-2);
    white-space: nowrap;
}

.rg-req {
    margin-right: 3px;
    font-style: normal;
    color: var(--rg-primary);
}

.rg-control {
    flex: 1;
    min-width: 0;
}

.rg-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--rg-border);
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
    color: var(--rg-text);
    font-size: 14px;
    line-height: normal;
    transition: border-color .15s, box-shadow .15s;
}

.rg-input::placeholder {
    color: #a9b0b8;
}

.rg-input:hover {
    border-color: #c2c8d0;
}

.rg-input:focus {
    outline: none;
    border-color: var(--rg-primary);
    box-shadow: 0 0 0 3px rgba(255, 96, 0, .12);
}

.rg-input.is-error {
    border-color: var(--rg-danger);
    box-shadow: 0 0 0 3px rgba(229, 77, 66, .1);
}

/* --------------------------------------------------------------------------
   4. 短信验证码行
   -------------------------------------------------------------------------- */
.rg-code {
    display: flex;
    gap: 8px;
}

.rg-code .rg-input {
    flex: 1;
    min-width: 0;
}

.rg-code-btn {
    flex: 0 0 120px;
    height: 44px;
    line-height: 42px;
    border: 1px solid var(--rg-primary);
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
    color: var(--rg-primary);
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s, color .15s;
}

.rg-code-btn:hover {
    background: var(--rg-primary-weak);
}

.rg-code-btn.is-timer {
    border-color: var(--rg-border);
    color: var(--rg-muted);
    cursor: default;
    font-size: 12px;
}

/* 脚本会把 #_s 切到 display:block、#go_code 切到 display:none，这里只给未激活时隐藏 */
#_s {
    display: none;
}

/* --------------------------------------------------------------------------
   5. 阿里云滑块验证码
   -------------------------------------------------------------------------- */
.rg-control--captcha {
    min-height: 44px;
}

.rg-captcha {
    display: flex;
    align-items: center;
    min-height: 44px;
}

/* 空容器在 flex 里宽度会塌成 0，脚本按它的 clientWidth 算滑块宽度就永远走不到窄屏分支 */
#captcha-element {
    flex: 1;
    min-width: 0;
}

/* 排除阿里云验证码内部的 span，避免被外层样式挤压 */
#captcha-element span {
    width: auto;
    float: none;
}

/* --------------------------------------------------------------------------
   6. 条款与提交
   -------------------------------------------------------------------------- */
.rg-terms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 4px;
    margin-top: 24px;
    font-size: 13px;
    line-height: 22px;
    color: var(--rg-text-2);
}

.rg-terms-l {
    position: relative; /* 隐藏的 radio 用绝对定位，锚在这里而不是整页左上角 */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0; /* bootstrap 的 label{margin-bottom:8px} 会把勾选框顶高 4px */
    cursor: pointer;
    user-select: none;
}

.rg-check {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.rg-check-box {
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1px solid #b9c0c8;
    border-radius: 2px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s, background-color .15s;
}

.rg-terms-l:hover .rg-check-box {
    border-color: var(--rg-primary);
}

.rg-check:checked + .rg-check-box {
    border-color: var(--rg-primary);
    background: var(--rg-primary);
}

.rg-check:checked + .rg-check-box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

.rg-check:focus-visible + .rg-check-box {
    box-shadow: 0 0 0 3px rgba(255, 96, 0, .18);
}

.rg-btn {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 26px;
    border: 0;
    border-radius: 4px;
    background: var(--rg-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .06em;
    cursor: pointer;
    transition: background-color .15s;
}

.rg-btn:hover {
    background: var(--rg-primary-hover);
}

.rg-btn:active {
    transform: translateY(1px);
}

.rg-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 96, 0, .25);
}

/* --------------------------------------------------------------------------
   7. 响应式：1200 / 1024 / 768 / 480
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    /* 这一档起两侧广告栏隐藏，中间列铺满 */
    .rg-page {
        width: 100%;
        float: none;
        padding: 16px 10px 0;
        box-sizing: border-box;
    }

    .rg-card {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .rg-page {
        padding: 16px 12px 16px;
    }

    .rg-card {
        max-width: 100%;
        padding: 24px 20px 28px;
        border-radius: 0;
    }

    .rg-head {
        display: block;
        margin-bottom: 18px;
    }

    .rg-sub {
        margin-top: 6px;
        white-space: normal;
    }

    .rg-tabs {
        margin-bottom: 20px;
    }

    .rg-field {
        display: block;
        margin-bottom: 16px;
    }

    .rg-label {
        display: block;
        margin-bottom: 6px;
        line-height: 1.6;
        text-align: left;
    }

    .rg-terms {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .rg-page {
        padding: 12px 8px 16px;
    }

    .rg-card {
        padding: 20px 16px 24px;
    }

    .rg-title {
        font-size: 18px;
    }

    .rg-code {
        gap: 6px;
    }

    .rg-code-btn {
        flex-basis: 104px;
        font-size: 12px;
    }

    .rg-btn {
        height: 44px;
        margin-top: 20px;
        font-size: 15px;
    }
}
