/* ===== ขั้นตอนสมัครสมาชิก / ยืนยันตัวตน (ใช้ร่วมกันทุกหน้า) =====
   markup มาจาก application/views/form_register/_register_steps.php
   สีหลักอิงธีม tenant (--theme-color-primary) ถ้า tenant ไม่ได้ประกาศไว้ใช้สีน้ำเงินแทน
   prefix rgs- เพื่อไม่ชนกับ .item-timeline / .timeline-step ของ template.css และ event */

.rgs {
    --rgs-primary: var(--theme-color-primary, #007bff);
    --rgs-muted: #D1D5DB;
    display: flex;
    list-style: none;
    margin: 6px 0 2px;
    padding: 0;
    counter-reset: none;
}

.rgs-step {
    flex: 1 1 0;
    position: relative;
    min-width: 0;
    text-align: center;
}

/* เส้นเชื่อมจากขั้นก่อนหน้ามาถึงขั้นนี้ */
.rgs-step:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 17px;
    right: 50%;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--rgs-muted);
    z-index: 0;
    transition: background-color .3s ease;
}

.rgs-step.is-done::before,
.rgs-step.is-active::before {
    background: var(--rgs-primary);
}

.rgs-dot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    border-radius: 50%;
    border: 2px solid var(--rgs-muted);
    background: #FFFFFF;
    color: #9CA3AF;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition: all .3s ease;
}

.rgs-dot svg {
    width: 16px;
    height: 16px;
}

.rgs-label {
    display: block;
    padding: 0 4px;
    font-size: 13px;
    line-height: 1.35;
    color: #9CA3AF;
    word-break: break-word;
}

/* ผ่านแล้ว */
.rgs-step.is-done .rgs-dot {
    background: var(--rgs-primary);
    border-color: var(--rgs-primary);
    color: #FFFFFF;
}

.rgs-step.is-done .rgs-label {
    color: #4B5563;
}

/* กำลังทำ — วงแหวนรอบ ๆ ให้เด่นกว่าขั้นอื่น */
.rgs-step.is-active .rgs-dot {
    background: var(--rgs-primary);
    border-color: var(--rgs-primary);
    color: #FFFFFF;
    box-shadow: 0 0 0 4px #FFFFFF, 0 0 0 6px var(--rgs-primary);
}

.rgs-step.is-active .rgs-label {
    color: var(--rgs-primary);
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .rgs-step:not(:first-child)::before {
        top: 15px;
    }

    .rgs-dot {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .rgs-dot svg {
        width: 14px;
        height: 14px;
    }

    .rgs-label {
        font-size: 12px;
    }

    /* 4 ขั้น (temp flow) พื้นที่ต่อขั้นแคบ ห้ามตัดคำกลางคำ เช่น "ยืนยันตัว / ตน" */
    .rgs-n4 .rgs-label {
        padding: 0 1px;
        font-size: 11px;
        white-space: nowrap;
        letter-spacing: -.2px;
    }
}
