/* فرم ثبت‌نام — ظاهر و وضعیت فیلدها */
.re-register.reg-form-modern {
    background: #fff;
    border: 1px solid #e6edf3;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
}

.reg-form-modern .reg-page-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.35rem;
}

.reg-form-modern .reg-page-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

.reg-form-modern .reg-section {
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 1rem 1rem 0.25rem;
    margin-bottom: 1.25rem;
    background: #fafbfc;
}

.reg-form-modern .reg-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e8eef4;
}

.reg-form-modern .reg-section-title .reg-section-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--primaryColor, #151f3e);
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.reg-form-modern .reg-fields {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.reg-form-modern .input-box,
.re-register.reg-form-modern .input-box {
    position: relative;
    width: 25%;
    padding: 0 0.5rem 2.6rem;
    margin-bottom: 0.75rem;
    min-height: 5.75rem;
}

.reg-form-modern .input-box.reg-span-2 {
    width: 50%;
}

.reg-form-modern .input-box.reg-span-3 {
    width: 75%;
}

.reg-form-modern .input-box.reg-span-full {
    width: 100%;
}

.reg-form-modern .input-box > label,
.reg-form-modern .input-box .reg-label {
    display: inline-block;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.35rem;
}

.reg-form-modern .req-star {
    color: #dc2626;
    margin-right: 0.15rem;
}

.reg-form-modern .form-control,
.reg-form-modern select.form-control {
    border: 1px solid #d1d9e2;
    border-radius: 8px;
    min-height: 42px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.reg-form-modern .form-control:focus {
    border-color: var(--primaryColor, #151f3e);
    box-shadow: 0 0 0 3px rgba(21, 31, 62, 0.12);
    outline: none;
}

.reg-form-modern .form-control.reg-field-locked,
.reg-form-modern input[readonly].reg-field-locked {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.reg-form-modern .form-control.reg-field-locked:focus {
    border-color: #d1d9e2;
    box-shadow: none;
}

.reg-form-modern .input-validation-error,
.reg-form-modern .form-control.input-validation-error,
.reg-form-modern select.input-validation-error {
    border-color: #dc2626 !important;
    background-color: #fff8f8;
}

.reg-form-modern .form-control.valid:not(.input-validation-error),
.reg-form-modern select.valid:not(.input-validation-error) {
    border-color: #16a34a;
}

/* پیام اعتبارسنجی داخل فضای رزرو‌شده زیر فیلد — بدون جابه‌جا کردن سکشن بعدی */
.reg-form-modern .input-box > .field-validation-error,
.reg-form-modern .input-box > .field-validation-valid,
.reg-form-modern .input-box > span.text-danger,
.reg-form-modern .input-box > [data-valmsg-for] {
    position: absolute;
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.35rem;
    display: block;
    font-size: 0.78rem;
    line-height: 1.3;
    margin: 0;
    min-height: 2.1rem;
    max-height: 2.1rem;
    overflow: hidden;
    color: #dc2626 !important;
}

.reg-form-modern .input-box > .field-validation-valid:empty,
.reg-form-modern .input-box > .field-validation-valid[data-valmsg-replace] {
    color: transparent !important;
}

.reg-form-modern .reg-field-hint {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.reg-form-modern .input-box > .reg-field-hint {
    position: absolute;
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.35rem;
    margin: 0;
    min-height: 2.1rem;
    max-height: 2.1rem;
    overflow: hidden;
    line-height: 1.3;
}

/* اگر هم hint و هم validation وجود دارد، validation روی hint می‌نشیند */
.reg-form-modern .input-box > .reg-field-hint + .field-validation-error,
.reg-form-modern .input-box > .reg-field-hint + .field-validation-valid,
.reg-form-modern .input-box > .reg-field-hint + span.text-danger,
.reg-form-modern .input-box > .reg-field-hint + [data-valmsg-for] {
    bottom: 0.15rem;
}

.reg-form-modern .reg-field-success {
    display: none;
    font-size: 0.78rem;
    color: #16a34a;
    margin-top: 0.3rem;
}

.reg-form-modern .reg-field-success.is-visible {
    display: block;
}

.reg-form-modern .input-group.reg-password-group {
    border: 1px solid #d1d9e2;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.reg-form-modern .input-group.reg-password-group .form-control {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
}

.reg-form-modern .input-group.reg-password-group.is-invalid {
    border-color: #dc2626;
}

.reg-form-modern .input-group.reg-password-group.is-valid {
    border-color: #16a34a;
}

.reg-form-modern .reg-password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    color: #6b7280;
    text-decoration: none !important;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.reg-form-modern .reg-password-toggle:hover,
.reg-form-modern .reg-password-toggle:focus {
    color: #111827;
    outline: none;
}

.reg-form-modern .password-strength {
    margin-top: 0.55rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eef2f6;
}

.reg-form-modern .password-strength-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 0.4rem;
}

.reg-form-modern .password-strength-meter {
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin-bottom: 0.55rem;
}

.reg-form-modern .password-strength-meter > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.reg-form-modern .password-strength-meter.is-weak > span { width: 25%; background: #ef4444; }
.reg-form-modern .password-strength-meter.is-fair > span { width: 50%; background: #f59e0b; }
.reg-form-modern .password-strength-meter.is-good > span { width: 75%; background: #3b82f6; }
.reg-form-modern .password-strength-meter.is-strong > span { width: 100%; background: #16a34a; }

.reg-form-modern .password-rules {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reg-form-modern .password-rules li {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.reg-form-modern .password-rules li::before {
    content: "✗";
    color: #ef4444;
    font-weight: 700;
}

.reg-form-modern .password-rules li.is-met {
    color: #15803d;
}

.reg-form-modern .password-rules li.is-met::before {
    content: "✓";
    color: #16a34a;
}

.reg-form-modern .reg-gender-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    min-height: 42px;
    align-items: center;
    padding-top: 0.25rem;
}

.reg-form-modern .reg-gender-group .form-check-inline {
    margin: 0;
}

.reg-form-modern .reg-terms {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e8eef4;
    margin-bottom: 1rem;
}

.reg-form-modern .reg-terms input[type="checkbox"] {
    margin-top: 0.3rem;
    flex-shrink: 0;
}

.reg-form-modern .reg-terms p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #374151;
}

.reg-form-modern .reg-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.reg-form-modern .auth-code-group {
    border: 0 !important;
    background: transparent;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reg-form-modern .auth-code-group .form-control {
    flex: 1 1 140px;
}

.reg-form-modern .auth-code-group .send-code {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 110px;
}

@media (max-width: 1199px) {
    .reg-form-modern .input-box,
    .re-register.reg-form-modern .input-box {
        width: 33.333%;
    }

    .reg-form-modern .input-box.reg-span-2 {
        width: 66.666%;
    }
}

@media (max-width: 991px) {
    .reg-form-modern .input-box,
    .re-register.reg-form-modern .input-box,
    .reg-form-modern .input-box.reg-span-2,
    .reg-form-modern .input-box.reg-span-3 {
        width: 50%;
    }
}

@media (max-width: 575px) {
    .reg-form-modern .input-box,
    .re-register.reg-form-modern .input-box,
    .reg-form-modern .input-box.reg-span-2,
    .reg-form-modern .input-box.reg-span-3,
    .reg-form-modern .input-box.reg-span-full {
        width: 100%;
        min-height: 0;
        padding-bottom: 2.6rem;
    }

    .reg-form-modern .reg-section {
        padding: 0.85rem 0.75rem 0.15rem;
    }

    .reg-form-modern .reg-actions .se-button {
        width: 100%;
    }
}
