/* ─── MAKE FORMS ─── */
.mf-wrap { padding: 28px; position: relative; z-index: 1; }

/* template picker */
.mf-templates {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 26px;
}
.mf-templates-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.mf-templates-head h3 { font-family:'Inter',sans-serif; font-size:14px; font-weight:700; }
.mf-tpl-sub { font-size:11px; color:var(--text3); max-width:520px; line-height:1.5; }
.mf-tpl-filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.mf-tpl-filter-pill {
  background:var(--bg3); border:1px solid var(--border); color:var(--text2);
  font-family:'Inter',sans-serif; font-size:11px; font-weight:600;
  padding:6px 13px; border-radius:999px; cursor:pointer; transition:all .15s; white-space:nowrap;
}
.mf-tpl-filter-pill:hover { border-color:var(--border2); color:var(--text); }
.mf-tpl-filter-pill.active { background:var(--blue); border-color:var(--blue); color:#fff; }
.mf-template-grid { display:flex; flex-direction:column; gap:22px; }
.mf-tpl-category-label {
  font-size:10.5px; font-weight:700; color:var(--cyan); text-transform:uppercase;
  letter-spacing:0.7px; margin-bottom:10px; padding-bottom:8px; border-bottom:1px solid var(--border);
}
.mf-tpl-category-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px,1fr)); gap:12px; }
.mf-tpl-empty { font-size:12px; color:var(--text3); padding:20px 4px; text-align:center; }
.mf-template-card {
  background: var(--bg3); border:1px solid var(--border); border-radius:12px;
  padding:16px; cursor:pointer; transition:all .2s; text-align:left; min-width:0;
}
.mf-template-card:hover { border-color:var(--border2); transform:translateY(-2px); box-shadow:var(--shadow-card-hover); }
.mf-template-icon {
  width:32px; height:32px; border-radius:8px; margin-bottom:10px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,194,255,0.12); color:var(--cyan);
}
.mf-template-card h4 { font-family:'Inter',sans-serif; font-size:13px; font-weight:700; margin-bottom:4px; overflow-wrap:break-word; }
.mf-template-card p { font-size:11px; color:var(--text2); line-height:1.4; overflow-wrap:break-word; }

/* my forms grid */
.mf-myforms-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.mf-myforms-head h3 { font-family:'Inter',sans-serif; font-size:14px; font-weight:700; }
.mf-count { font-size:11px; color:var(--text3); }
.mf-forms-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:14px; }
.mf-form-card {
  background: var(--bg2); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px; cursor:pointer; transition:all .2s; box-shadow:var(--shadow-card);
  display:flex; flex-direction:column; gap:6px; position:relative; min-width:0;
}
.mf-form-card:hover { border-color:var(--border2); transform:translateY(-2px); box-shadow:var(--shadow-card-hover); }
.mf-form-card h4 { font-family:'Inter',sans-serif; font-size:14px; font-weight:700; overflow-wrap:break-word; }
.mf-form-card .mf-form-meta { font-size:11px; color:var(--text3); }
.mf-form-card .mf-form-actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.mf-form-card .mf-form-actions button {
  background:var(--surface2); border:1px solid var(--border); color:var(--text2);
  font-size:11px; padding:6px 10px; border-radius:7px; cursor:pointer; transition:all .15s; white-space:nowrap;
}
.mf-form-card .mf-form-actions button:hover { border-color:var(--border2); color:var(--text); }
.mf-form-card .mf-form-actions button.mf-danger:hover { border-color:rgba(239,68,68,0.5); color:#ef4444; }
.mf-empty {
  display:none; flex-direction:column; align-items:center; text-align:center;
  padding:40px 20px; color:var(--text3); gap:10px;
}
.mf-empty-icon { opacity:0.5; }
.mf-empty p { font-size:13px; color:var(--text2); }

/* editor top bar — grouped, premium enterprise toolbar */
.mf-editor-top {
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius);
  padding:10px 14px 10px 10px; margin-bottom:20px; flex-wrap:wrap;
  box-shadow:0 2px 10px rgba(0,0,0,0.10);
}
.mf-editor-top-left { display:flex; align-items:center; gap:12px; flex:1; min-width:220px; }
.mf-editor-top-right { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.mf-toolbar-divider { width:1px; height:24px; background:var(--border); flex-shrink:0; }
.mf-toolbar-group { display:flex; align-items:center; gap:6px; flex-shrink:0; }

.mf-back-btn {
  flex-shrink:0; display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; padding:0; border-radius:9px;
  background:transparent; border:1px solid transparent; color:var(--text2);
}
.mf-back-btn:hover { background:var(--surface2); border-color:var(--border); color:var(--text); }

.mf-title-input {
  flex:1; min-width:160px; background:transparent; border:none;
  color:var(--text); font-family:'Inter',sans-serif; font-size:17px; font-weight:800;
  padding:6px 4px; outline:none; border-radius:7px; transition:background 0.2s;
}
.mf-title-input:hover { background:var(--surface); }
.mf-title-input:focus { background:var(--surface2); }

.mf-editor-actions { display:flex; align-items:center; gap:10px; flex-shrink:0; flex-wrap:wrap; }
.mf-editor-actions button { padding:9px 15px; font-size:12px; height:34px; }
.mf-icon-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; padding:0 !important; border-radius:9px;
  background:var(--surface); color:var(--text2); border:1px solid var(--border);
  cursor:pointer; transition:all 0.15s;
}
.mf-icon-btn:hover { background:var(--surface2); border-color:var(--border2); color:var(--text); }
.mf-icon-btn:disabled { opacity:0.35; cursor:default; pointer-events:none; }
.mf-editor-actions .btn-pill { background:rgba(0,194,255,0.07); border-color:var(--border2); color:var(--text); }
.mf-editor-actions .btn-pill:hover { background:rgba(0,194,255,0.14); }
.mf-editor-actions .btn-secondary { background:var(--surface); }

.mf-editor-body { display:grid; grid-template-columns: 1fr 380px; gap:28px; align-items:start; }
@media (max-width: 980px) { .mf-editor-body { grid-template-columns: 1fr; gap:20px; } }
.mf-design-preview-col { display:flex; flex-direction:column; gap:12px; position:sticky; top:0; }
.mf-design-preview-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 2px; }
.mf-design-preview-label { font-size:11px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:0.6px; }
.mf-design-preview-size { font-size:10.5px; font-weight:600; color:var(--text3); background:var(--surface2); border:1px solid var(--border); padding:3px 9px; border-radius:999px; letter-spacing:0.2px; }
.mf-design-preview-col .mf-preview-scroll { max-height:78vh; }
@media (max-width: 980px) { .mf-design-preview-col { position:static; } }

.mf-fields-panel {
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius);
  padding:26px; display:flex; flex-direction:column; gap:20px;
}
.mf-desc-row { display:flex; flex-direction:column; gap:5px; }
.mf-desc-row label { font-size:11px; color:var(--text2); }
.mf-desc-row textarea, .mf-field-input, .mf-field-select, .mf-field-textarea {
  background:var(--bg3); border:1px solid var(--border); color:var(--text);
  padding:7px 10px; border-radius:8px; font-family:'Inter',sans-serif; font-size:12px;
  outline:none; transition:border 0.2s; width:100%; resize:vertical;
}
.mf-desc-row textarea:focus, .mf-field-input:focus, .mf-field-select:focus, .mf-field-textarea:focus { border-color:var(--border2); }

/* branding */
.mf-brand-row {
  display:flex; gap:20px; flex-wrap:wrap; padding-bottom:14px; border-bottom:1px solid var(--border);
}
.mf-brand-logo-block, .mf-brand-color-block { display:flex; flex-direction:column; gap:8px; flex:1; min-width:180px; }
.mf-brand-row label { font-size:11.5px; font-weight:600; color:var(--text2); }
.mf-field-hint { font-size:10.5px; font-weight:400; line-height:1.5; color:var(--text3); margin:2px 0 0; }
.mf-brand-logo-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.mf-brand-logo-thumb {
  width:44px; height:44px; border-radius:8px; background:var(--bg3); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; color:var(--text3); overflow:hidden; flex-shrink:0;
}
.mf-brand-logo-thumb img { width:100%; height:100%; object-fit:contain; }
.mf-brand-logo-btns { display:flex; gap:8px; flex-wrap:wrap; }
#mfLogoRemoveBtn { display:none; }
.mf-brand-swatches { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.mf-swatch {
  width:22px; height:22px; border-radius:50%; cursor:pointer; border:2px solid transparent;
  transition:all .15s; flex-shrink:0; box-shadow:0 0 0 1px rgba(255,255,255,0.1);
}
.mf-swatch.active { border-color:var(--text); transform:scale(1.15); }
.mf-swatch-custom {
  width:22px; height:22px; border-radius:50%; padding:0; border:1px solid var(--border);
  cursor:pointer; background:none; overflow:hidden; flex-shrink:0;
}
.mf-swatch-custom::-webkit-color-swatch-wrapper { padding:0; }
.mf-swatch-custom::-webkit-color-swatch { border:none; border-radius:50%; }

/* attachments — named folders of files that travel with the published form */
.mf-attach-block { min-width:100% !important; }
.mf-attach-folders { display:flex; flex-direction:column; gap:8px; }
.mf-attach-add-row { display:flex; }
.mf-attach-folder {
  background:var(--bg3); border:1px solid var(--border); border-radius:9px; padding:8px 10px;
  display:flex; flex-direction:column; gap:6px;
}
.mf-attach-folder-head { display:flex; align-items:center; gap:7px; color:var(--text2); }
.mf-attach-folder-head svg { flex-shrink:0; color:var(--text3); }
.mf-attach-folder-name {
  font-size:12px; font-weight:600; color:var(--text); cursor:pointer; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; flex:1;
}
.mf-attach-folder-name:hover { text-decoration:underline; text-underline-offset:2px; }
.mf-attach-folder-count {
  font-size:9.5px; color:var(--text3); background:var(--surface2); border:1px solid var(--border);
  padding:1px 6px; border-radius:999px; flex-shrink:0;
}
.mf-attach-icon-btn {
  display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px;
  border-radius:6px; background:var(--surface2); border:1px solid var(--border); color:var(--text2);
  cursor:pointer; flex-shrink:0; padding:0; transition:all .15s;
}
.mf-attach-icon-btn:hover { color:var(--text); border-color:var(--border2); }
.mf-attach-icon-btn.mf-attach-del:hover { color:#ef4444; border-color:rgba(239,68,68,0.5); }
.mf-attach-file-list { display:flex; flex-direction:column; gap:4px; padding-left:21px; }
.mf-attach-file {
  display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--text2);
  padding:3px 0; border-top:1px dashed var(--border);
}
.mf-attach-file:first-child { border-top:none; }
.mf-attach-file-name {
  flex:1; cursor:pointer; color:var(--blue); overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; min-width:0;
}
.mf-attach-file-name:hover { text-decoration:underline; }
.mf-attach-file-size { font-size:9.5px; color:var(--text3); flex-shrink:0; }
.mf-attach-empty { font-size:10.5px; color:var(--text3); padding:2px 2px 2px 21px; }
.mf-attach-folders-readonly .mf-attach-folder { background:var(--bg2); }

.mf-fill-attach-col {
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius);
  padding:14px; display:flex; flex-direction:column; gap:10px; position:sticky; top:0;
}
.mf-fill-attach-head { font-size:11px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:0.6px; }
.mf-fill-attach-empty { font-size:11px; color:var(--text3); line-height:1.5; }

/* social links — owner-added Instagram/LinkedIn/WhatsApp/X/Website, shown
   on the published form so respondents can find/follow the form owner. */
.mf-social-row { display:flex; flex-direction:column; gap:10px; padding-bottom:14px; border-bottom:1px solid var(--border); }
.mf-social-row > label { font-size:11px; color:var(--text2); }
.mf-social-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:10px; }
.mf-social-field { display:flex; align-items:center; gap:8px; background:var(--bg3); border:1px solid var(--border); border-radius:8px; padding:0 10px; transition:border 0.2s; }
.mf-social-field:focus-within { border-color:var(--border2); }
.mf-social-field-icon { display:flex; align-items:center; justify-content:center; flex-shrink:0; border-radius:6px; overflow:hidden; }
.mf-social-field input {
  background:transparent; border:none; color:var(--text); padding:8px 0; font-family:'Inter',sans-serif;
  font-size:12px; outline:none; width:100%; min-width:0;
}
.mf-social-field input::placeholder { color:var(--text3); }

.mf-field-list { display:flex; flex-direction:column; gap:10px; max-height:52vh; overflow-y:auto; padding-right:2px; }
.mf-field-item {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px; padding:12px;
  display:flex; flex-direction:column; gap:8px;
}
.mf-field-item-head { display:flex; align-items:center; gap:8px; }
.mf-field-type-tag {
  font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px;
  color:var(--cyan); background:rgba(0,194,255,0.12); padding:3px 7px; border-radius:5px; flex-shrink:0;
}
.mf-field-item-head input.mf-field-input { flex:1; font-weight:600; }
.mf-field-btns { display:flex; gap:4px; flex-shrink:0; }
.mf-field-btns button {
  width:24px; height:24px; display:flex; align-items:center; justify-content:center;
  background:var(--surface2); border:1px solid var(--border); border-radius:6px;
  color:var(--text2); cursor:pointer; font-size:12px; transition:all .15s; padding:0;
}
.mf-field-btns button:hover { border-color:var(--border2); color:var(--text); }
.mf-field-btns button.mf-danger:hover { border-color:rgba(239,68,68,0.5); color:#ef4444; }
.mf-field-row2 { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.mf-field-row2 label { font-size:10px; color:var(--text3); display:flex; align-items:center; gap:4px; }
.mf-field-options-hint { font-size:10px; color:var(--text3); }

.mf-add-field-row { display:flex; flex-direction:column; gap:10px; padding-top:18px; border-top:1px solid var(--border); }
.mf-add-label { font-size:11px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:0.6px; }
.mf-add-btns { display:flex; flex-wrap:wrap; gap:8px; }
.mf-add-btns button {
  background:var(--surface2); border:1px solid var(--border); color:var(--text2);
  font-family:'Inter',sans-serif; font-size:11.5px; font-weight:600;
  padding:8px 14px; border-radius:999px; cursor:pointer; transition:all .15s;
}
.mf-add-btns button:hover { border-color:var(--cyan); color:var(--cyan); background:rgba(0,194,255,0.08); }

/* Live preview panel: shown alongside the field builder in Design mode and
   alongside the responses list in Fill mode (mfSwitchMode moves the single
   #mfPreviewPanel node between mfDesignPreviewSlot / mfFillPreviewSlot /
   mfPreviewOffscreenHolder). Default position is off-screen so Print,
   Export PDF, and Push to Workspace can still read #mfPreviewPage directly
   (html2canvas + window.print) even before a slot claims it — it can't be
   display:none or those would capture blank/broken output. @media print
   overrides this back to fixed/on-page. */
.mf-preview-panel { position:fixed; top:0; left:-99999px; }
.mf-preview-scroll {
  max-height:82vh; overflow-y:auto; display:flex; justify-content:center; padding:22px;
  background:
    linear-gradient(var(--bg3), var(--bg3)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 24px);
  border:1px solid var(--border); border-radius:var(--radius);
}
/* Strict A4 (210mm × 297mm, i.e. 1:1.4142 ratio) page box, WYSIWYG-accurate
   to what Export PDF / Push to Workspace / Print actually produce.
   IMPORTANT: this box must NEVER clip or internally scroll its own content
   (that used to hide real overflow behind a fixed-height, fixed-aspect-ratio
   box with overflow-y:auto — so a form with lots of fields looked like it
   fit on one page while designing, then silently exported as 2+ real A4
   pages). aspect-ratio here is only a *floor* (one full sheet's worth of
   minimum height); overflow is visible so the box naturally grows past that
   floor exactly the way the true export capture does, and .mf-pv-pagebreaks
   below draws page-break lines at the same 210:297 intervals the exporters
   slice on, so what's on screen always matches what gets produced. The
   outer .mf-preview-scroll still scrolls the whole multi-page stack. */
.mf-preview-page-stack { position:relative; width:100%; max-width:420px; }
.mf-preview-page {
  background:#ffffff; color:#1a1a1a; width:100%;
  aspect-ratio: 210 / 297; overflow-y:visible; overflow-x:hidden;
  border-radius:2px; padding:10% 9%; box-shadow:0 2px 8px rgba(0,0,0,0.15), 0 18px 46px rgba(0,0,0,0.5);
  border:1px solid rgba(0,0,0,0.08);
  font-family:'Inter',sans-serif;
  --mf-accent: #0073E6;
  --mf-accent-rgb: 0, 115, 230;
  --mf-accent-topbar: #4c66ef;
  --mf-accent-header-border: #bdd4ed;
  --mf-accent-header-bg: #edf5fd;
  --mf-accent-heading-bg: #e6f0fa;
  --mf-accent-field-hover-border: #88b9ea;
  --mf-accent-mcq-hover-bg: #f0f7fe;
  --mf-accent-mcq-hover-border: #bad2ec;
  position:relative;
}
/* Overlay only — never captured by html2canvas (exporters target
   #mfPreviewPage directly, not this sibling), so it's purely a visual guide
   showing exactly where each real A4 sheet ends and the next begins. */
.mf-pv-pagebreaks { position:absolute; inset:0; pointer-events:none; z-index:3; }
.mf-pv-pagebreak { position:absolute; left:-1px; right:-1px; height:0; border-top:1px dashed rgba(15,18,25,0.18); }
/* Real, in-flow blank space inserted between pages (see mfUpdatePreviewPagination)
   so the field/heading after it visually starts at the top of the next A4
   sheet — not just a dashed line drawn over one continuous scroll. The seam
   in the middle marks exactly where sheet N ends and N+1 begins. */
.mf-pv-pagespacer { position:relative; width:100%; }
.mf-pv-pagespacer-seam {
  position:absolute; left:-9%; right:-9%; top:50%; height:0;
  border-top:1.5px dashed rgba(15,18,25,0.28);
}
.mf-pv-pagespacer-seam::before {
  content:''; position:absolute; left:0; right:0; bottom:0; height:14px;
  background:linear-gradient(to top, rgba(0,0,0,0.10), transparent);
}
.mf-pv-pagespacer-seam::after {
  content:''; position:absolute; left:0; right:0; top:0; height:14px;
  background:linear-gradient(to bottom, rgba(0,0,0,0.10), transparent);
}
.mf-pv-pagespacer-label {
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  background:rgba(18,20,26,0.85); color:#fff; font-size:9px; font-weight:700;
  letter-spacing:.4px; text-transform:uppercase; padding:3px 9px; border-radius:999px;
  white-space:nowrap; z-index:1;
}
.mf-pv-watermarks { position:absolute; inset:0; z-index:0; pointer-events:none; }
.mf-pv-watermark {
  position:absolute; left:50%; transform:translate(-50%,-50%);
  max-width:58%; max-height:58%; object-fit:contain;
  opacity:0.08; z-index:0; pointer-events:none; user-select:none;
}
.mf-pv-content { position:relative; z-index:1; }
/* Custom "festive/banner" image — separate from the logo watermark above.
   Lets the form owner drop in any picture (a Diwali/Christmas graphic, a
   company campaign banner, etc.) that shows up faint, full-bleed, behind
   the header card only — like a printed letterhead backdrop rather than a
   repeated page watermark. */
.mf-pv-banner-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; pointer-events:none; user-select:none; }
.mf-pv-header-fg { position:relative; z-index:1; display:flex; align-items:center; gap:16px; width:100%; }
.mf-watermark-row { display:none; align-items:center; gap:14px; margin-top:10px; flex-wrap:wrap; }
.mf-watermark-row label { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text2); cursor:pointer; white-space:nowrap; }
.mf-watermark-row input[type="range"] { width:90px; accent-color:var(--blue); }
.mf-watermark-row .mf-wm-val { font-size:11px; color:var(--text3); min-width:26px; }
.mf-lang-row { margin-bottom:16px; }
.mf-lang-row > label { display:block; font-size:11.5px; font-weight:600; color:var(--text2); margin-bottom:7px; }
.mf-lang-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.mf-lang-controls select {
  background:var(--surface2); border:1px solid var(--border); color:var(--text);
  font-family:'Inter',sans-serif; font-size:11.5px; padding:7px 10px; border-radius:7px; cursor:pointer;
}
.mf-lang-controls button { padding:7px 12px; font-size:11px; }
.mf-lang-status { font-size:10.5px; color:var(--text3); }
.mf-lang-status.mf-lang-busy { color:var(--blue); }
.mf-lang-status.mf-lang-error { color:#ef4444; }
.mf-preview-panel.mf-lang-flash .mf-preview-page { animation: mfLangFlash 0.9s ease; }
@keyframes mfLangFlash {
  0%   { box-shadow: 0 0 0 0 rgba(0,194,255,0.55); }
  35%  { box-shadow: 0 0 0 6px rgba(0,194,255,0.28); }
  100% { box-shadow: 0 0 0 0 rgba(0,194,255,0); }
}
/* ─── "SARVARC Forms" look: Google-Forms-style airy layout, boxed field
   cards with a colored accent rail, rendered from the SAME .mf-pv-field /
   .mf-pv-heading DOM the exporters already capture via html2canvas — so the
   Live Preview and every exported PDF / pushed page stay pixel-identical,
   just nicer to look at. No JS/markup changes required. ─── */
.mf-preview-page::before {
  content:''; position:absolute; top:0; left:0; right:0; height:7px; z-index:2;
  background:linear-gradient(90deg, var(--mf-accent), var(--mf-accent-topbar));
}
.mf-pv-header {
  position:relative; overflow:hidden; margin-bottom:26px; padding:16px 18px;
  border-radius:14px; border:1px solid var(--mf-accent-header-border);
  border-bottom:3px solid var(--mf-accent);
  background:linear-gradient(135deg, var(--mf-accent-header-bg), #ffffff);
}
.mf-pv-logo { height:52px; width:auto; max-width:140px; min-width:52px; object-fit:contain; flex-shrink:0; border-radius:8px; }
.mf-pv-header-text { flex:1; min-width:0; }
.mf-preview-page h1 { font-size:24px; font-weight:800; letter-spacing:-0.015em; margin-bottom:4px; color:#111; line-height:1.2; }
.mf-preview-page .mf-pv-desc { font-size:11.5px; color:#5a6472; margin-bottom:22px; line-height:1.6; }
.mf-pv-header + .mf-pv-desc { margin-top:-8px; }
.mf-pv-heading {
  display:flex; align-items:center; gap:9px; font-size:12px; font-weight:800;
  text-transform:uppercase; letter-spacing:0.6px; color:#1b2430;
  background:var(--mf-accent-heading-bg);
  border-left:4px solid var(--mf-accent); border-radius:9px;
  padding:10px 14px; margin:22px 0 14px;
}
.mf-pv-heading:first-child { margin-top:0; }
.mf-pv-field {
  margin-bottom:14px; background:#ffffff; border:1px solid #e3e7ed; border-left:3px solid var(--mf-accent);
  border-radius:12px; padding:14px 16px; box-shadow:0 1px 2px rgba(15,23,42,0.05);
  transition:box-shadow .18s ease, border-color .18s ease;
}
.mf-pv-field:hover { box-shadow:0 6px 16px rgba(15,23,42,0.08); border-color:var(--mf-accent-field-hover-border); }
.mf-pv-field:focus-within { box-shadow:0 0 0 3px rgba(var(--mf-accent-rgb), 0.16), 0 6px 16px rgba(15,23,42,0.08); }
.mf-pv-field label { display:block; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:#5b6472; margin-bottom:8px; }
.mf-pv-field .mf-pv-req { color:#e11d48; margin-left:2px; }
.mf-pv-input, .mf-pv-textarea, .mf-pv-select-real {
  width:100%; box-sizing:border-box; border:1px solid #dde2e9; border-radius:9px;
  padding:10px 12px; font-size:13px; font-family:'Inter',sans-serif; color:#1a1a1a;
  background:#fbfcfe; outline:none; transition:border-color .15s, box-shadow .15s, background .15s;
}
.mf-pv-input:focus, .mf-pv-textarea:focus, .mf-pv-select-real:focus { border-color:var(--mf-accent); box-shadow:0 0 0 3px rgba(var(--mf-accent-rgb), 0.14); background:#fff; }
.mf-pv-textarea { resize:vertical; }
.mf-pv-check { display:flex; align-items:center; gap:10px; }
.mf-pv-check input { width:16px; height:16px; flex-shrink:0; accent-color:var(--mf-accent); }
.mf-pv-check label { margin-bottom:0 !important; text-transform:none; font-weight:600; letter-spacing:0; color:#222; font-size:12.5px; }
.mf-pv-mcq-opts { display:flex; flex-direction:column; gap:7px; margin-top:2px; }
.mf-pv-mcq-opt {
  display:flex; align-items:center; gap:10px; cursor:pointer; padding:8px 10px;
  border-radius:8px; border:1px solid transparent; transition:background .15s, border-color .15s;
}
.mf-pv-mcq-opt:hover { background:var(--mf-accent-mcq-hover-bg); border-color:var(--mf-accent-mcq-hover-border); }
.mf-pv-mcq-opt input { width:15px; height:15px; flex-shrink:0; accent-color:var(--mf-accent); }
.mf-pv-mcq-opt span { font-size:12.5px; font-weight:600; letter-spacing:0; color:#222; }
.mf-pv-sig { border-bottom:1.5px solid #444; height:38px; }
.mf-pv-sig-label { font-size:9px; font-weight:600; text-transform:uppercase; letter-spacing:0.4px; color:#8a92a0; margin-top:5px; }
/* Signature: fill mode (draw / type / upload image or PDF) */
.mf-pv-sig-live { position:relative; height:46px; cursor:pointer; border-radius:4px 4px 0 0; transition:background .15s; }
.mf-pv-sig-live:hover { background:rgba(var(--mf-accent-rgb,0,115,230),0.07); }
.mf-pv-sig-hint { position:absolute; left:0; right:0; bottom:6px; text-align:center; font-size:10.5px; font-weight:600; color:var(--mf-accent,#0073E6); opacity:.85; pointer-events:none; }
.mf-pv-sig-signed { border-bottom:1.5px solid #444; min-height:38px; display:flex; align-items:flex-end; padding:2px 0 3px; }
.mf-pv-sig-signed img { max-height:64px; max-width:70%; display:block; }
.mf-pv-sig-file-only { font-size:11px; color:#555; font-weight:600; padding:8px 0; }
.mf-pv-sig-tools { display:flex; gap:6px; margin-top:6px; flex-wrap:wrap; }
.mf-pv-sig-tools button { background:#fff; border:1px solid #d6dbe4; border-radius:6px; padding:3px 9px; font-size:10.5px; font-weight:600; color:#3a4456; cursor:pointer; }
.mf-pv-sig-tools button:hover { border-color:var(--mf-accent,#0073E6); color:var(--mf-accent,#0073E6); }

@media print {
  @page { size: A4; margin: 0; }
  body * { visibility: hidden; }
  .mf-preview-page, .mf-preview-page * { visibility: visible; }
  .mf-preview-panel { position:fixed; top:0; left:0; }
  .mf-preview-page {
    position:fixed; inset:0; margin:0; max-width:none; width:210mm; aspect-ratio:auto; height:auto;
    overflow:visible; box-shadow:none; border:none; border-radius:0; padding:20mm 18mm;
  }
}

/* ─── MAKE FORMS: FILL & RESPONSES MODE ─── */
.mf-mode-tabs { display:flex; gap:22px; margin-bottom:20px; border-bottom:1px solid var(--border); }
.mf-mode-tab {
  background:transparent; border:none; color:var(--text2); font-family:'Inter',sans-serif;
  font-size:12.5px; font-weight:700; padding:10px 2px; cursor:pointer;
  border-bottom:2px solid transparent; display:flex; align-items:center; gap:7px; transition:all .15s;
}
.mf-mode-tab:hover { color:var(--text); }
.mf-mode-tab.active { color:var(--text); border-bottom-color:var(--blue); }
.mf-mode-tab-badge {
  background:var(--blue); color:#fff; font-size:9.5px; font-weight:800;
  min-width:16px; text-align:center; padding:2px 5px; border-radius:9px; line-height:1.3;
}

.mf-fill-body { display:grid; grid-template-columns: 300px 1fr 240px; gap:20px; align-items:start; }
@media (max-width: 1200px) { .mf-fill-body { grid-template-columns: 300px 1fr; } .mf-fill-attach-col { grid-column: 1 / -1; } }
@media (max-width: 900px) { .mf-fill-body { grid-template-columns: 1fr; } .mf-fill-attach-col { grid-column: auto; } }

.mf-responses-panel {
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius);
  padding:16px; display:flex; flex-direction:column; gap:12px;
}
.mf-resp-head { display:flex; align-items:center; justify-content:space-between; }
.mf-resp-head h4 { font-family:'Inter',sans-serif; font-size:13px; font-weight:700; }
.mf-resp-count { font-size:10.5px; color:var(--text3); }
.mf-resp-sync-status { font-size:10px; color:var(--text3); margin:-4px 0 2px; display:flex; align-items:center; gap:5px; }
.mf-resp-sync-status:not(:empty)::before {
  content:''; width:6px; height:6px; border-radius:50%; background:#1D9E75;
  box-shadow:0 0 0 0 rgba(29,158,117,0.5); animation:mfSyncPulse 2s infinite;
}
@keyframes mfSyncPulse {
  0% { box-shadow:0 0 0 0 rgba(29,158,117,0.45); }
  70% { box-shadow:0 0 0 5px rgba(29,158,117,0); }
  100% { box-shadow:0 0 0 0 rgba(29,158,117,0); }
}
.mf-resp-actions-row { display:flex; flex-direction:column; gap:8px; }
.mf-resp-actions-row button { width:100%; justify-content:center; }
.mf-resp-sep { height:1px; background:var(--border); margin:2px 0; }
.mf-resp-list { display:flex; flex-direction:column; gap:8px; max-height:44vh; overflow-y:auto; padding-right:2px; }
.mf-resp-item {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:10px 12px; cursor:pointer; transition:all .15s;
}
.mf-resp-item:hover { border-color:var(--border2); }
.mf-resp-item.active { border-color:var(--blue); box-shadow:0 0 0 1px var(--blue) inset; }
.mf-resp-item-title { font-size:12px; font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mf-resp-item-meta { font-size:9.5px; color:var(--text3); margin-top:2px; }
.mf-resp-item-btns { display:flex; gap:6px; margin-top:8px; }
.mf-resp-item-btns button {
  background:var(--surface2); border:1px solid var(--border); color:var(--text2);
  font-size:10px; padding:4px 8px; border-radius:6px; cursor:pointer; transition:all .15s;
}
.mf-resp-item-btns button:hover { color:var(--text); border-color:var(--border2); }
.mf-resp-item-btns button.mf-danger:hover { color:#ef4444; border-color:rgba(239,68,68,0.5); }
.mf-resp-empty { text-align:center; color:var(--text3); font-size:11px; padding:22px 8px; line-height:1.5; }

.mf-fill-preview-col { display:flex; flex-direction:column; }
.mf-fill-toolbar {
  display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap;
  background:var(--bg2); border:1px solid var(--border); border-radius:12px; padding:10px 14px;
}
.mf-fill-status { font-size:11.5px; color:var(--text2); margin-right:auto; font-weight:600; }
.mf-fill-status .mf-fill-status-dot {
  display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--text3); margin-right:6px;
}
.mf-fill-status.mf-editing .mf-fill-status-dot { background:var(--amber, #F59E0B); }
.mf-fill-toolbar button { padding:8px 14px; font-size:11.5px; }
.mf-preview-panel.mf-preview-visible { position:static !important; }
.mf-fill-preview-col .mf-preview-scroll { max-height:none; }

/* Mail-merge mapping modal */
.mf-merge-field { margin-bottom:14px; }
.mf-merge-field label { display:block; font-size:11px; color:var(--text2); margin-bottom:5px; }
.mf-merge-map-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.mf-merge-map-row span { flex:0 0 40%; font-size:12px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mf-merge-map-row select { flex:1; }
.mf-merge-hint { font-size:10.5px; color:var(--text3); margin-top:-4px; margin-bottom:14px; line-height:1.5; }

/* ─── MAKE FORMS: CANVAS MODE ─── */
.mfc-ribbon-shell {
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg2);
  margin-bottom: 18px; overflow: hidden;
}
.mfc-ribbon-shell .pdfed-ribbon { height: 58px; padding: 0 12px; }
.mfc-page-select {
  background: var(--pdfed-ribbon-btn-bg); border: 1px solid var(--border); color: var(--text2);
  font-family: 'Inter', sans-serif; font-size: 10.5px; font-weight: 500; border-radius: 5px;
  padding: 5px 6px; cursor: pointer; outline: none; height: 26px;
}
.mfc-canvas-scroll {
  max-height: 74vh; overflow: auto; padding: 26px; background: var(--bg3);
  border-radius: var(--radius); border: 1px solid var(--border);
  display: flex; justify-content: center;
}
.mfc-pages { display: flex; flex-direction: column; align-items: center; gap: 30px; --mfc-zoom: 1; }
.mfc-page-wrap { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.mfc-page-bar { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text3); font-weight: 500; }
.mfc-page-bar button {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text2);
  width: 20px; height: 20px; border-radius: 5px; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center; transition: all .15s; padding: 0;
}
.mfc-page-bar button:hover { border-color: rgba(239,68,68,0.5); color: #ef4444; }
.mfc-page {
  position: relative; background: #ffffff; box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  border-radius: 2px; flex-shrink: 0; overflow: hidden; cursor: default;
}
.mfc-box { position: absolute; box-sizing: border-box; cursor: move; }
.mfc-box .mfc-handle { display: none; }
.mfc-box:hover .mfc-handle, .mfc-box.selected .mfc-handle { display: block; }
.mfc-box.selected { outline: 2px solid var(--blue); outline-offset: 1px; z-index: 5; }
.mfc-box-drag {
  position: absolute; top: -1px; left: 0; right: 0; height: 8px; cursor: grab; border-radius: 2px 2px 0 0;
}
.mfc-box.selected .mfc-box-drag, .mfc-box:hover .mfc-box-drag { background: rgba(0,115,230,0.16); }
.mfc-box-inner {
  width: 100%; height: 100%; box-sizing: border-box; padding: 3px 6px; outline: none;
  color: #1a1a1a; font-family: 'Inter', sans-serif; overflow: hidden; cursor: text; line-height: 1.35;
}
.mfc-box-inner:empty:before { content: attr(data-ph); color: #9aa0a6; }
.mfc-handle {
  position: absolute; width: 9px; height: 9px; background: var(--blue);
  border: 1.5px solid #fff; border-radius: 50%; z-index: 6; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.mfc-handle.nw { top: -5px; left: -5px; cursor: nwse-resize; }
.mfc-handle.ne { top: -5px; right: -5px; cursor: nesw-resize; }
.mfc-handle.sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.mfc-handle.se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.mf-form-card .mf-form-tag {
  position: absolute; top: 14px; right: 14px; font-size: 8.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--cyan); background: rgba(0,194,255,0.12); padding: 3px 7px; border-radius: 5px;
}

@media print {
  body.mfc-printing * { visibility: hidden; }
  body.mfc-printing #mfcPages, body.mfc-printing #mfcPages * { visibility: visible; }
  body.mfc-printing #mfcPages {
    --mfc-zoom: 1 !important; position: fixed; top: 0; left: 0; gap: 0; margin: 0;
  }
  body.mfc-printing .mfc-page-bar,
  body.mfc-printing .mfc-handle,
  body.mfc-printing .mfc-box-drag { display: none !important; }
  body.mfc-printing .mfc-page { box-shadow: none; border-radius: 0; background-image: none !important; }
  body.mfc-printing .mfc-page-wrap:not(:last-child) { page-break-after: always; }
  body.mfc-printing .mfc-box.selected { outline: none; }
}
