/* =========================================
   MAIN LAYOUT
========================================= */

.pfb-wrap{
    display:flex;
    gap:18px;
    height:calc(100vh - 90px);
    align-items:stretch;
}


/* =========================================
   LEFT TOOLBOX
========================================= */

.pfb-tools{
    width:240px;
    flex-shrink:0;
    background:#fff;
    padding:18px;
    border-radius:8px;
    overflow:auto;
    box-shadow:0 2px 6px rgba(0,0,0,0.05);
}

.pfb-tool{
    padding:12px;
    background:#f3f5f8;
    margin-bottom:10px;
    cursor:grab;
    border-radius:6px;
    text-align:center;
    font-weight:600;
    transition:.15s;
}

.pfb-tool:hover{
    background:#e6ebf1;
}


/* =========================================
   CANVAS WRAP
========================================= */

.pfb-canvas-wrap{
    flex:1 1 auto;
    min-width:0;
    background:#fff;
    padding:18px;
    border-radius:8px;
    display:flex;
    flex-direction:column;
    overflow:hidden;
}

#pfb-name{
    width:100%;
    height:42px;
    padding:0 10px;
    margin-bottom:12px;
}


/* =========================================
   CANVAS
========================================= */

#pfb-canvas{
    flex:1;
    min-height:420px;
    border:2px dashed #ddd;
    padding:15px;
    overflow:auto;
}


/* =========================================
   ROW
========================================= */

.pfb-row{
    border:2px dashed #cfd8e3;
    padding:12px;
    margin-bottom:14px;
    background:#f9fbfd;
}


/* =========================================
   COLUMNS
========================================= */

.pfb-cols{
    display:flex;
    gap:12px;
}

.pfb-col{
    flex:1;
    min-height:80px;
    border:1px dashed #bbb;
    padding:8px;
    background:#fff;
}


/* =========================================
   FIELD
========================================= */

.pfb-field{
    border:1px solid #e4e7ed;
    background:#fafafa;
    padding:12px;
    margin-bottom:10px;
    position:relative;
    cursor:pointer;
    transition:.15s;
}

.pfb-field:hover{
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

.pfb-field.pfb-selected{
    outline:2px solid #4a90e2;
    background:#eef6ff;
}


/* =========================================
   FIELD ACTION BUTTONS
========================================= */

.pfb-actions{
    position:absolute;
    top:6px;
    right:6px;
    display:flex;
    gap:6px;
}

.pfb-actions span{
    background:#fff;
    border:1px solid #ccc;
    padding:2px 6px;
    cursor:pointer;
    border-radius:4px;
}


/* =========================================
   INPUT STYLE (BUILDER)
========================================= */

.pf-label{
    font-weight:600;
    margin-bottom:6px;
    display:block;
}

.pf-input{
    width:100%;
    height:36px;
    padding:6px 8px;
    border:1px solid #ccc;
    border-radius:4px;
}

textarea.pf-input{
    height:80px;
}


/* =========================================
   SETTINGS PANEL
========================================= */

.pfb-settings{
    width:320px;
    flex-shrink:0;
    background:#fff;
    border-radius:10px;
    box-shadow:0 4px 14px rgba(0,0,0,0.08);
    display:flex;
    flex-direction:column;
    overflow:hidden;
}

.pfb-settings-header{
    padding:16px;
    font-weight:700;
    font-size:16px;
    border-bottom:1px solid #eee;
    background:#fafafa;
}

.pfb-settings label{
    font-weight:600;
    font-size:13px;
    margin-top:14px;
    display:block;
}

.pfb-settings input,
.pfb-settings textarea,
.pfb-settings select{
    width:100%;
    padding:8px;
    margin-bottom:14px;
    border-radius:6px;
    border:1px solid #ccc;
}

.pfb-settings input[type="checkbox"]{
    display:inline-block;
    width:auto;
    height:auto;
    margin-right:8px;
    appearance:auto;
}


/* =========================================
   TABS
========================================= */

.pfb-tabs{
    display:flex;
    border-bottom:1px solid #eee;
}

.pfb-tab{
    flex:1;
    padding:12px;
    background:#f5f6f8;
    border:none;
    cursor:pointer;
    font-weight:600;
}

.pfb-tab.active{
    background:#fff;
    border-bottom:3px solid #2271b1;
}


/* =========================================
   PANELS
========================================= */

.pfb-panel{
    display:none;
    padding:16px;
    overflow:auto;
}

.pfb-panel.active{
    display:block;
}


/* =========================================
   SORTABLE PLACEHOLDER
========================================= */

.pfb-placeholder{
    border:2px dashed #4a90e2;
    height:50px;
    margin-bottom:8px;
}


/* =========================================
   DROP HIGHLIGHT
========================================= */

.pfb-col.ui-droppable-active{
    background:#f0f8ff;
}


/* =========================================
   RESIZE / GUIDES
========================================= */

.pfb-resize-handle{
    width:6px;
    position:absolute;
    right:0;
    top:0;
    bottom:0;
    cursor:col-resize;
}

.pfb-guide-x,
.pfb-guide-y{
    position:absolute;
    background:#2271b1;
    opacity:.3;
    z-index:99999;
    pointer-events:none;
}

.pfb-guide-x{ height:1px; width:100%; }
.pfb-guide-y{ width:1px; height:100%; }



/* =====================================================
   FRONTEND FORM STYLES (NEW)
   Mirrors builder layout
===================================================== */

.pfp-public-form{
    max-width:900px;
}

.pfp-row{
    display:flex;
    gap:20px;
    margin-bottom:18px;
}

.pfp-col{
    flex:1;
}

.pfp-field{
    margin-bottom:14px;
}

.pfp-public-form label{
    font-weight:600;
    display:block;
    margin-bottom:6px;
}

.pfp-public-form input,
.pfp-public-form select,
.pfp-public-form textarea{
    width:100%;
    padding:8px;
    border:1px solid #ccc;
    border-radius:6px;
    box-sizing:border-box;
}

.pfp-public-form button{
    background:#2271b1;
    color:#fff;
    border:none;
    padding:10px 18px;
    border-radius:6px;
    cursor:pointer;
}

.pfp-public-form button:hover{
    background:#1a5f96;
}


/* =========================================
   VALIDATION STYLES
========================================= */

.rfb-error{
    color:#e53935;
    font-size:12px;
    margin-top:4px;
}

.rfb-invalid{
    border:1px solid #e53935 !important;
    background:#fff5f5;
}

/* =========================================
   ROW / COLUMN DELETE CONTROLS (NEW)
========================================= */

.pfb-del-row,
.pfb-del-col{
    position:absolute;
    top:6px;
    right:6px;
    background:#ff4d4f;
    color:#fff;
    font-size:12px;
    width:18px;
    height:18px;
    text-align:center;
    line-height:18px;
    border-radius:50%;
    cursor:pointer;
    opacity:0;
    z-index:20;
}

.pfb-row:hover .pfb-del-row,
.pfb-col:hover .pfb-del-col{
    opacity:1;
}

.pfb-row,
.pfb-col{
    position:relative;
}
