/* ===================================================================
   فرم ثبت سفارش (order.blade.php) - از همون متغیرهای رنگی project.css استفاده می‌کنه
   =================================================================== */

/* ---------- استپر مراحل (مطابق عکس نمونه) ---------- */
.order-stepper {
    display: flex;
    align-items: center;
    max-width: 720px;
    margin: 0 auto 36px;
    padding: 0 8px;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.stepper-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    background: #fff;
    border: 2px solid var(--line);
    color: var(--muted);
    transition: all .2s ease;
}

.stepper-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.stepper-step.active .stepper-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #201F1D;
}

.stepper-step.active .stepper-label {
    color: var(--text);
    font-weight: 800;
}

.stepper-step.completed .stepper-circle {
    background: var(--steel);
    border-color: var(--steel);
    color: #fff;
}

.stepper-step.completed .stepper-label {
    color: var(--text);
}

.stepper-line {
    flex: 1;
    height: 2px;
    background: var(--line);
    margin: 0 6px;
    margin-bottom: 26px; /* هم‌ردیف با مرکز دایره‌ها */
    transition: background .2s ease;
}

.stepper-line.filled {
    background: var(--steel);
}

/* ---------- فرم و صفحه‌های داخلش ---------- */
.order-form {
    max-width: 720px;
    margin: 0 auto;
    border: 1px solid var(--line);
    padding: 32px;
    background: var(--panel);
}

.step-page.hidden {
    display: none;
}

.type-panel.hidden {
    display: none;
}

.hidden {
    display: none;
}

.step-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--steel);
}

/* ---------- کارت‌های انتخاب (با نقشه / بدون نقشه) ---------- */
.choice-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .choice-cards {
        grid-template-columns: 1fr;
    }
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    border: 1px solid var(--line);
    padding: 20px;
    cursor: pointer;
    transition: all .15s ease;
    position: relative;
}

.choice-card input {
    position: absolute;
    top: 14px;
    left: 14px;
}

.choice-card:hover {
    border-color: var(--accent-dim);
}

.choice-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.choice-icon {
    font-size: 1.6rem;
}

.choice-title {
    font-weight: 700;
    font-size: 1rem;
}

.choice-desc {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ---------- تب‌های نوع کار ---------- */
.type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.type-tab {
    padding: 9px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid var(--line);
    background: #fff;
    transition: all .15s ease;
}

.type-tab:hover {
    border-color: var(--muted);
    color: var(--text);
}

.type-tab.active {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
}

/* ---------- فیلدها ---------- */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

.field input[type="file"] {
    width: 100%;
    font-size: 0.82rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

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

/* ---------- گروه‌های خم ---------- */
.bend-group {
    border: 1px dashed var(--line);
    padding: 16px;
    margin-bottom: 14px;
    background: var(--bg-soft);
}

.bend-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.remove-bend {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.8rem;
}

.btn-outline {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent-dim);
    color: var(--accent-dim);
}

/* ---------- خلاصه قیمت ---------- */
.price-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    padding: 16px 20px;
    font-size: 0.95rem;
}

#priceAmount {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-dim);
    transition: opacity .15s ease;
}

#priceAmount.loading {
    opacity: 0.4;
}

.price-note {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 10px;
}

.price-box-note {
    justify-content: center;
    text-align: center;
}

.price-box-note strong {
    font-size: 0.95rem;
}

/* ---------- OTP ---------- */
.otp-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.otp-row.hidden {
    display: none;
}

.otp-row input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 0.88rem;
}

.otp-status {
    font-size: 0.82rem;
    color: var(--muted);
    min-height: 18px;
}

.otp-status.error {
    color: var(--danger);
}

.otp-status.success {
    color: var(--steel);
}

/* ---------- دکمه‌های ناوبری بین مراحل ---------- */
.step-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.step-nav .next-btn,
.step-nav .prev-btn,
.step-nav #submitOrderBtn {
    flex: 1;
    justify-content: center;
}

.step-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* وقتی صفحه‌ی ۱ فقط یک دکمه‌ی next داره، تمام عرض بشه */
[data-page="1"] .step-nav {
    justify-content: flex-end;
}

[data-page="1"] .step-nav .next-btn {
    flex: 0 0 auto;
    min-width: 160px;
}

/* ---------- پیغام موفقیت نهایی ---------- */
.success-box {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--steel);
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 18px;
}

.success-box h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.success-box p {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 6px;
}

#successOrderNumber {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-dim);
    background: var(--accent-soft);
    padding: 8px 18px;
    border-radius: 4px;
    margin-bottom: 14px;
}

.success-note {
    margin-bottom: 24px !important;
}
