/* ==========================================================================
   Pop Emergency — "Spill the Tea" submit / edit page (v2.1)
   Loaded only on submit pages, scoped by body.pe-submit-page so it wins over
   WPUF Pro's stylesheet and the legacy inline remodel rules.
   ========================================================================== */

body.pe-submit-page {
    --pes-ink: #111;
    --pes-muted: #6b7280;
    --pes-line: rgba(0, 0, 0, .08);
    --pes-glass: rgba(255, 255, 255, .55);
    --pes-accent: #a855f7;
    --pes-accent-2: #4f46e5;
    --pes-ok: #10b981;
    --pes-warn: #f59e0b;
}

/* ---------- Hero ---------- */
body.pe-submit-page .pe-submit-hero { display: flex; flex-direction: column; gap: 14px; }
body.pe-submit-page .pe-submit-badge {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    background: rgba(168, 85, 247, .1); color: #7e22ce;
    font: 800 11px/1 'DM Sans', sans-serif; letter-spacing: 1.2px; text-transform: uppercase;
    border: 1px solid rgba(168, 85, 247, .18);
}
body.pe-submit-page .pe-submit-badge::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: var(--pes-accent); box-shadow: 0 0 0 4px rgba(168, 85, 247, .18);
}
body.pe-submit-page .mother-cont .pe-submit-hero h1 {
    margin: 0 !important; text-align: left !important;
}
body.pe-submit-page .pe-submit-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
body.pe-submit-page .pe-submit-chips li {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--pes-glass); border: 1px solid var(--pes-line);
    font: 700 12.5px/1 'DM Sans', sans-serif; color: #374151; margin: 0;
}
body.pe-submit-page .pe-submit-chips li svg { width: 14px; height: 14px; color: var(--pes-accent); flex: none; }

/* Disclaimer: tighter, no double padding */
body.pe-submit-page .mother-cont .wpb_wrapper > .wpb_text_column:nth-child(2) p {
    padding-top: 0 !important; padding-bottom: 0 !important;
}
body.pe-submit-page .mother-cont .wpb_wrapper > .wpb_text_column:nth-child(2) {
    padding: 22px 26px 22px 72px !important;
}

/* ---------- Numbered sections (inserted by pe-submit.js) ---------- */
body.pe-submit-page .wpuf-form-add ul.wpuf-form > li.pe-submit-section {
    display: flex !important; align-items: center; gap: 14px;
    margin: 14px 0 -10px !important; padding: 0 !important; list-style: none;
}
body.pe-submit-page .wpuf-form-add ul.wpuf-form > li.pe-submit-section:first-child { margin-top: 0 !important; }
body.pe-submit-page .pe-submit-section .pe-sec-num {
    flex: none; width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--pes-ink); color: #fff;
    font: 400 14px/1 'Archivo Black', sans-serif;
}
body.pe-submit-page .pe-submit-section .pe-sec-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
body.pe-submit-page .pe-submit-section .pe-sec-title {
    font: 400 17px/1.1 'Archivo Black', sans-serif; color: var(--pes-ink); text-transform: uppercase; letter-spacing: .5px;
}
body.pe-submit-page .pe-submit-section .pe-sec-desc { font: 600 13px/1.35 'DM Sans', sans-serif; color: var(--pes-muted); }
body.pe-submit-page .pe-submit-section::after {
    content: ''; flex: 1; height: 1px; background: var(--pes-line); margin-left: 6px;
}

/* ---------- Inputs: consistent height, padding & focus ---------- */
body.pe-submit-page .wpuf-form-add .wpuf-fields input[type="text"],
body.pe-submit-page .wpuf-form-add .wpuf-fields input[type="url"],
body.pe-submit-page .wpuf-form-add .wpuf-fields input[type="email"] {
    line-height: 56px !important;
    text-overflow: ellipsis;
}
body.pe-submit-page .wpuf-form-add .wpuf-fields .wpuf-help,
body.pe-submit-page .wpuf-form-add .wpuf-help {
    display: block; margin-top: 8px !important; font: 600 12.5px/1.45 'DM Sans', sans-serif !important; color: var(--pes-muted) !important;
}

/* ---------- FIX: Website URL icon overlapping the placeholder ----------
   The generic input rule resets padding/background with !important, and the
   focus rule wiped the icon. Higher specificity + longhands, every state. */
body.pe-submit-page .wpuf-form-add .wpuf-repeat-container .wpuf-fields input[type="url"],
body.pe-submit-page .wpuf-form-add .wpuf-repeat-container .wpuf-fields input[type="url"]:focus,
body.pe-submit-page .wpuf-form-add .wpuf-repeat-container .wpuf-fields input[type="url"]:hover {
    padding-left: 48px !important;
    padding-right: 18px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 17px 50% !important;
    background-size: 18px 18px !important;
    text-indent: 0 !important;
}
body.pe-submit-page .wpuf-form-add .wpuf-repeat-container .wpuf-fields input[type="url"]:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E") !important;
}
body.pe-submit-page .wpuf-form-add .wpuf-repeat-container .wpuf-fields input[type="url"]:user-invalid {
    border-color: #fca5a5 !important;
}
/* Repeater rows: the <li> sits inside a <td>; neutralise list spacing */
body.pe-submit-page .wpuf-repeat-container tr.wpuf-repeat-instance li.wpuf-el { list-style: none; margin: 0 !important; padding: 0 !important; width: 100%; }
body.pe-submit-page .wpuf-repeat-container tr.wpuf-repeat-instance { align-items: flex-start !important; }
body.pe-submit-page .wpuf-repeat-container .wpuf-repeat-controls { display: flex; }

/* Source box */
body.pe-submit-page .wpuf-form-add .wpuf-repeat-container {
    background: var(--pes-glass) !important;
    border: 1px solid var(--pes-line) !important;
    border-radius: 20px !important;
    padding: 22px !important;
    margin-top: 0 !important;
}
body.pe-submit-page .wpuf-repeat-container tr.wpuf-repeat-instance:last-child { margin-bottom: 0 !important; }

/* ---------- Upload dropzone ---------- */
body.pe-submit-page .pe-custom-upload-dropzone { min-height: 220px; gap: 6px; text-align: center; }
body.pe-submit-page .pe-custom-upload-dropzone:focus-visible { outline: 3px solid rgba(168, 85, 247, .35); outline-offset: 3px; }

/* ---------- Actions: plain row, no container ---------- */
body.pe-submit-page .pe-form-actions {
    position: static; padding: 0 !important; margin-top: 8px !important;
    background: none !important; border: 0 !important; box-shadow: none !important;
    -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0;
}
body.pe-submit-page .pe-btn-submit { background: linear-gradient(135deg, var(--pes-accent-2), var(--pes-accent)) !important; }
body.pe-submit-page .pe-btn-submit:hover { filter: brightness(1.05); }
body.pe-submit-page .pe-btn-draft:focus-visible,
body.pe-submit-page .pe-btn-submit:focus-visible { outline: 3px solid rgba(168, 85, 247, .4); outline-offset: 2px; }

/* ---------- Upload dropzone: never squashed, instructions always visible ---------- */
body.pe-submit-page .wpuf-el.featured_image,
body.pe-submit-page .wpuf-el.featured_image .wpuf-fields,
body.pe-submit-page .wpuf-el.featured_image .wpuf-attachment-upload-filelist { overflow: visible !important; height: auto !important; max-height: none !important; }
body.pe-submit-page .wpuf-form-add .pe-custom-upload-dropzone,
body.pe-submit-page .wpuf-form-add a.pe-custom-upload-dropzone {
    height: auto !important; min-height: 210px !important; max-height: none !important;
    line-height: 1.45 !important; white-space: normal !important; overflow: visible !important;
    padding: 36px 20px !important; text-align: center !important; text-indent: 0 !important;
    font-size: 14px !important; color: #111 !important; float: none !important;
}
body.pe-submit-page .pe-custom-upload-dropzone h4,
body.pe-submit-page .pe-custom-upload-dropzone p { display: block !important; visibility: visible !important; opacity: 1 !important; position: static !important; }
body.pe-submit-page .pe-custom-upload-dropzone .pe-up-icon { flex: none; }
body.pe-submit-page .wpuf-form-add a.pe-custom-upload-dropzone {
    display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important;
    width: 100% !important; box-sizing: border-box !important; background-image: none !important; vertical-align: top !important;
}
body.pe-submit-page .wpuf-form-add a.pe-custom-upload-dropzone::before,
body.pe-submit-page .wpuf-form-add a.pe-custom-upload-dropzone::after { content: none !important; display: none !important; }
body.pe-submit-page .wpuf-form-add a.pe-custom-upload-dropzone > * { flex: none; max-width: 100%; }

/* ---------- Category picker: hubs are headings, sub-categories are choices ---------- */
body.pe-submit-page .wpuf-form-add .pe-select-option.is-group {
    pointer-events: none; cursor: default; opacity: 1;
    padding: 14px 20px 6px !important; background: transparent !important;
    font: 400 11px/1.2 'Archivo Black', sans-serif !important; text-transform: uppercase; letter-spacing: 1.2px; color: #9ca3af !important;
}
body.pe-submit-page .wpuf-form-add .pe-select-option.is-group:not(:first-child) { border-top: 1px solid rgba(0,0,0,.06); margin-top: 4px; }
body.pe-submit-page .wpuf-form-add .pe-select-option.level-1 { padding-left: 32px !important; }
body.pe-submit-page .wpuf-form-add .pe-select-option.level-2 { padding-left: 44px !important; }

/* ---------- "The Tea" editor: modern toolbar ---------- */
body.pe-submit-page .wp-editor-container { border-radius: 18px !important; border: 1px solid var(--pes-line) !important; overflow: hidden !important; background: #fff !important; box-shadow: 0 10px 30px rgba(17,17,17,.05) !important; }
body.pe-submit-page div.mce-toolbar-grp { background: #fafafa !important; border-bottom: 1px solid var(--pes-line) !important; padding: 6px 8px !important; position: sticky; top: 0; z-index: 3; }
body.pe-submit-page .mce-toolbar .mce-btn-group .mce-btn { margin: 2px 1px !important; border-radius: 10px !important; border: 1px solid transparent !important; background: transparent !important; box-shadow: none !important; }
body.pe-submit-page .mce-toolbar .mce-btn-group .mce-btn:hover,
body.pe-submit-page .mce-toolbar .mce-btn-group .mce-btn:focus { background: #f3e8ff !important; border-color: #e9d5ff !important; }
body.pe-submit-page .mce-toolbar .mce-btn-group .mce-btn.mce-active { background: #ede9fe !important; border-color: #c4b5fd !important; }
body.pe-submit-page .mce-toolbar .mce-btn button { padding: 6px 8px !important; }
body.pe-submit-page .mce-toolbar .mce-ico { color: #374151 !important; }
body.pe-submit-page .mce-toolbar .mce-btn.mce-active .mce-ico { color: #6d28d9 !important; }
body.pe-submit-page .mce-toolbar .mce-listbox { background: #fff !important; border: 1px solid var(--pes-line) !important; border-radius: 10px !important; }
body.pe-submit-page .mce-toolbar .mce-listbox button { font: 700 13px 'DM Sans', sans-serif !important; color: #111 !important; }
body.pe-submit-page .mce-statusbar { border-top: 1px solid var(--pes-line) !important; background: #fafafa !important; }
body.pe-submit-page .mce-edit-area iframe { min-height: 380px; }
body.pe-submit-page .wp-editor-tabs { display: none !important; } /* visual editor only — no raw HTML for members */
body.pe-submit-page .mce-menu { border-radius: 14px !important; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.12) !important; border: 1px solid var(--pes-line) !important; }

/* ---------- Sidebar checklist ---------- */
.pe-submit-check {
    background: rgba(255, 255, 255, .45);
    -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .04);
    font-family: 'DM Sans', sans-serif;
}
.pe-submit-check h3 {
    margin: 0 0 4px; font: 400 16px/1.2 'Archivo Black', sans-serif; text-transform: uppercase; letter-spacing: .5px; color: #111;
}
.pe-submit-check .pe-check-sub { margin: 0 0 16px; font-size: 13px; font-weight: 600; color: #6b7280; }
.pe-submit-check .pe-check-bar { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .06); overflow: hidden; margin-bottom: 6px; }
.pe-submit-check .pe-check-bar span {
    display: block; height: 100%; width: 0; border-radius: inherit;
    background: linear-gradient(90deg, #4f46e5, #a855f7); transition: width .35s ease;
}
.pe-submit-check .pe-check-pct { display: block; text-align: right; font: 800 11px/1 monospace; color: #9ca3af; margin-bottom: 14px; }
.pe-submit-check ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pe-submit-check li {
    display: flex; align-items: center; gap: 12px; margin: 0;
    padding: 9px 10px; border-radius: 12px;
    font-size: 14px; font-weight: 700; color: #4b5563;
    transition: background .2s ease, color .2s ease;
}
.pe-submit-check li .pe-tick {
    flex: none; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #d1d5db; display: grid; place-items: center; transition: all .2s ease;
}
.pe-submit-check li .pe-tick svg { width: 12px; height: 12px; opacity: 0; color: #fff; transition: opacity .2s ease; }
.pe-submit-check li.is-done { color: #111; }
.pe-submit-check li.is-done .pe-tick { background: #10b981; border-color: #10b981; }
.pe-submit-check li.is-done .pe-tick svg { opacity: 1; }
.pe-submit-check li small { margin-left: auto; font: 800 10.5px/1 monospace; color: #9ca3af; }
.pe-submit-check .pe-check-tip {
    margin: 16px 0 0; padding: 12px 14px; border-radius: 14px;
    background: rgba(79, 70, 229, .06); color: #4338ca; font-size: 12.5px; font-weight: 600; line-height: 1.5;
}

@media (max-width: 1024px) {
    .pe-submit-check { display: none; }
}
@media (max-width: 640px) {
    body.pe-submit-page .pe-form-actions { bottom: 8px; border-radius: 18px; }
    body.pe-submit-page .pe-submit-section .pe-sec-desc { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pe-submit-check *, body.pe-submit-page .pe-form-actions * { transition: none !important; animation: none !important; }
}

/* WPUF list items never show bullets (WPUF's own CSS may load late or be trimmed) */
body.pe-submit-page .wpuf-form-add ul.wpuf-form,
body.pe-submit-page .wpuf-form-add ul.wpuf-form li { list-style: none !important; }
body.pe-submit-page .wpuf-form-add ul.wpuf-form li::marker { content: none; }

/* v3.1 — word / character count under the editor */
body.pe-submit-page .pe-wc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 10px 2px 0; font: 600 12.5px/1.2 'DM Sans', sans-serif; color: var(--pes-muted); }
body.pe-submit-page .pe-wc strong { font-weight: 800; color: var(--pes-ink); font-variant-numeric: tabular-nums; }
body.pe-submit-page .pe-wc .pe-wc-read { margin-left: auto; }
body.pe-submit-page .pe-wc.is-short strong:first-child { color: #d97706; }

/* v3.1 — dark mode: section numbers, editor chrome */
html[data-theme="dark"] body.pe-submit-page .pe-submit-section .pe-sec-num { background: linear-gradient(135deg, #6366f1, #a855f7) !important; color: #fff !important; box-shadow: 0 6px 16px rgba(99, 102, 241, .35); }
html[data-theme="dark"] body.pe-submit-page .pe-submit-section .pe-sec-title { color: #fafafa !important; }
html[data-theme="dark"] body.pe-submit-page .wp-editor-container,
html[data-theme="dark"] body.pe-submit-page div.mce-tinymce,
html[data-theme="dark"] body.pe-submit-page div.mce-panel { background: #15151c !important; border-color: rgba(255, 255, 255, .12) !important; }
html[data-theme="dark"] body.pe-submit-page div.mce-toolbar-grp { background: #1c1c24 !important; border-bottom-color: rgba(255, 255, 255, .1) !important; }
html[data-theme="dark"] body.pe-submit-page .mce-toolbar .mce-ico { color: #d4d4d8 !important; }
html[data-theme="dark"] body.pe-submit-page .mce-toolbar .mce-btn-group .mce-btn:hover,
html[data-theme="dark"] body.pe-submit-page .mce-toolbar .mce-btn-group .mce-btn:focus { background: rgba(167, 139, 250, .16) !important; border-color: rgba(167, 139, 250, .3) !important; }
html[data-theme="dark"] body.pe-submit-page .mce-toolbar .mce-btn-group .mce-btn.mce-active { background: rgba(167, 139, 250, .24) !important; border-color: rgba(167, 139, 250, .45) !important; }
html[data-theme="dark"] body.pe-submit-page .mce-toolbar .mce-btn.mce-active .mce-ico { color: #c4b5fd !important; }
html[data-theme="dark"] body.pe-submit-page .mce-btn-group:not(:first-child) { border-left-color: rgba(255, 255, 255, .12) !important; }
html[data-theme="dark"] body.pe-submit-page div.mce-statusbar { background: #1c1c24 !important; border-top-color: rgba(255, 255, 255, .1) !important; }
html[data-theme="dark"] body.pe-submit-page .mce-edit-area iframe { background: #15151c !important; }
html[data-theme="dark"] body.pe-submit-page .mce-menu, html[data-theme="dark"] .mce-menu { background: #1c1c24 !important; border-color: rgba(255,255,255,.12) !important; }
html[data-theme="dark"] .mce-menu .mce-text, html[data-theme="dark"] .mce-menu-item .mce-text { color: #e4e4e7 !important; }
html[data-theme="dark"] .mce-menu-item:hover, html[data-theme="dark"] .mce-menu-item.mce-selected { background: rgba(167,139,250,.18) !important; }

/* v3.2 — draft status + preview button */
body.pe-submit-page .pe-draft-status { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font: 600 12.5px/1 'DM Sans', sans-serif; color: var(--pes-muted); }
body.pe-submit-page .pe-draft-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d4d4d8; }
body.pe-submit-page .pe-draft-status.is-ok::before { background: #10b981; }
body.pe-submit-page .pe-draft-status.is-busy::before { background: #f59e0b; animation: peDraftPulse 1s ease-in-out infinite; }
body.pe-submit-page .pe-draft-status.is-bad { color: #dc2626; }
body.pe-submit-page .pe-draft-status.is-bad::before { background: #dc2626; }
@keyframes peDraftPulse { 50% { opacity: .3; } }

/* =====================================================================
 * v3.3.1 — WP User Frontend's form layout CSS (layout1.css) loads after the theme
 * and uses very specific selectors (6 classes deep, !important). The rules below
 * carry an ID-weight (:not(#pe-x)) so the theme's dropzone and editor always win.
 * ===================================================================== */
body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone,
body.pe-submit-page:not(#pe-x) .wpuf-form-add a.pe-custom-upload-dropzone {
    display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 4px !important;
    width: 100% !important; height: auto !important; min-height: 210px !important; max-height: none !important;
    padding: 34px 20px !important; margin: 0 !important; box-sizing: border-box !important;
    border: 2px dashed rgba(17, 17, 20, .16) !important; border-radius: 20px !important;
    background: rgba(255, 255, 255, .55) !important; box-shadow: none !important;
    color: #111114 !important; text-align: center !important; text-decoration: none !important; text-transform: none !important;
    font-size: 14px !important; line-height: 1.45 !important; font-weight: 600 !important; white-space: normal !important; cursor: pointer !important;
    transition: border-color .2s ease, background .2s ease !important;
}
body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone:hover,
body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone.is-drag,
body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone:focus-visible {
    border-color: #a855f7 !important; background: rgba(255, 255, 255, .9) !important; outline: none !important;
}
body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone::before,
body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone::after { content: none !important; display: none !important; background: none !important; }
body.pe-submit-page:not(#pe-x) .pe-custom-upload-dropzone .pe-up-icon {
    display: flex !important; align-items: center; justify-content: center; flex: none;
    width: 54px; height: 54px; margin: 0 0 12px; border-radius: 50%;
    border: 1px solid #e4e4e7; background: #fff; color: #a855f7;
}
body.pe-submit-page:not(#pe-x) .pe-custom-upload-dropzone .pe-up-title { display: block !important; font-size: 16px; font-weight: 800; color: #111114; line-height: 1.3; }
body.pe-submit-page:not(#pe-x) .pe-custom-upload-dropzone .pe-up-sub { display: block !important; font-size: 13px; font-weight: 600; color: #71717a; line-height: 1.4; }
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone {
    background: rgba(255, 255, 255, .03) !important; border-color: rgba(255, 255, 255, .16) !important; color: #f4f4f5 !important;
}
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone:hover,
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wpuf-fields a.file-selector.pe-custom-upload-dropzone.is-drag {
    background: rgba(167, 139, 250, .08) !important; border-color: #a78bfa !important;
}
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .pe-custom-upload-dropzone .pe-up-icon { background: #1c1c24; border-color: rgba(255, 255, 255, .12); color: #c4b5fd; }
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .pe-custom-upload-dropzone .pe-up-title { color: #fafafa; }
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .pe-custom-upload-dropzone .pe-up-sub { color: #a1a1aa; }
body.pe-submit-page:not(#pe-x) .wpuf-el.featured_image .wpuf-attachment-upload-filelist { overflow: visible !important; height: auto !important; }

/* Editor chrome (WPUF paints the toolbar #FAFAFA and the frame #DCDCDC). */
body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .wp-editor-container { border: 1px solid var(--pes-line, rgba(17, 17, 20, .1)) !important; border-radius: 16px !important; overflow: hidden !important; }
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .wp-editor-container { border-color: rgba(255, 255, 255, .12) !important; background: #15151c !important; }
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap div.mce-toolbar-grp.mce-panel,
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .mce-top-part,
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .quicktags-toolbar,
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap div.mce-statusbar.mce-panel { background: #1c1c24 !important; border-color: rgba(255, 255, 255, .1) !important; }
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .mce-panel { background: #15151c !important; border-color: rgba(255, 255, 255, .1) !important; }
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .mce-toolbar-grp .mce-panel,
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .mce-toolbar-grp .mce-container,
html[data-theme="dark"] body.pe-submit-page:not(#pe-x) .wpuf-form-add .wp-editor-wrap .mce-toolbar-grp .mce-container-body { background: transparent !important; }

/* Submission declaration next to the required checkbox */
.wpuf-el.terms_and_conditions label:has(.pe-submit-terms) { display: flex !important; align-items: flex-start; gap: 14px; }
.wpuf-el.terms_and_conditions label:has(.pe-submit-terms) input[type="checkbox"] { flex: none; margin-top: 2px !important; }
.pe-submit-terms { display: block; margin-left: 0; font-size: 13.5px; line-height: 1.6; font-weight: 500; color: #3f3f46; }
.pe-submit-terms strong { color: #111114; font-weight: 800; }
.pe-submit-terms a { color: #4f46e5; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
html[data-theme="dark"] .pe-submit-terms { color: #d4d4d8; }
html[data-theme="dark"] .pe-submit-terms strong { color: #f2f2f7; }
html[data-theme="dark"] .pe-submit-terms a { color: #a5b4fc; }

/* ---------- 3.6.4: consent card ---------- */
body.pe-submit-page .wpuf-el.terms_and_conditions { padding: 0 !important; margin: 0 !important; }
.pe-consent { border-radius: 22px; padding: 18px 18px 14px; background: linear-gradient(160deg, rgba(238,242,255,.85), rgba(250,245,255,.75)); border: 1px solid rgba(99,102,241,.14); display: flex; flex-direction: column; gap: 12px; }
.pe-consent-head { display: flex; align-items: center; gap: 12px; }
.pe-consent-head b { display: block; font: 400 14px/1.15 'Archivo Black', sans-serif; text-transform: uppercase; letter-spacing: .4px; color: #111114; }
.pe-consent-head small { display: block; margin-top: 3px; font: 600 12.5px/1.3 'DM Sans', sans-serif; color: #6b7280; }
.pe-consent-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #4f46e5; color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.28); }
.pe-consent-ico svg { width: 19px; height: 19px; }
.pe-consent-list { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pe-consent-list li { display: flex; align-items: flex-start; gap: 10px; margin: 0 !important; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.7); font: 500 12.5px/1.45 'DM Sans', sans-serif; color: #52525b; }
.pe-consent-list li b { color: #111114; font-weight: 800; }
.pe-consent-list li svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: #6366f1; }
body .wpuf-form-add .wpuf-el.terms_and_conditions .pe-consent label.pe-consent-agree { display: flex !important; align-items: center !important; gap: 12px !important; padding: 12px 14px !important; margin: 2px 0 0 !important; border-radius: 16px; background: #fff; border: 1.5px dashed rgba(79,70,229,.35); transition: background .15s, border-color .15s; width: 100% !important; box-sizing: border-box !important; }
body .wpuf-form-add .wpuf-el.terms_and_conditions .pe-consent label.pe-consent-agree input[type="checkbox"] { margin: 0 !important; }
body .wpuf-form-add .wpuf-el.terms_and_conditions .pe-consent label.pe-consent-agree .pe-submit-terms { font-size: 13px; line-height: 1.45; font-weight: 600; color: #27272a; }
body .wpuf-form-add .wpuf-el.terms_and_conditions .pe-consent label.pe-consent-agree:has(input:checked) { border-style: solid; border-color: #4f46e5; background: #eef2ff; }
html[data-theme="dark"] .pe-consent { background: linear-gradient(160deg, rgba(49,46,129,.28), rgba(59,7,100,.2)); border-color: rgba(129,140,248,.2); }
html[data-theme="dark"] .pe-consent-head b, html[data-theme="dark"] .pe-consent-list li b { color: #f4f4f5; }
html[data-theme="dark"] .pe-consent-head small { color: #a1a1aa; }
html[data-theme="dark"] .pe-consent-list li { background: rgba(255,255,255,.05); color: #a1a1aa; }
html[data-theme="dark"] body .wpuf-form-add .wpuf-el.terms_and_conditions .pe-consent label.pe-consent-agree { background: #18181e; border-color: rgba(129,140,248,.35); }
html[data-theme="dark"] body .wpuf-form-add .wpuf-el.terms_and_conditions .pe-consent label.pe-consent-agree .pe-submit-terms { color: #e4e4e7; }
html[data-theme="dark"] body .wpuf-form-add .wpuf-el.terms_and_conditions .pe-consent label.pe-consent-agree:has(input:checked) { background: rgba(79,70,229,.18); border-color: #818cf8; }
@media (max-width: 640px) { .pe-consent-list { grid-template-columns: 1fr; } .pe-consent { padding: 14px 12px 12px; } }

/* ---------- 3.6.4: a more compact page ---------- */
body.pe-submit-page div.mother-cont { padding: 36px 40px !important; }
body.pe-submit-page .mother-cont > .wpb_wrapper { gap: 14px !important; }
body.pe-submit-page .mother-cont .wpb_wrapper > .wpb_text_column:nth-child(2) { margin: 0 !important; padding: 16px 20px 16px 62px !important; }
body.pe-submit-page .mother-cont .wpb_wrapper > .wpb_text_column:nth-child(2) hr { display: none; }
body.pe-submit-page .pe-submit-hero { gap: 10px; }
body.pe-submit-page .wpuf-form-add { margin-top: 12px !important; }
body.pe-submit-page .wpuf-form-add ul.wpuf-form { gap: 20px !important; }
body.pe-submit-page .wpuf-form-add ul.wpuf-form > li.pe-submit-section { margin: 12px 0 -6px !important; }
body.pe-submit-page .wpuf-form-add .wpuf-label { margin-bottom: 8px !important; }
body.pe-submit-page .wpuf-form-add .wpuf-fields input[type="text"], body.pe-submit-page .wpuf-form-add .wpuf-fields input[type="url"], body.pe-submit-page .wpuf-form-add .wpuf-fields select { height: 50px !important; min-height: 50px !important; }
body.pe-submit-page .wpuf-form-add .wpuf-help { margin-top: 6px !important; font-size: 12px !important; }
body.pe-submit-page .wpuf-form-add textarea.textareafield, body.pe-submit-page .wpuf-form-add .wpuf-fields > textarea { min-height: 110px; }
body.pe-submit-page .pe-custom-upload-dropzone { min-height: 170px !important; padding: 24px 20px !important; }
body.pe-submit-page .pe-form-actions { margin-top: 4px !important; padding-top: 4px !important; }
@media (max-width: 768px) { body.pe-submit-page div.mother-cont { padding: 24px 18px !important; } }

/* ---------- 3.6.5: beat WPUF's form-layout CSS (li { margin-bottom: 40px !important }, checkbox label display:block) ---------- */
body.pe-submit-page .wpuf-form-add:not(#pe-x) ul.wpuf-form > li { margin-bottom: 0 !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) ul.wpuf-form li li { margin-bottom: 0 !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) ul.wpuf-form { gap: 22px !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) ul.wpuf-form > li.pe-submit-section { margin: 10px 0 -8px !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) ul.wpuf-form > li.pe-submit-section:first-child { margin-top: 0 !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 12px !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree input[type="checkbox"] { flex: none !important; margin: 0 !important; float: none !important; position: static !important; width: 22px !important; height: 22px !important; border-radius: 7px !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree .pe-submit-terms { flex: 1 1 auto; min-width: 0; margin: 0 !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent-list li { padding: 10px 12px !important; line-height: 1.45 !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-team-person { padding: 8px 10px !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .wpuf-el .wpuf-label, body.pe-submit-page .wpuf-form-add:not(#pe-x) .wpuf-el .wpuf-label label { line-height: 1.3 !important; }
body.pe-submit-page .pe-form-actions button, body.pe-submit-page .pe-form-actions .pe-btn-draft { white-space: nowrap !important; }
/* Consent checkbox: WPUF's layout CSS paints every checkbox white (also when ticked), hiding the tick. */
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree input[type="checkbox"] { -webkit-appearance: none !important; appearance: none !important; display: grid !important; place-content: center !important; background: #fff !important; border: 2px solid #a1a1aa !important; cursor: pointer; transition: background .15s, border-color .15s; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree input[type="checkbox"]::before { content: none !important; display: none !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree input[type="checkbox"]::after { content: '' !important; position: static !important; display: block !important; width: 11px !important; height: 6px !important; margin: 0 0 3px !important; background: transparent !important; border: 0 !important; border-left: 2.5px solid #fff !important; border-bottom: 2.5px solid #fff !important; border-radius: 0 !important; transform: rotate(-45deg) scale(0) !important; transition: transform .15s; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree input[type="checkbox"]:checked { background: #4f46e5 !important; border-color: #4f46e5 !important; }
body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1) !important; }
html[data-theme="dark"] body.pe-submit-page .wpuf-form-add:not(#pe-x) .pe-consent label.pe-consent-agree input[type="checkbox"]:not(:checked) { background: #18181e !important; border-color: #52525b !important; }
