/* ═══════════ صفحهٔ عمومی فرم (/f/{slug}) — پیشوند mff- ═══════════ */

.mff {
    --mff-accent: #6d5ef1;
    min-height: 100vh;
    background: #f3f4f8;
    font-family: inherit;
}

/* ── هدر گرادیانی ── */
.mff-hero {
    position: relative;
    padding: 52px 20px 96px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--mff-accent) 0%, color-mix(in srgb, var(--mff-accent) 55%, #0f172a) 100%);
    overflow: hidden;
}
.mff-hero::before,
.mff-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}
.mff-hero::before { width: 340px; height: 340px; top: -140px; inset-inline-start: -100px; }
.mff-hero::after { width: 240px; height: 240px; bottom: -110px; inset-inline-end: -70px; }
.mff-hero > * { position: relative; }

.mff-logo {
    width: 72px; height: 72px;
    border-radius: 20px;
    object-fit: cover;
    margin: 0 auto 14px;
    background: rgba(255, 255, 255, .15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    display: flex; align-items: center; justify-content: center;
}
.mff-logo i { font-size: 34px; }
.mff-org {
    display: inline-block;
    font-size: 12px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: 3px 14px;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
}
.mff-hero h1 { font-size: 24px; font-weight: 700; margin: 0 0 10px; }
.mff-hero p { max-width: 640px; margin: 0 auto; font-size: 14px; line-height: 1.9; opacity: .92; white-space: pre-line; }
.mff-badge {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px; font-size: 12px;
    background: rgba(0, 0, 0, .18); border-radius: 999px; padding: 4px 14px;
}

/* ── کارت فرم ── */
.mff-card {
    position: relative;
    width: min(680px, calc(100% - 32px));
    margin: -64px auto 56px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .10), 0 2px 8px rgba(15, 23, 42, .06);
    padding: 36px 34px 30px;
}

.mff-progress {
    position: sticky; top: 0; z-index: 2;
    margin: -36px -34px 24px;
    padding: 14px 34px 10px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(6px);
    border-radius: 18px 18px 0 0;
    border-bottom: 1px solid #eef0f5;
}
.mff-progress-track { height: 5px; border-radius: 999px; background: #eceef4; overflow: hidden; }
.mff-progress-bar { height: 100%; border-radius: 999px; background: var(--mff-accent); transition: width .35s ease; }
.mff-progress-label { font-size: 11px; color: #8a8fa3; margin-top: 6px; text-align: center; }

/* ── فیلدها ── */
.mff-field { margin-bottom: 22px; }
.mff-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 14px; font-weight: 600; color: #1e2235;
    margin-bottom: 8px;
}
.mff-label .mff-req { color: #e5484d; font-weight: 700; }
.mff-label .mff-type-ic { color: var(--mff-accent); font-size: 15px; opacity: .8; }
.mff-help { font-size: 11.5px; color: #8a8fa3; margin: -3px 0 8px; }

.mff-input,
.mff-textarea,
.mff-select {
    width: 100%;
    border: 1.5px solid #e2e5ee;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #1e2235;
    background: #fbfbfe;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.mff-input:focus,
.mff-textarea:focus,
.mff-select:focus {
    outline: none;
    border-color: var(--mff-accent);
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mff-accent) 14%, transparent);
}
.mff-textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.mff-select { appearance: none; cursor: pointer; padding-inline-end: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: left 14px center; }
.mff-input.err, .mff-textarea.err, .mff-select.err { border-color: #e5484d; }
.mff-err { display: flex; align-items: center; gap: 5px; color: #e5484d; font-size: 12px; margin-top: 6px; }

/* گزینه‌ها — رادیو به‌صورت کارت، چک‌باکس به‌صورت چیپ */
.mff-opts { display: flex; flex-direction: column; gap: 9px; }
.mff-opt {
    display: flex; align-items: center; gap: 11px;
    border: 1.5px solid #e2e5ee; border-radius: 12px;
    padding: 11px 14px; cursor: pointer;
    font-size: 14px; color: #34384e;
    background: #fbfbfe;
    transition: border-color .15s, background .15s, box-shadow .15s;
    user-select: none;
}
.mff-opt:hover { border-color: color-mix(in srgb, var(--mff-accent) 55%, #e2e5ee); }
.mff-opt.on {
    border-color: var(--mff-accent);
    background: color-mix(in srgb, var(--mff-accent) 7%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mff-accent) 12%, transparent);
}
.mff-opt .mff-dot {
    flex-shrink: 0; width: 19px; height: 19px; border-radius: 50%;
    border: 2px solid #c6cadd; display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s;
}
.mff-opt.on .mff-dot { border-color: var(--mff-accent); }
.mff-opt.on .mff-dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--mff-accent); }
.mff-opt .mff-box {
    flex-shrink: 0; width: 19px; height: 19px; border-radius: 6px;
    border: 2px solid #c6cadd; display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; transition: all .15s;
}
.mff-opt.on .mff-box { border-color: var(--mff-accent); background: var(--mff-accent); }
.mff-opt .mff-box i { display: none; }
.mff-opt.on .mff-box i { display: block; }

/* بله/خیر */
.mff-yesno { display: flex; gap: 10px; }
.mff-yesno .mff-yn {
    flex: 1; padding: 11px; border: 1.5px solid #e2e5ee; border-radius: 12px;
    background: #fbfbfe; font-size: 14px; cursor: pointer; color: #34384e;
    font-family: inherit; transition: all .15s;
}
.mff-yesno .mff-yn.on { border-color: var(--mff-accent); background: color-mix(in srgb, var(--mff-accent) 9%, #fff); color: var(--mff-accent); font-weight: 700; }

/* امتیاز ستاره‌ای */
.mff-stars { display: flex; gap: 6px; }
.mff-star {
    border: none; background: none; padding: 2px; cursor: pointer;
    font-size: 30px; color: #d6dae6; transition: color .12s, transform .12s;
    line-height: 1;
}
.mff-star:hover { transform: scale(1.15); }
.mff-star.on { color: #f5b73f; }

/* هانی‌پات ضدربات — نامرئی برای انسان */
.mff-hp { position: absolute; inset-inline-start: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* ── اقدام‌ها ── */
.mff-actions { margin-top: 26px; }
.mff-submit {
    width: 100%; border: none; border-radius: 13px;
    padding: 13px; font-size: 15px; font-weight: 700; font-family: inherit;
    color: #fff; cursor: pointer;
    background: linear-gradient(135deg, var(--mff-accent), color-mix(in srgb, var(--mff-accent) 65%, #0f172a));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--mff-accent) 35%, transparent);
    transition: transform .12s, box-shadow .12s, opacity .15s;
}
.mff-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--mff-accent) 45%, transparent); }
.mff-submit:disabled { opacity: .65; cursor: default; }
.mff-note { text-align: center; font-size: 11.5px; color: #8a8fa3; margin-top: 14px; }

/* ── پیام خطای کلی ── */
.mff-alert {
    display: flex; align-items: flex-start; gap: 9px;
    border-radius: 12px; padding: 11px 14px; font-size: 13px;
    margin-bottom: 20px;
}
.mff-alert-err { background: #fdf0f0; color: #b4232a; border: 1px solid #f5c6c8; }

/* ── حالت‌ها: موفقیت / بسته / پیدا نشد / رمز ── */
.mff-state { text-align: center; padding: 22px 6px 12px; }
.mff-check {
    width: 84px; height: 84px; margin: 0 auto 18px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--mff-accent) 10%, #fff);
    display: flex; align-items: center; justify-content: center;
    animation: mff-pop .45s cubic-bezier(.34, 1.56, .64, 1);
}
.mff-check i { font-size: 42px; color: var(--mff-accent); }
@keyframes mff-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mff-state h2 { font-size: 20px; font-weight: 700; color: #1e2235; margin-bottom: 10px; }
.mff-state p { font-size: 14px; color: #5a5f75; line-height: 1.9; max-width: 440px; margin: 0 auto 20px; white-space: pre-line; }
.mff-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: none; border-radius: 12px; padding: 11px 26px;
    font-size: 14px; font-weight: 600; font-family: inherit;
    color: #fff; cursor: pointer; text-decoration: none;
    background: linear-gradient(135deg, var(--mff-accent), color-mix(in srgb, var(--mff-accent) 65%, #0f172a));
}
.mff-btn-ghost {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1.5px solid #e2e5ee; border-radius: 12px; padding: 10px 22px;
    font-size: 13px; color: #5a5f75; text-decoration: none; background: #fff;
}
.mff-btn-ghost:hover { border-color: var(--mff-accent); color: var(--mff-accent); }

/* ── فوتر ── */
.mff-footer { text-align: center; padding: 0 20px 40px; }
.mff-powered {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: #8a8fa3; text-decoration: none;
    border: 1px solid #e4e7f0; background: #fff;
    padding: 7px 16px; border-radius: 999px;
    transition: color .15s, border-color .15s;
}
.mff-powered:hover { color: var(--mff-accent); border-color: var(--mff-accent); }
.mff-powered i { font-size: 14px; }
.mff-foot-note { font-size: 11.5px; color: #9aa0b4; margin-top: 10px; }

@media (max-width: 560px) {
    .mff-hero { padding: 40px 16px 84px; }
    .mff-hero h1 { font-size: 20px; }
    .mff-card { padding: 26px 20px 22px; margin-top: -56px; }
    .mff-progress { margin: -26px -20px 20px; padding: 12px 20px 8px; }
    .mff-yesno { flex-direction: column; }
}

/* ═══════════ مدیریت فرم‌ها (/forms) — پیشوند mfb- ═══════════ */

.mfb-card { position: relative; overflow: hidden; }
.mfb-card::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
    width: 4px; background: var(--mfb-accent, #6d5ef1);
}
.mfb-card .card-body { padding-inline-start: 20px; }
.mfb-title { font-size: 15px; font-weight: 700; color: #1e2235; text-decoration: none; }
.mfb-title:hover { color: var(--mfb-accent, #6d5ef1); }
.mfb-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #8a8fa3; margin-top: 8px; }
.mfb-meta i { vertical-align: -1px; }
.mfb-slug {
    font-family: monospace; font-size: 11px; direction: ltr; display: inline-block;
    background: #f0f1f7; border-radius: 6px; padding: 2px 8px; color: #6b7086;
}
.mfb-status { font-size: 11px; border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.mfb-status.on { background: #e6f7ee; color: #12795b; }
.mfb-status.off { background: #f1f2f6; color: #8a8fa3; }
.mfb-count { font-size: 20px; font-weight: 800; color: var(--mfb-accent, #6d5ef1); }
.mfb-count-lbl { font-size: 11px; color: #8a8fa3; }

.mfb-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mfb-act {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid #e4e7f0; background: #fff; border-radius: 9px;
    font-size: 12px; color: #5a5f75; padding: 6px 12px; cursor: pointer;
    font-family: inherit; text-decoration: none; transition: all .12s;
}
.mfb-act:hover { border-color: var(--mfb-accent, #6d5ef1); color: var(--mfb-accent, #6d5ef1); }
.mfb-act.danger:hover { border-color: #e5484d; color: #e5484d; }

/* ── سازندهٔ فیلد در مودال ── */
.mfb-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.mfb-frow {
    border: 1.5px solid #e6e8f1; border-radius: 12px; padding: 12px;
    background: #fbfbfe;
}
.mfb-frow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.mfb-frow-head .mfb-ftype {
    display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
    color: #6d5ef1; background: #efedfd; border-radius: 7px; padding: 4px 10px;
    white-space: nowrap; cursor: pointer; border: none; font-family: inherit;
}
.mfb-frow-head input[type="text"] {
    flex: 1; min-width: 0; border: 1px solid #e2e5ee; border-radius: 8px;
    padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.mfb-frow-head input[type="text"]:focus { outline: none; border-color: #6d5ef1; }
.mfb-fbtn {
    border: 1px solid #e4e7f0; background: #fff; border-radius: 8px;
    width: 30px; height: 30px; flex-shrink: 0; cursor: pointer;
    color: #8a8fa3; font-size: 13px; transition: all .12s;
}
.mfb-fbtn:hover:not(:disabled) { border-color: #6d5ef1; color: #6d5ef1; }
.mfb-fbtn.danger:hover { border-color: #e5484d; color: #e5484d; }
.mfb-fbtn:disabled { opacity: .35; cursor: default; }
.mfb-frow-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mfb-frow-sub .mfb-fopt {
    flex: 1; min-width: 140px; border: 1px solid #e2e5ee; border-radius: 8px;
    padding: 6px 10px; font-size: 12px; font-family: inherit; color: #5a5f75;
}
.mfb-req {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
    color: #5a5f75; cursor: pointer; user-select: none; white-space: nowrap;
}
.mfb-options {
    width: 100%; border: 1px solid #e2e5ee; border-radius: 8px;
    padding: 7px 10px; font-size: 12px; font-family: inherit;
    margin-top: 8px; min-height: 60px; resize: vertical;
}

.mfb-add {
    display: flex; flex-wrap: wrap; gap: 7px;
    border: 1.5px dashed #d8dbe8; border-radius: 12px; padding: 12px;
}
.mfb-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid #e4e7f0; background: #fff; border-radius: 999px;
    font-size: 12px; color: #5a5f75; padding: 6px 13px; cursor: pointer;
    font-family: inherit; transition: all .12s;
}
.mfb-add-btn:hover { border-color: #6d5ef1; color: #6d5ef1; background: #faf9fe; }
.mfb-add-btn i { color: #6d5ef1; }

.mfb-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.mfb-swatch {
    width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
    border: 2.5px solid transparent; transition: transform .12s;
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
}
.mfb-swatch:hover { transform: scale(1.08); }
.mfb-swatch.on { border-color: #1e2235; }
.mfb-modal-wide { max-width: 760px !important; }
.mfb-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #eef0f5; padding-bottom: 10px; }
.mfb-tab {
    border: none; background: none; font-family: inherit; font-size: 13px;
    color: #8a8fa3; padding: 7px 14px; border-radius: 9px; cursor: pointer;
}
.mfb-tab.on { background: #efedfd; color: #6d5ef1; font-weight: 700; }
