/* 三步注册通道 — 沿用 terms.php 品牌风格 */
.rf-page {
    background: #fff;
    color: #222;
    padding: 1.5rem 0 3.5rem;
}

.rf-wrap {
    width: min(96vw, 880px);
    margin: 0 auto;
    padding: 0 1rem;
}

.rf-back {
    display: inline-block;
    margin-bottom: 1rem;
    color: #888;
    font-size: .9rem;
    text-decoration: none;
}

.rf-back:hover {
    color: #111;
}

.rf-head h1 {
    margin: 0 0 .35rem;
    font-size: clamp(1.45rem, 3vw, 1.85rem);
    font-weight: 900;
    color: #111;
}

.rf-head .rf-meta {
    margin: 0 0 1.5rem;
    color: #888;
    font-size: .9rem;
}

/* 步骤条 */
.rf-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.rf-stepper-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 88px;
}

.rf-stepper-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 0;
    border-top: 2px dotted #ddd;
    z-index: 0;
}

.rf-stepper-item.is-done:not(:last-child)::after {
    border-top-color: #f0d800;
}

.rf-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #fff;
    color: #999;
    font-size: .85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.rf-stepper-item.is-active .rf-step-dot {
    background: #FFF000;
    border-color: #111;
    color: #111;
}

.rf-stepper-item.is-done .rf-step-dot {
    background: #FFF000;
    border-color: #111;
    color: #111;
}

.rf-step-label {
    margin-top: .45rem;
    font-size: .82rem;
    color: #999;
    text-align: center;
    white-space: nowrap;
}

.rf-stepper-item.is-active .rf-step-label,
.rf-stepper-item.is-done .rf-step-label {
    color: #111;
    font-weight: 700;
}

/* 步骤面板 */
.rf-step-panel {
    display: none;
}

.rf-step-panel.is-visible {
    display: block;
}

.rf-step-title {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #111;
}

.rf-step-desc {
    margin: 0 0 1.25rem;
    color: #888;
    font-size: .9rem;
}

/* 类型卡片 */
.rf-type-list {
    display: grid;
    gap: .85rem;
}

.rf-type-card {
    display: grid;
    grid-template-columns: 48px 1fr 28px;
    gap: .85rem 1rem;
    align-items: start;
    padding: 1.1rem 1.15rem;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.rf-type-card:hover {
    border-color: #ddd;
}

.rf-type-card.is-selected {
    border-color: #111;
    background: #fffdf0;
    box-shadow: 0 0 0 1px #111;
}

.rf-type-icon {
    font-size: 1.75rem;
    line-height: 1;
    padding-top: .15rem;
}

.rf-type-body h3 {
    margin: 0 0 .25rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #111;
}

.rf-type-body p {
    margin: 0 0 .5rem;
    color: #888;
    font-size: .88rem;
    line-height: 1.55;
}

.rf-type-req {
    margin: 0;
    padding-left: 1.1rem;
    color: #888;
    font-size: .82rem;
    line-height: 1.6;
}

.rf-type-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ccc;
    align-self: center;
    position: relative;
}

.rf-type-card.is-selected .rf-type-radio {
    border-color: #111;
}

.rf-type-card.is-selected .rf-type-radio::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #111;
}

.rf-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* 表单 */
.rf-autofill-decoy {
    position: absolute;
    left: -9999px;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.rf-form {
    display: grid;
    gap: 1.15rem;
}

.rf-field {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: .65rem 1rem;
    align-items: start;
}

.rf-field > label {
    padding-top: .55rem;
    font-size: .92rem;
    font-weight: 700;
    color: #111;
    text-align: right;
}

.rf-field-control {
    min-width: 0;
}

.rf-field-control input[type="text"],
.rf-field-control input[type="email"],
.rf-field-control input[type="tel"],
.rf-field-control input[type="password"],
.rf-field-control select,
.rf-field-control textarea {
    width: 100%;
    box-sizing: border-box;
    padding: .6rem .75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: .92rem;
    color: #222;
}

.rf-field-control textarea {
    min-height: 110px;
    resize: vertical;
}

.rf-field-control input:focus,
.rf-field-control select:focus,
.rf-field-control textarea:focus {
    outline: none;
    border-color: #111;
}

.rf-hint {
    display: block;
    margin-top: .35rem;
    color: #888;
    font-size: .82rem;
    line-height: 1.55;
}

.rf-req {
    color: #e53935;
}

.rf-char-count {
    text-align: right;
    margin-top: .25rem;
    color: #aaa;
    font-size: .78rem;
}

.rf-category-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.rf-upload-box {
    width: 120px;
    height: 120px;
    border: 1px dashed #ccc;
    border-radius: 10px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    cursor: pointer;
    color: #888;
    font-size: .82rem;
    position: relative;
    overflow: hidden;
}

.rf-upload-box:hover {
    border-color: #999;
}

.rf-upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.rf-upload-box .rf-upload-plus {
    font-size: 1.5rem;
    line-height: 1;
    color: #bbb;
}

.rf-upload-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.rf-upload-box.has-preview .rf-upload-preview {
    display: block;
}

.rf-upload-box.has-preview .rf-upload-plus,
.rf-upload-box.has-preview span:not(.rf-upload-preview) {
    display: none;
}

.rf-upload-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.rf-otp-row {
    display: flex;
    gap: .5rem;
}

.rf-otp-row input {
    flex: 1;
    min-width: 0;
}

.rf-btn-otp {
    flex-shrink: 0;
    padding: .6rem .85rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    color: #333;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.rf-btn-otp:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.rf-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 800;
    color: #111;
}

.rf-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #FFF000;
    border-radius: 2px;
}

.rf-agree {
    position: relative;
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    margin: .5rem 0 0;
    padding: .85rem 1rem;
    border: 1px solid #ececec;
    border-radius: 10px;
    background: #fafafa;
    font-size: .88rem;
    color: #333;
    line-height: 1.6;
}

.rf-agree-main {
    flex: 1;
    min-width: 0;
}

.rf-agree input {
    margin-top: .2rem;
}

.rf-agree a {
    color: #1565c0;
    text-decoration: none;
    cursor: pointer;
}

.rf-agree a:hover {
    text-decoration: underline;
}

.rf-agree.is-gated {
    opacity: 0.72;
    cursor: not-allowed;
}

.rf-agree.is-gated input[type="checkbox"] {
    cursor: not-allowed;
}

.rf-agree-tip {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 5;
    padding: .5rem .75rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: .78rem;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.rf-agree-tip::after {
    content: '';
    position: absolute;
    left: 1.25rem;
    bottom: -5px;
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.82) transparent transparent;
}

.rf-agree.is-gated:hover .rf-agree-tip,
.rf-agree.is-gated:focus-within .rf-agree-tip {
    display: block;
}

.rf-agree.is-gated a {
    pointer-events: auto;
    cursor: pointer;
}

.rf-actions {
    display: flex;
    justify-content: center;
    gap: .75rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.rf-btn {
    min-width: 120px;
    padding: .7rem 1.5rem;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
}

.rf-btn-primary {
    background: #FFF000;
    border-color: #111;
    color: #111;
}

.rf-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.rf-error {
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border-radius: 8px;
    background: #fff1f0;
    border: 1px solid #ffccc7;
    color: #a8071a;
    font-size: .92rem;
}

.rf-notice {
    margin: 0 0 1rem;
    padding: .85rem 1rem;
    border-radius: 10px;
    background: #fffdf0;
    border: 1px solid #f0e6a0;
    color: #5c5200;
    font-size: .88rem;
}

/* Modal */
.rf-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.rf-modal-overlay.is-open {
    display: flex;
}

.rf-modal {
    width: min(96vw, 720px);
    max-height: min(88vh, 760px);
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
}

.rf-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #ececec;
}

.rf-modal-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #111;
}

.rf-modal-close {
    border: none;
    background: none;
    font-size: 1.35rem;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: .25rem;
}

.rf-modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .75rem 1rem 0;
}

.rf-modal-tab {
    display: inline-block;
    padding: .45rem .8rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #333;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}

.rf-modal-tab.is-active {
    background: #FFF000;
    border-color: #111;
    color: #111;
}

.rf-modal-body {
    flex: 1;
    overflow: auto;
    margin: .75rem 1rem 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: #fafafa;
}

.rf-modal-body .terms-article {
    color: #222;
    font-size: .92rem;
    line-height: 1.85;
}

.rf-modal-body .terms-article h1 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 900;
    color: #111;
    text-align: center;
}

.rf-modal-body .terms-article h2 {
    margin: 1.2rem 0 .55rem;
    font-size: 1rem;
    font-weight: 800;
    color: #111;
}

.rf-modal-body .terms-article p {
    margin: 0 0 .75rem;
    color: #333;
}

.rf-modal-foot {
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid #f0f0f0;
}

.rf-modal-hint {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    color: #999;
    text-align: center;
}

.rf-modal-confirm {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: #FFF000;
    color: #111;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
}

.rf-modal-confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rf-modal-tab.is-read::after {
    content: ' ✓';
    color: #2e7d32;
}

@media (max-width: 640px) {
    .rf-field {
        grid-template-columns: 1fr;
    }

    .rf-field > label {
        text-align: left;
        padding-top: 0;
    }

    .rf-category-row {
        grid-template-columns: 1fr;
    }

    .rf-stepper-item {
        min-width: 72px;
    }

    .rf-step-label {
        font-size: .75rem;
    }
}
