/* frontend.css — v1.4.0 */
.bpa-form-container { direction: rtl; font-family: Tahoma, Arial, sans-serif; max-width: 750px; margin: 0 auto; padding: 20px; }
.bpa-plan-form .bpa-form-group { margin-bottom: 18px; }
.bpa-plan-form label { display: block; font-weight: bold; margin-bottom: 6px; color: #34495e; }
.bpa-plan-form input,
.bpa-plan-form select,
.bpa-plan-form textarea { width: 100%; padding: 10px 14px; border: 1px solid #dce1e7; border-radius: 6px; font-size: 14px; font-family: inherit; transition: border-color .2s; box-sizing: border-box; }
.bpa-plan-form input:focus,
.bpa-plan-form select:focus,
.bpa-plan-form textarea:focus { border-color: #3498db; outline: none; box-shadow: 0 0 0 3px rgba(52,152,219,.15); }
.bpa-field-error { border-color: #e74c3c !important; }
.bpa-plan-form textarea { min-height: 90px; resize: vertical; }
.bpa-submit-btn { background: linear-gradient(135deg,#3498db,#2980b9); color: #fff; border: none; padding: 13px 35px; border-radius: 7px; font-size: 16px; cursor: pointer; font-family: inherit; width: 100%; margin-top: 8px; transition: opacity .2s; }
.bpa-submit-btn:hover { opacity: .9; }

/* ─── مراحل ────────────────────────── */
.bpa-step-generation { direction: rtl; font-family: Tahoma, Arial, sans-serif; }
.bpa-progress-header { background: linear-gradient(135deg,#2c3e50,#3498db); color: #fff; padding: 22px 28px; border-radius: 10px; margin-bottom: 20px; }
.bpa-progress-header h3 { margin: 0 0 12px; font-size: 18px; }
.bpa-progress-bar { background: rgba(255,255,255,.25); border-radius: 20px; height: 10px; overflow: hidden; }
.bpa-progress-fill { height: 100%; background: #2ecc71; border-radius: 20px; transition: width .5s ease; }
.bpa-progress-text { margin: 8px 0 0; font-size: 13px; opacity: .85; }

.bpa-steps-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.bpa-step-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f8f9fa; border: 2px solid #e9ecef; border-radius: 30px; font-size: 13px; transition: all .3s; }
.bpa-step-icon { position: relative; width: 26px; height: 26px; }
.bpa-step-num,
.bpa-step-ok,
.bpa-step-spin { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 12px; font-weight: bold; transition: opacity .3s; }
.bpa-step-num { background: #dee2e6; color: #495057; opacity: 1; }
.bpa-step-ok { background: #2ecc71; color: #fff; opacity: 0; }
.bpa-step-spin { border: 3px solid #dee2e6; border-top-color: #3498db; animation: bpa-spin 1s linear infinite; opacity: 0; }
@keyframes bpa-spin { to { transform: rotate(360deg); } }

/* حالت loading */
.bpa-step-item.bpa-loading { border-color: #3498db; background: #e8f4fd; }
.bpa-step-item.bpa-loading .bpa-step-num { opacity: 0; }
.bpa-step-item.bpa-loading .bpa-step-spin { opacity: 1; }

/* حالت تمام‌شده */
.bpa-step-item.bpa-completed { border-color: #2ecc71; background: #eafaf1; }
.bpa-step-item.bpa-completed .bpa-step-num { opacity: 0; }
.bpa-step-item.bpa-completed .bpa-step-ok { opacity: 1; }

/* حالت خطا */
.bpa-step-item.bpa-error { border-color: #e74c3c; background: #fdf2f2; }
.bpa-step-item.bpa-error .bpa-step-num { background: #e74c3c; color: #fff; }

/* ─── Spinner ──────────────────────── */
.bpa-step-spinner { text-align: center; padding: 35px 20px; background: #f8f9fa; border-radius: 10px; margin-bottom: 15px; border: 2px dashed #dee2e6; }
.bpa-spinner-ring { display: inline-block; width: 50px; height: 50px; border: 5px solid #dee2e6; border-top-color: #3498db; border-radius: 50%; animation: bpa-spin 1s linear infinite; }
.bpa-spinner-msg { margin: 14px 0 0; color: #666; font-size: 14px; line-height: 1.6; }

/* ─── پیش‌نمایش مرحله ─────────────── */
.bpa-step-preview { background: #fff; border: 1px solid #e9ecef; border-radius: 10px; padding: 20px 24px; margin-bottom: 14px; border-right: 4px solid #2ecc71; }
.bpa-step-preview h4 { margin: 0 0 12px; color: #27ae60; font-size: 15px; }
.bpa-preview-body { color: #555; font-size: 14px; line-height: 1.8; user-select: none; -webkit-user-select: none; }
.bpa-preview-note { font-size: 12px; color: #999; background: #f8f9fa; padding: 8px 12px; border-radius: 5px; margin: 12px 0 0; }

/* ─── خطا ──────────────────────────── */
.bpa-step-error { background: #fdf2f2; border: 1px solid #f5c6cb; border-radius: 10px; padding: 20px 24px; margin-bottom: 14px; border-right: 4px solid #e74c3c; }
.bpa-step-error h4 { color: #c0392b; margin: 0 0 10px; font-size: 15px; }
.bpa-err-msg { color: #555; font-size: 14px; margin: 0 0 14px; }
.bpa-retry-btn { background: #e74c3c; color: #fff; border: none; padding: 9px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; font-family: inherit; transition: background .2s; }
.bpa-retry-btn:hover { background: #c0392b; }

/* ─── سوال بین مراحل ──────────────── */
.bpa-step-actions { background: linear-gradient(135deg,#f8f9fa,#e9ecef); border: 1px solid #dee2e6; border-radius: 10px; padding: 22px 24px; text-align: center; margin-top: 16px; }
.bpa-step-question { font-size: 16px; color: #2c3e50; font-weight: bold; margin: 0 0 16px; }
.bpa-action-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bpa-btn { padding: 11px 28px; border: none; border-radius: 7px; font-size: 15px; cursor: pointer; font-family: inherit; transition: all .2s; }
.bpa-btn-success { background: #2ecc71; color: #fff; }
.bpa-btn-success:hover { background: #27ae60; }
.bpa-btn-secondary { background: #95a5a6; color: #fff; }
.bpa-btn-secondary:hover { background: #7f8c8d; }

/* ─── پیام پایان ─────────────────── */
.bpa-done-msg { background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; padding: 30px; border-radius: 12px; text-align: center; margin: 20px 0; }
.bpa-done-msg h2 { color: #fff; margin: 0 0 10px; }

/* ─── مودال پرداخت ─────────────────── */
.bpa-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 99999; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; }
.bpa-modal-overlay.bpa-modal-show { opacity: 1; }
.bpa-modal-box { background: #fff; border-radius: 14px; padding: 36px 32px; max-width: 480px; width: 90%; text-align: center; position: relative; direction: rtl; transform: scale(.92); transition: transform .3s; }
.bpa-modal-overlay.bpa-modal-show .bpa-modal-box { transform: scale(1); }
.bpa-modal-close { position: absolute; top: 14px; left: 14px; background: none; border: none; font-size: 24px; cursor: pointer; color: #999; line-height: 1; padding: 0 6px; }
.bpa-modal-icon { font-size: 48px; margin-bottom: 12px; }
.bpa-modal-box h2 { margin: 0 0 10px; color: #2c3e50; font-size: 20px; }
.bpa-modal-box p { color: #555; margin: 0 0 18px; line-height: 1.7; }
.bpa-modal-list { list-style: none; margin: 0 0 22px; padding: 0; text-align: right; }
.bpa-modal-list li { padding: 6px 0; color: #27ae60; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.bpa-btn-pay { background: linear-gradient(135deg,#2ecc71,#27ae60); color: #fff; width: 100%; font-size: 16px; padding: 13px; border-radius: 8px; margin-bottom: 10px; font-weight: bold; }
.bpa-btn-pay:hover { opacity: .9; }
.bpa-btn-later { background: #f8f9fa; color: #666; border: 1px solid #dee2e6; width: 100%; font-size: 14px; padding: 10px; border-radius: 8px; }
.bpa-btn-later:hover { background: #e9ecef; }

/* ─── ریسپانسیو ──────────────────── */
@media (max-width: 600px) {
    .bpa-steps-list { gap: 6px; }
    .bpa-step-item { padding: 6px 10px; font-size: 12px; }
    .bpa-action-buttons { flex-direction: column; }
    .bpa-btn { width: 100%; }
}
