/* =============================================================================
 *  register.css — فرم چندمرحله‌ای ثبت درخواست
 * ========================================================================== */

/* --------------------------------------------------------- سربرگ صفحه */
.page-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.page-head-row .page-title,
.page-head-row .page-sub { text-align: start; margin: 0; }
.page-head-row .page-title { margin-bottom: 6px; }
.page-head-row .page-sub   { margin-bottom: 24px; }

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    margin-top: 16px;
    padding: 9px 16px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    transition: .16s;
}
.btn-back-home:hover {
    border-color: rgba(255, 178, 0, .5);
    color: var(--gold);
    background: rgba(255, 178, 0, .06);
}
.btn-back-home i { font-size: 13px; }

@media (max-width: 640px) {
    .page-head-row { flex-direction: column; }
    .btn-back-home { margin-top: 0; align-self: stretch; justify-content: center; }
}

#formBox {
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px 24px;
}

/* ------------------------------------------------------------ نوار مرحله */
.stepper {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 2px 12px;
    margin-bottom: 8px;
    scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }

.stepDot {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 72px;
    opacity: .45;
    transition: opacity .2s;
}

.dotCircle {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #100d33;
    color: var(--muted);
    font-size: 13px;
    position: relative;
}
.dotCircle i { font-size: 13px; }
.dotCircle b { display: none; }

.dotLabel { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.stepDot.done    { opacity: .85; }
.stepDot.done .dotCircle    { border-color: rgba(46,204,113,.5); color: #7bf0a8; }
.stepDot.current { opacity: 1; }
.stepDot.current .dotCircle {
    border-color: var(--gold);
    background: rgba(255,178,0,.14);
    color: var(--gold);
    box-shadow: 0 0 0 4px rgba(255,178,0,.10);
}
.stepDot.current .dotLabel { color: var(--gold); }

/* ------------------------------------------------------------ نوار درصد */
.progress {
    height: 8px;
    background: #100d33;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 22px;
}
#progressBar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #ffc02e, var(--gold));
    border-radius: 999px;
    transition: width .32s cubic-bezier(.4,0,.2,1);
    position: relative;
}
#progressText {
    position: absolute;
    inset-inline-end: 6px;
    top: -21px;
    font-size: 10.5px;
    color: var(--gold);
}

/* ------------------------------------------------------------- مرحله‌ها */
.step { display: none; }
.step.active {
    display: block;
    animation: stepIn .28s ease both;
}
@keyframes stepIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.step h3 {
    margin: 0 0 4px;
    color: var(--gold);
    font-size: 17px;
}
.step-sub {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 12.8px;
}

/* -------------------------------------------------------- پیشوند ورودی
 * فیلد آدرس سایت: «//:https» ثابت و غیرقابل تغییر، و متنِ کاربر بعد از آن.
 * کل ردیف LTR می‌شود چون یک نشانی اینترنتی است — در چیدمان راست‌به‌چپ،
 * پیشوند سمت راست می‌افتاد و ترتیبِ خواندن نشانی به‌هم می‌ریخت.
 * ------------------------------------------------------------------------ */
.field-row.prefixed {
    display: flex;
    align-items: stretch;
    direction: ltr;
}

.field-row.prefixed .input-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: #0b0920;
    border: 1px solid var(--line);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--gold-soft);
    font-size: 13.5px;
    white-space: nowrap;
    user-select: none;
}

.field-row.prefixed input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    flex: 1;
    min-width: 0;
}

/* برچسب شناور همیشه بالای سمت راستِ کادر (سمتِ فارسیِ صفحه) می‌نشیند */
.field-row.prefixed label {
    left: auto;
    right: 12px;
    direction: rtl;
}
.field-row.prefixed input:focus + label,
.field-row.prefixed input:not(:placeholder-shown) + label,
.field-row.prefixed:focus-within > label,
.field-row.prefixed.is-filled > label,
.field-row.prefixed.has-error > label {
    top: -9px;
    font-size: 11.5px;
    color: var(--gold);
    background: var(--card);
    border-radius: 6px;
}

/* --------------------------------------------------------- گروه فیلدها */
.field-group {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 14px 14px;
    margin: 0 0 20px;
    position: relative;
    background: rgba(16, 13, 51, .5);
}

.field-group-title {
    position: absolute;
    top: -10px;
    inset-inline-start: 12px;
    background: var(--card);
    padding: 0 8px;
    font-size: 12px;
    color: var(--gold);
}

.group-hint { color: var(--muted); font-size: 11.5px; margin-top: 8px; }

/* ------------------------------------------------- سریال شناسنامه */
.serial-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    direction: ltr;
}

.serial-cell { flex: 1; text-align: center; }
.serial-cell.serial-num1 { flex: 2.2; }
.serial-cell.serial-char { flex: 1.3; }
.serial-cell.serial-num2 { flex: 1.1; }

.serial-cell input {
    width: 100%;
    background: #100d33;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 8px;
    font: inherit;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    direction: ltr;
}
.serial-cell.serial-char input {
    direction: rtl;
    letter-spacing: 0;
    cursor: pointer;
    color: var(--gold);
    font-weight: 700;
}
.serial-cell input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255,178,0,.14);
}
.serial-cell small {
    display: block;
    margin-top: 5px;
    font-size: 10.5px;
    color: var(--muted);
}

.serial-sep {
    color: var(--muted);
    font-size: 19px;
    line-height: 44px;
    padding: 0 1px;
}

.serial-err {
    color: #ff8b80;
    font-size: 12.5px;
    margin-top: 8px;
    min-height: 1px;
}

/* ------------------------------------------------------------ آی‌پی‌ها */
.ip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.ip-row input {
    flex: 1;
    background: #100d33;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 12px;
    font: inherit;
    font-size: 15.5px;
    direction: ltr;
    text-align: center;
    letter-spacing: 1.5px;
    outline: none;
    font-variant-numeric: tabular-nums;
}
.ip-row input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255,178,0,.14);
}
.ip-row input.input-error { border-color: var(--err); }

.ip-del {
    width: 40px;
    height: 44px;
    flex: 0 0 40px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: #ff8b80;
    font-size: 15px;
}
.ip-del:hover { border-color: var(--err); background: rgba(231,76,60,.1); }

.add-ip-btn {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--line);
    color: var(--gold);
    padding: 11px;
    font-size: 13.5px;
}
.add-ip-btn:hover { border-color: var(--gold); background: rgba(255,178,0,.07); }
.add-ip-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------ شمارنده شبا */
.iban-counter {
    display: block;
    color: var(--gold);
    font-size: 12px;
    margin: -14px 2px 18px;
}
.iban-counter.error   { color: #ff8b80; }
.iban-counter.success { color: #7bf0a8; }

/* --------------------------------------------------------- پیش‌نمایش */
#previewBox {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

#previewBox.loading-center {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.preview-section {
    grid-column: 1 / -1;
    color: var(--gold);
    font-size: 13.5px;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
    margin-top: 8px;
}

.previewItem {
    background: #100d33;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.previewItem span {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    margin-bottom: 3px;
}
.previewItem p {
    margin: 0;
    font-size: 14px;
    word-break: break-word;
}
.previewItem.ltr p { direction: ltr; text-align: right; }

/* --------------------------------------------------------- بنر ویرایش */
.edit-banner {
    background: rgba(231, 76, 60, .1);
    border: 1px solid rgba(231, 76, 60, .35);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
}
.edit-banner-head {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #ffb3ab;
    margin-bottom: 8px;
}
.reject-reason {
    color: var(--text);
    background: rgba(0,0,0,.25);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
}
.edit-banner-foot { color: var(--muted); font-size: 12.5px; margin-top: 9px; }

/* ------------------------------------------------- صفحه‌ی موفقیت */
.success-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}
.success-actions .full { grid-column: 1 / -1; }

.act-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--line);
    background: #100d33;
    color: var(--text);
    text-align: center;
    transition: .18s;
}
.act-btn:hover { border-color: var(--gold); color: var(--gold); }
.act-btn.primary {
    background: linear-gradient(180deg, #ffc02e, var(--gold));
    color: #17130a;
    border-color: transparent;
}
.act-btn.primary:hover { filter: brightness(1.06); color: #17130a; }
.act-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ------------------------------------------------- بنر مدارک لازم */
.docs-banner {
    background: rgba(255, 178, 0, .07);
    border: 1px solid rgba(255, 178, 0, .28);
    border-radius: var(--radius);
    padding: 18px;
    margin-top: 18px;
    text-align: right;
}
.docs-banner h4 {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: 14.5px;
}
.docs-banner ul { margin: 0; padding-inline-start: 20px; }
.docs-banner li {
    color: var(--text);
    font-size: 13.5px;
    margin-bottom: 7px;
    line-height: 1.9;
}
.docs-banner li small { color: var(--muted); font-size: 11.5px; }

/* «فرم قرارداد ۴ برگی» آخرین قلمِ هر بنر است و کمی برجسته‌تر، چون تنها
   قلمی است که کاربر باید خودش بسازد نه اینکه از قبل داشته باشد. */
.docs-banner li.doc-contract {
    color: var(--gold);
    font-weight: 700;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed rgba(255, 178, 0, .3);
    list-style: none;
    margin-inline-start: -20px;
}
.docs-banner li.doc-contract::before {
    content: "\f573";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    margin-inline-end: 8px;
}

/* ---------------------------------------------------------------------------
 *  هشدارِ امضا و مهر
 *
 *  این جمله تنها چیزی است که اگر خوانده نشود، کلِ پرونده برمی‌گردد: فرمِ
 *  بدون امضا و مهر پذیرفته نمی‌شود. پس بالای فهرست مدارک می‌نشیند و رنگ
 *  هشدار می‌گیرد، نه اینکه یک قلم دیگر لای همان فهرست باشد.
 * ------------------------------------------------------------------------ */
.alert-strong {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(231, 76, 60, .12);
    border: 1px solid rgba(231, 76, 60, .5);
    border-inline-start: 4px solid var(--err);
    border-radius: var(--radius);
    padding: 15px 17px;
    margin-top: 18px;
}
.alert-strong i {
    color: #ff6b5c;
    font-size: 18px;
    margin-top: 3px;
    flex: 0 0 auto;
}
.alert-strong p {
    margin: 0;
    color: #ff9c92;
    font-size: 14px;
    font-weight: 700;
    line-height: 2.1;
}
.alert-strong .alert-note {
    color: #ffd27a;
    font-weight: 800;
}

.docs-banner.legal {
    background: rgba(90, 120, 255, .07);
    border-color: rgba(120, 140, 255, .3);
}
.docs-banner.legal h4 { color: #a9b6ff; }

/* ------------------------------------------------------------ موبایل */
@media (max-width: 560px) {
    #formBox { padding: 16px 13px 20px; }
    .success-actions { grid-template-columns: 1fr; }
    .stepDot { min-width: 62px; }
    #previewBox { grid-template-columns: 1fr; }
    .serial-cell input { font-size: 15px; padding: 11px 4px; letter-spacing: 1px; }
}
