/* ============================================================
   SFB Frontend Form — Responsive RTL
   ============================================================ */

.sfb-form-wrapper {
    max-width: 680px;
    margin: 32px auto;
    direction: rtl;
    font-family: inherit;
}

.sfb-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.sfb-form-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

.sfb-form-description {
    color: #64748b;
    font-size: .93rem;
    margin-bottom: 24px;
    line-height: 1.7;
}

/* ─── Fields ───────────────────────────────────────────── */
.sfb-field {
    margin-bottom: 18px;
}

.sfb-field label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.sfb-field label span {
    color: #ef4444;
    margin-right: 2px;
}

.sfb-field input[type=text],
.sfb-field input[type=email],
.sfb-field input[type=tel],
.sfb-field input[type=number],
.sfb-field input[type=date],
.sfb-field select,
.sfb-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: .95rem;
    color: #1e293b;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border .2s, box-shadow .2s, background .2s;
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.sfb-field input:focus,
.sfb-field select:focus,
.sfb-field textarea:focus {
    outline: none;
    border-color: #5b6ef5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(91,110,245,.13);
}

.sfb-field textarea {
    min-height: 110px;
    resize: vertical;
}

/* ─── Submit button ────────────────────────────────────── */
.sfb-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 6px;
    transition: opacity .2s, transform .1s;
    font-family: inherit;
}

.sfb-submit:hover  { opacity: .9; }
.sfb-submit:active { transform: scale(.98); }

/* ─── Messages ─────────────────────────────────────────── */
.sfb-msg {
    display: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    margin-top: 14px;
    text-align: center;
}

.sfb-msg.success { background: #dcfce7; color: #16a34a; display: block; }
.sfb-msg.error   { background: #fee2e2; color: #dc2626; display: block; }

/* ─── Loading state ────────────────────────────────────── */
.sfb-submit.loading {
    opacity: .7;
    pointer-events: none;
}

/* ─── Radio / Checkbox groups ──────────────────────────── */
.sfb-radio-group,
.sfb-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sfb-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .92rem;
    color: #374151;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    transition: border .2s, background .2s;
}

.sfb-option-label:hover {
    border-color: #5b6ef5;
    background: #f0f2ff;
}

.sfb-option-label input { cursor: pointer; }

/* ─── Range ────────────────────────────────────────────── */
.sfb-range-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sfb-range {
    flex: 1;
    cursor: pointer;
    accent-color: #5b6ef5;
}

.sfb-range-val {
    font-weight: 700;
    color: #5b6ef5;
    min-width: 32px;
    text-align: center;
}

/* ─── Color input ───────────────────────────────────────── */
.sfb-color-input {
    width: 60px !important;
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    padding: 2px;
}

/* ─── Select ───────────────────────────────────────────── */
.sfb-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

/* ─── File input ───────────────────────────────────────── */
.sfb-field input[type=file] {
    padding: 8px;
    background: #f8fafc;
    cursor: pointer;
}

/* ─── Jalali datepicker ────────────────────────────────── */
.sfb-jalali-wrap { position: relative; }
.sfb-jalali-input { cursor: pointer !important; }

.sfb-jalali-cal .sfb-cal-day:hover {
    background: #eef2ff;
    color: #5b6ef5;
}

.sfb-jalali-cal {
    user-select: none;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
    .sfb-form { padding: 20px 16px; }
    .sfb-form-wrapper { margin: 16px; }
}
