/*-----------------
Backend related CSS
-----------------*/

/* ============================================
   CENTREX OPTIONS PANEL STYLES
   Clean, professional design matching flyout panel
   ============================================ */

.centrex-options-wrapper {
    max-width: 720px;
    margin: 24px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0;
    
}

/* Section Headers with dashicons */
.centrex-options-wrapper h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0159a3;
    margin: 0;
    padding: 20px 24px 14px 24px;
    border-bottom: none;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.centrex-options-wrapper h2:first-of-type {
    border-top: none;
}

.centrex-options-wrapper h2 i.centrex-fad {
    font-size: 18px;
    color: #0159a3;
}

/* Section description text directly under h2 */
.centrex-options-wrapper h2 + p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    padding: 0 24px 16px 24px;
    background: #f8fafc;
}

/* Form table container */
.centrex-options-wrapper .form-table {
    margin: 0;
    padding: 0;
    background: #fff;
    border-collapse: collapse;
}

.centrex-options-wrapper .form-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.centrex-options-wrapper .form-table tr:last-child {
    border-bottom: none;
}

.centrex-options-wrapper .form-table th {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    padding: 20px 24px 6px 24px;
    width: 100%;
    vertical-align: top;
    text-align: left;
}

.centrex-options-wrapper .form-table td {
    display: block;
    padding: 0 24px 20px 24px;
    margin: 0;
}

/* Input styling */
.centrex-options-wrapper input[type=email],
.centrex-options-wrapper input[type=url],
.centrex-options-wrapper input[type=text] {
    width: 100% !important;
    max-width: 420px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
    box-sizing: border-box;
    color: #1e293b;
}

.centrex-options-wrapper input[type=email]:focus,
.centrex-options-wrapper input[type=url]:focus,
.centrex-options-wrapper input[type=text]:focus {
    outline: none;
    border-color: #0159a3;
    box-shadow: 0 0 0 3px rgba(1, 89, 163, 0.08);
}

.centrex-options-wrapper input[type=email]::placeholder,
.centrex-options-wrapper input[type=url]::placeholder,
.centrex-options-wrapper input[type=text]::placeholder {
    color: #94a3b8;
}

/* Checkbox styling */
.centrex-options-wrapper input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #0159a3;
    cursor: pointer;
    vertical-align: middle;
}

.centrex-options-wrapper input[type=checkbox] + label,
.centrex-options-wrapper td label {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    vertical-align: middle;
}

/* Description text under fields */
.centrex-options-wrapper .description,
.centrex-options-wrapper p.description {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
    max-width: 100%;
}

/* Submit button section */
.centrex-options-wrapper .submit {
    padding: 24px;
    margin: 0;
    margin-top: 10px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.centrex-options-wrapper .submit p.submit {
    margin: 0;
    padding: 0;
}

.centrex-options-wrapper .submit input[type=submit],
.centrex-options-wrapper input[type=submit].button-primary {
    margin-top: 20px;
    padding: 10px 24px !important;
    background: linear-gradient(135deg, #0159a3, #2563eb) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-shadow: none !important;
    box-shadow: 0 1px 3px rgba(1, 89, 163, 0.3) !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.centrex-options-wrapper .submit input[type=submit]:hover,
.centrex-options-wrapper input[type=submit].button-primary:hover {
    background: linear-gradient(135deg, #014a8c, #1d4ed8) !important;
    box-shadow: 0 2px 6px rgba(1, 89, 163, 0.4) !important;
}

.centrex-options-wrapper .submit input[type=submit]:active,
.centrex-options-wrapper input[type=submit].button-primary:active {
    transform: translateY(1px);
}

/* Button styling for cache/log clear buttons */
.centrex-options-wrapper .button,
.centrex-options-wrapper button.button {
    padding: 8px 16px;
    background: #fff;
    color: #0159a3;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-options-wrapper .button:hover,
.centrex-options-wrapper button.button:hover {
    background: #f8fafc;
    border-color: #0159a3;
    color: #0159a3;
}

.centrex-options-wrapper .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cache field wrapper styling */
.centrex-options-wrapper .centrex-cache-field-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.centrex-options-wrapper .centrex-cache-field-wrap .description {
    flex-basis: 100%;
    margin-top: 8px;
}

.centrex-options-wrapper .centrex-cache-status {
    font-size: 12px;
    font-weight: 500;
}

/* ============================================
   LOGGING CONTROLS - Gravity Forms Style
   ============================================ */

.centrex-logging-controls {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.centrex-log-row {
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.centrex-log-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.centrex-log-row:first-child {
    padding-top: 0;
}

.centrex-log-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.centrex-log-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.centrex-log-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.centrex-log-actions a {
    color: #0159a3;
    text-decoration: none;
    cursor: pointer;
}

.centrex-log-actions a:hover {
    text-decoration: underline;
}

.centrex-log-actions .centrex-delete-log-link {
    color: #dc2626;
}

.centrex-log-actions .centrex-delete-log-link:hover {
    color: #b91c1c;
}

.centrex-log-separator {
    color: #d1d5db;
}

.centrex-log-file-size {
    color: #64748b;
    font-size: 12px;
}

.centrex-log-row-checkbox {
    display: flex;
    align-items: center;
}

/* Log Viewer Modal */
.centrex-log-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.centrex-log-viewer-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    
}

.centrex-log-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.centrex-log-viewer-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.centrex-log-viewer-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.centrex-log-viewer-close:hover {
    color: #1e293b;
}

.centrex-log-viewer-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.6;
    color: #334155;
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f8fafc;
    margin: 0;
    max-height: 60vh;
}

/* Hide WordPress notices container that may appear inside wrapper */
.centrex-options-wrapper .notice,
.centrex-options-wrapper .updated,
.centrex-options-wrapper .error {
    display: none;
}

/* Legacy logo - hide it as we now have the header */
.centrex-logo-options {
    display: none;
}


/*-----------------
Centrex Form Builder CSS
-----------------*/

.centrex-sbbuilder-h1 {
    padding-top: 20px;
}

.centrex-sidebar-notice {
    padding: 0 5px 20px 5px
}


.plugin-header {
    background-color: #0159a3;
    background-image: linear-gradient(61deg, #0159a3, #337ff1);
    background-size: 100%;
    margin-left: -20px;
    color: white;
    font-size: 25px;
    width: calc(100% + 20px);
    clear: both;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 20px;
    box-sizing: border-box;
}

.plugin-header .centrex-plugin-text, .plugin-header img {
    float: none;
}

.plugin-header img {
    padding: 10px;
}

.plugin-header .centrex-plugin-text {
    line-height: 64px;
}

.plugin-header-left {
    display: flex;
    align-items: center;
}

.centrex-form-builder-wrapper .posturlHelperText {
    font-style: italic;
}


/* Select2 dropdown styling - Global overrides with high specificity */
.select2-dropdown {
    z-index: 100010 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    background-color: #fff !important;
}

.select2-container--default .select2-results__option {
    padding: 10px 12px !important;
    color: #333 !important;
    background-color: #fff !important;
}

.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option[aria-selected=true]:hover,
.select2-results__option--highlighted {
    background-color: #0159a3 !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #e8f4fc !important;
    color: #0159a3 !important;
}

.select2-container--default .select2-results__option[aria-selected=true]:hover {
    background-color: #0159a3 !important;
    color: #fff !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    padding: 8px 10px !important;
    color: #333 !important;
    background-color: #fff !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    border-color: #0159a3 !important;
    box-shadow: 0 0 0 2px rgba(1, 89, 163, 0.1) !important;
}

.select2-results__options {
    background-color: #fff !important;
}

.select2-container--open .select2-dropdown--below {
    border-top: 1px solid #d1d5db !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.centrex-page-break {
    align-items: center;
    color: #666;
    font-size: 16px;
    display: flex;
    text-align: center;
}


.centrex-page-break::before {
    background: repeating-linear-gradient(to left, #ddd 0, #ddd 9px, transparent 9px, transparent 13px);
    margin-right: 1rem;
}

.centrex-page-break::after {
    background: repeating-linear-gradient(to right, #ddd 0, #ddd 9px, transparent 9px, transparent 13px);
    margin-left: 1rem;
}

.centrex-page-break::before,
.centrex-page-break::after {
    content: "";
    flex-grow: 1;
    height: 4px;
}

/*-----------------
Centrex Form List Page
-----------------*/

.centrex-table-view .widefat a, .centrex-table-view .widefat span {
    font-size: 15px;
}

.centrex-table-view .widefat td {
    line-height: 2.5em;
}

.centrex-add-new-form-button {
    margin: 15px 0;
}

.centrex_page_centrex-form-builder .centrex-form-row {
    transition: transform 1.5s 0s, opacity 1.25s 0s;
    transform: translateX(0);
    opacity: 1;
}

.centrex_page_centrex-form-builder .centrex-form-row.is-deleting {
    transition: transform 1.5s 0s, opacity 1.5s 0s;
    transform: translateX(100vw);
    opacity: 0;
}

.centrex_page_centrex-form-builder .copy-shortcode, .centrex_page_centrex-form-builder .clone-form {
    color: #135e96;
    cursor: copy;
}

.centrex_page_centrex-form-builder .copy-shortcode.copied {
    color: #4caf50;
    transition: color 1000ms linear;
}


.centrex_page_centrex-form-builder .centrex-form-row.disable-deletion .delete-form-row {
    cursor: not-allowed;
}

.centrex_page_centrex-form-builder .delete-form-row {
    color: #e31515;
    cursor: pointer;
}


.centrex-delete-dialog {
    display: none;
}

.centrex-outer-stage-inputs {
    padding-bottom: 15px;
}

.centrex-outer-stage-inputs label {
    max-width: 100%;
    display: block;
    padding-bottom: 10px;
    width: 195px;
    font-size: 16px;
}

.centrex-outer-stage-inputs input {
    width: 100%;
    max-width: 100%;
    border-color: #cccccc;
    -moz-box-shadow: 1px 1px 8px 4px #ccc;
    -webkit-box-shadow: 1px 1px 8px 4px #ccc;
    box-shadow: 1px 1px 8px 4px #ccc;
}

.centrex-form-settings-container {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 0 solid #c5c5c5;
    background: transparent;
    max-width: calc(37% - 11px);
}

#centrex-form-settings-toggle {
    font-size: 20px;
    margin-bottom: 10px;
    cursor: pointer;
}

#centrex-form-settings-toggle i {
    color: #327eef;
}

#centrex-form-settings-toggle .builder-header {
    font-size: 28px;
    line-height: 50px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: bold;
    background-color: #52d8f8;
    background-image: linear-gradient(61deg, #52d8f8, #337ff1);
    background-size: 100%;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}


.ui-dialog-titlebar-close {
    display: none;
}

.ui-widget-header {
    border: 1px solid #0f4988;
    background: #0F4987;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    padding: 6px 7px;
}

.ui-dialog-buttonset {
    text-align: center;
}

.ui-widget button {
    margin: 10px;
}

.plaid-logo {
    background-image: url("../img/plaid_bank_logo.png");
    background-size: cover;
    width: 88px;
    height: 48px;
    margin: 10px;
}

.centrex-form-error-container.has-error {
    display: block;
    font-size: 20px;
    margin-bottom: 30px;
    position: relative;
    background: #e31515;
    color: white;
    padding: 1%;
    border-radius: 15px;
}

/* ============================================
   FORM SETTINGS FLYOUT PANEL STYLES
   ============================================ */

/* Form Settings Button (in header bar) */
.centrex-header-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    color: #0159a3;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.centrex-header-settings-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.centrex-header-settings-btn:active {
    transform: scale(0.98);
}

.centrex-header-settings-btn i {
    font-size: 16px;
}

/* Flyout Overlay */
.centrex-flyout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.centrex-flyout-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Flyout Panel Container */
.centrex-settings-flyout {
    position: fixed;
    top: 0;
    right: -900px;
    width: 900px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 100001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.centrex-flyout-overlay.active + .centrex-settings-flyout,
.centrex-settings-flyout.active {
    right: 0;
}

/* Flyout Header */
.centrex-flyout-header {
    background: linear-gradient(61deg, #0159a3, #337ff1);
    color: #fff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.centrex-flyout-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.centrex-flyout-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 400;
    line-height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
    margin: 0;
    text-align: center;
    font-family: Arial, sans-serif;
}

.centrex-flyout-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Flyout Body - contains sidebar and content */
.centrex-flyout-body {
    display: flex;
    flex: 1;
    
}

/* Flyout Sidebar (Tab Navigation) */
.centrex-flyout-sidebar {
    width: 200px;
    background: #f8f9fa;
    border-right: 1px solid #e5e7eb;
    padding: 16px 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.centrex-flyout-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
}

.centrex-flyout-nav-item:hover {
    background: #eef2f7;
    color: #0159a3;
}

.centrex-flyout-nav-item.active {
    background: #fff;
    color: #0159a3;
    border-left-color: #0159a3;
    font-weight: 600;
}

.centrex-flyout-nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Flyout Content Area */
.centrex-flyout-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #fff;
}

/* Tab Panels */
.centrex-tab-panel {
    display: none;
}

.centrex-tab-panel.active {
    display: block;
}

/* Section Headers in Content */
.centrex-settings-section-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #0159a3;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

/* Settings Row (label + input stacked) */
.centrex-settings-row {
    margin-bottom: 24px;
}

.centrex-settings-row:last-child {
    margin-bottom: 0;
}

.centrex-settings-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.centrex-settings-row .field-description {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
    line-height: 1.4;
}

.centrex-settings-row .optional-tag {
    font-weight: 400;
    color: #999;
    font-size: 12px;
}

.centrex-settings-row input[type="text"],
.centrex-settings-row input[type="url"],
.centrex-flyout-content input[type="text"],
.centrex-flyout-content input[type="url"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.centrex-settings-row select,
.centrex-flyout-content select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px;
    padding-right: 40px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 14px center;
    background-size: 12px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.centrex-settings-row input:focus,
.centrex-settings-row select:focus {
    outline: none;
    border-color: #0159a3;
    box-shadow: 0 0 0 3px rgba(1, 89, 163, 0.1);
}

/* Tooltip Icon */
.centrex-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    color: #0159a3;
    border-radius: 0;
    font-size: 14px;
    cursor: help;
    position: relative;
}

.centrex-tooltip-icon i {
    font-size: 14px;
    color: #0159a3;
}

/* Tooltip Popup */
.centrex-tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: 240px;
    text-align: left;
    z-index: 100002;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.centrex-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #333;
}

.centrex-tooltip-icon:hover .centrex-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Clixsign Warning Banner */
.centrex-clixsign-warning {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
    line-height: 1.5;
}

.centrex-clixsign-warning.visible {
    display: block;
}

/* Contact Update Warning Banner */
.centrex-contact-update-warning {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    font-size: 13px;
    color: #721c24;
    line-height: 1.5;
}

/* Flyout Footer */
.centrex-flyout-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #f8f9fa;
}

.centrex-btn-discard {
    padding: 10px 20px;
    background: #fff;
    color: #555;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.centrex-btn-discard:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.centrex-btn-save {
    padding: 10px 24px;
    background: linear-gradient(61deg, #0159a3, #337ff1);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.centrex-btn-save:hover {
    opacity: 0.95;
}

.centrex-btn-save:active {
    transform: scale(0.98);
}

/* Hide original form settings when flyout is active */
.centrex-form-settings-container.hidden-for-modal,
#centrex-form-settings-toggle.hidden-for-modal {
    display: none !important;
}

/* Legacy sidebar button - hide it */
.centrex-form-settings-btn {
    display: none !important;
}


/* ============================================
   CUSTOM FORM BUILDER STYLES
   ============================================ */

/* Palette (Left Sidebar) */
.centrex-fb-palette {
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    color: #1e293b;
    overflow-y: auto;
    position: sticky;
    top: 32px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
}

/* Palette Sections */
.centrex-fb-palette-section {
    margin-bottom: 12px;
}

.centrex-fb-palette-section:last-child {
    margin-bottom: 0;
}

.centrex-fb-palette-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.centrex-fb-palette-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.centrex-fb-palette-section-chevron {
    font-size: 11px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

/* Grid layout: 3 columns */
.centrex-fb-palette-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.centrex-fb-palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.15s ease;
    user-select: none;
    text-align: center;
    min-height: 72px;
}

.centrex-fb-palette-item:hover {
    border-color: #0159a3;
    background: #f0f7ff;
    box-shadow: 0 2px 4px rgba(1, 89, 163, 0.1);
}

.centrex-fb-palette-item:active {
    cursor: grabbing;
}

.centrex-fb-palette-item--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.centrex-fb-palette-item--disabled:hover {
    transform: none;
    border-color: #e2e8f0;
    background: #fff;
    box-shadow: none;
}

.centrex-fb-palette-item--exists {
    opacity: 0.6;
}

.centrex-fb-palette-item--dragging {
    opacity: 0.5;
}

.centrex-fb-palette-item-icon {
    font-size: 18px;
    color: #475569;
    line-height: 1;
}

.centrex-fb-palette-item:hover .centrex-fb-palette-item-icon {
    color: #0159a3;
}

.centrex-fb-palette-item-label {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    line-height: 1.2;
}

/* Plaid Logo Icon (image-based, matching grey tones of FA icons) */
.centrex-fb-icon-plaid {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: url("../img/plaid_small_icon.png") center / contain no-repeat;
    filter: grayscale(100%) brightness(1.4) opacity(0.7);
    transition: filter 0.15s ease;
    vertical-align: middle;
}

.centrex-fb-palette-item:hover .centrex-fb-icon-plaid {
    filter: grayscale(0%) brightness(1) opacity(1);
}

.centrex-fb-drag-ghost {
    position: fixed !important;
    pointer-events: none;
    z-index: 100000;
    opacity: 0.9;
    transform: rotate(2deg);
}

/* Canvas (Center Area) */
.centrex-fb-canvas {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.centrex-fb-canvas--drag-over {
    box-shadow: 0 0 0 3px #0159a3, 0 2px 8px rgba(0, 0, 0, 0.08);
}

.centrex-fb-canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.centrex-fb-canvas-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.centrex-fb-canvas-actions {
    display: flex;
    gap: 8px;
}

.centrex-fb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-fb-btn:hover:not(:disabled) {
    background: #e2e8f0;
    color: #475569;
}

.centrex-fb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.centrex-fb-btn-icon {
    font-size: 16px;
}

.centrex-fb-canvas-fields {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-content: flex-start;
}

.centrex-fb-canvas-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
}

.centrex-fb-canvas-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.centrex-fb-canvas-empty-text {
    font-size: 15px;
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
    margin: 0;
}

/* Field Cards */
.centrex-fb-field-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    
}

/* Field width variants */
.centrex-fb-field-card--full {
    width: 100%;
}

.centrex-fb-field-card--half {
    width: calc(50% - 6px);
}

.centrex-fb-field-card--third {
    width: calc(33.333% - 8px);
}

.centrex-fb-field-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.centrex-fb-field-card--selected {
    border-color: #0159a3;
    box-shadow: 0 0 0 3px rgba(1, 89, 163, 0.15);
}

.centrex-fb-field-card--dragging {
    opacity: 0.5;
    transform: rotate(1deg);
}

.centrex-fb-field-card--drag-over {
    border-color: #0159a3;
}

.centrex-fb-field-card-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    cursor: grab;
    color: #94a3b8;
    font-size: 14px;
}

.centrex-fb-field-card-handle:active {
    cursor: grabbing;
}

.centrex-fb-handle-dots {
    letter-spacing: -2px;
}

.centrex-fb-field-card-content {
    flex: 1;
    padding: 12px 16px;
    min-width: 0;
}

.centrex-fb-field-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.centrex-fb-field-card-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    
    text-overflow: ellipsis;
}

.centrex-fb-field-card-type {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.centrex-fb-field-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.centrex-fb-field-card-name {
    font-size: 12px;
    color: #94a3b8;
    font-family: monospace;
}

.centrex-fb-field-card-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e2e8f0;
    color: #64748b;
}

.centrex-fb-field-card-badge--required {
    background: #fef2f2;
    color: #dc2626;
}

.centrex-fb-field-card-badge--conditional {
    background: #eff6ff;
    color: #2563eb;
}

.centrex-fb-field-card-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.centrex-fb-field-preview-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.centrex-fb-field-preview-option {
    font-size: 11px;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    color: #475569;
}

.centrex-fb-field-preview-more {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

.centrex-fb-field-preview-header {
    font-size: 12px;
    margin: 0;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.centrex-fb-field-preview-paragraph {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.centrex-fb-field-preview-pagebreak {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

.centrex-fb-field-preview-plaid {
    font-size: 12px;
    color: #0159a3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.centrex-fb-plaid-icon {
    font-size: 16px;
}

.centrex-fb-field-card-actions {
    position: absolute;
    top: 6px;
    right: 18px;
    display: flex;
    align-items: center;
    z-index: 2;
}

.centrex-fb-field-card-delete {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 0 !important;
    text-indent: 0 !important;
    box-sizing: border-box !important;
}

.centrex-fb-field-card-delete svg {
    display: block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.centrex-fb-field-card:hover .centrex-fb-field-card-delete {
    opacity: 1;
}

.centrex-fb-field-card-delete:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Resize Handle (right edge) */
.centrex-fb-field-card-resize {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    border-radius: 0 8px 8px 0;
    cursor: ew-resize;
    color: #cbd5e1;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    user-select: none;
}

.centrex-fb-field-card:hover .centrex-fb-field-card-resize {
    opacity: 1;
}

.centrex-fb-field-card-resize:hover {
    background: #e2e8f0;
    color: #94a3b8;
}

.centrex-fb-resize-grip {
    font-size: 12px;
    line-height: 1;
}

.centrex-fb-field-card--resizing {
    opacity: 0.8;
    transition: width 0.05s ease;
    user-select: none;
}

/* Drop Indicator */
.centrex-fb-drop-indicator {
    height: 4px;
    background: #0159a3;
    border-radius: 2px;
    margin: 8px 0;
}

/* Editor (Right Panel) */
.centrex-fb-editor {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
    
}

.centrex-fb-editor--visible {
    /* Animation or visual cue when active */
}

.centrex-fb-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.centrex-fb-editor-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.centrex-fb-editor-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-fb-editor-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.centrex-fb-editor-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8;
    text-align: center;
}

.centrex-fb-editor-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.centrex-fb-editor-form {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.centrex-fb-editor-no-props {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Form Groups */
.centrex-fb-form-group {
    margin-bottom: 20px;
}

.centrex-fb-form-group:last-child {
    margin-bottom: 0;
}

.centrex-fb-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.centrex-fb-form-desc {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.centrex-fb-form-input,
.centrex-fb-form-textarea,
.centrex-fb-form-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.centrex-fb-form-input:focus,
.centrex-fb-form-textarea:focus,
.centrex-fb-form-select:focus {
    outline: none;
    border-color: #0159a3;
    box-shadow: 0 0 0 3px rgba(1, 89, 163, 0.1);
}

.centrex-fb-form-input:disabled,
.centrex-fb-form-textarea:disabled,
.centrex-fb-form-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.centrex-fb-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.centrex-fb-form-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.centrex-fb-form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #0159a3;
    cursor: pointer;
}

.centrex-fb-form-validation {
    font-size: 12px;
    margin-top: 6px;
    
}

.centrex-fb-form-validation--error {
    color: #dc2626;
}

/* Values Editor */
.centrex-fb-values-editor {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #f9fafb;
}

.centrex-fb-values-list {
    margin-bottom: 12px;
}

.centrex-fb-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
}

.centrex-fb-value-row:last-child {
    margin-bottom: 0;
}

.centrex-fb-value-row--dragging {
    opacity: 0.5;
    background: #f1f5f9;
}

.centrex-fb-value-handle {
    cursor: grab;
    color: #9ca3af;
    font-size: 14px;
    padding: 4px;
}

.centrex-fb-value-handle:active {
    cursor: grabbing;
}

.centrex-fb-value-label,
.centrex-fb-value-value {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    min-width: 0;
}

.centrex-fb-value-label:focus,
.centrex-fb-value-value:focus {
    outline: none;
    border-color: #0159a3;
}

.centrex-fb-value-selected-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    cursor: pointer;
}

.centrex-fb-value-selected {
    width: 16px;
    height: 16px;
    accent-color: #0159a3;
    cursor: pointer;
}

.centrex-fb-value-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-fb-value-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.centrex-fb-btn--add-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: all 0.15s ease;
}

.centrex-fb-btn--add-option:hover {
    border-color: #0159a3;
    color: #0159a3;
    background: #f0f7ff;
}

/* Select2 overrides for editor */
.centrex-fb-editor .select2-container {
    width: 100% !important;
}

.centrex-fb-editor .select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.centrex-fb-editor .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 12px;
}

.centrex-fb-editor .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* Save Button (inside canvas header actions) */
.centrex-fb-btn--save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #0159a3, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(1, 89, 163, 0.3);
    margin-left: 8px;
}

.centrex-fb-btn--save:hover {
    background: linear-gradient(135deg, #014a8c, #1d4ed8);
    box-shadow: 0 2px 8px rgba(1, 89, 163, 0.4);
    transform: translateY(-1px);
}

.centrex-fb-btn--save:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(1, 89, 163, 0.3);
}

.centrex-fb-btn--save .centrex-fb-btn-icon {
    font-size: 14px;
}

/* Form Builder Wrapper - 2-Column Layout (Editor is flyout) */
.centrex-fb-wrapper {
    display: flex;
    gap: 20px;
    min-height: 600px;
    
    background: #f5f7fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    
}

/* Toast Notifications */
.centrex-fb-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100002;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.centrex-fb-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.centrex-fb-toast--success {
    background: #10b981;
    color: #fff;
}

.centrex-fb-toast--error {
    background: #ef4444;
    color: #fff;
}

/* Save Button Loading State */
.centrex-fb-btn--loading {
    opacity: 0.7;
    cursor: wait;
}

/* Modal Overlay and Dialog */
.centrex-fb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100003;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.centrex-fb-modal-overlay--visible {
    opacity: 1;
}

.centrex-fb-modal-overlay--closing {
    opacity: 0;
}

.centrex-fb-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 480px;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s ease;
}

.centrex-fb-modal-overlay--visible .centrex-fb-modal {
    transform: scale(1) translateY(0);
}

.centrex-fb-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.centrex-fb-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.centrex-fb-modal-body {
    padding: 20px;
}

.centrex-fb-modal-message {
    margin: 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.centrex-fb-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.centrex-fb-modal-footer .centrex-fb-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-fb-modal-footer .centrex-fb-btn--primary {
    background: #0159a3;
    color: #fff;
    border: none;
}

.centrex-fb-modal-footer .centrex-fb-btn--primary:hover {
    background: #014a8a;
}

.centrex-fb-modal-footer .centrex-fb-btn--secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.centrex-fb-modal-footer .centrex-fb-btn--secondary:hover {
    background: #e2e8f0;
}

/* Container elements for components */
.centrex-fb-palette-container {
    width: 300px;
    flex-shrink: 0;
}

.centrex-fb-canvas-container {
    flex: 1;
    min-width: 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 900px) {
    .centrex-fb-wrapper {
        flex-direction: column;
    }

    .centrex-fb-palette-container {
        width: 100%;
        order: 2; /* Palette goes below canvas on mobile */
    }

    .centrex-fb-canvas-container {
        width: 100%;
        order: 1; /* Canvas stays on top on mobile */
    }

    .centrex-fb-palette {
        width: 100%;
        max-height: 300px;
        position: static;
    }
}

/* ============================================
   FIELD EDITOR FLYOUT PANEL STYLES
   Matches Form Settings flyout design
   ============================================ */

/* Flyout Overlay */
.centrex-field-flyout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.centrex-field-flyout-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Flyout Panel Container */
.centrex-field-flyout {
    position: fixed;
    top: 0;
    right: -520px;
    width: 520px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 100001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.centrex-field-flyout.active {
    right: 0;
}

/* Flyout Header */
.centrex-field-flyout .centrex-flyout-header {
    background: linear-gradient(61deg, #0159a3, #337ff1);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.centrex-field-flyout-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.centrex-field-flyout-icon {
    font-size: 18px;
}

.centrex-field-flyout-title-text {
    font-size: 16px;
}

/* Flyout Body */
.centrex-field-flyout-body {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

/* Field Preview Section */
.centrex-field-flyout-preview {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.centrex-field-preview-header {
    padding: 10px 16px 6px;
    border-bottom: 1px solid #f0f0f0;
}

.centrex-field-preview-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
}

.centrex-field-preview-content {
    padding: 12px 16px;
}

/* Preview Field Styles */
.centrex-preview-field {
    max-width: 400px;
}

.centrex-preview-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.centrex-preview-required {
    color: #dc2626;
    margin-left: 2px;
}

.centrex-preview-input,
.centrex-preview-textarea,
.centrex-preview-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #6b7280;
}

.centrex-preview-textarea {
    min-height: 60px;
    resize: none;
}

.centrex-preview-description {
    font-size: 12px;
    color: #6b7280;
    margin: 8px 0 0;
    line-height: 1.4;
}

.centrex-preview-checkbox-group,
.centrex-preview-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.centrex-preview-checkbox-label,
.centrex-preview-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: default;
}

.centrex-preview-checkbox-label input,
.centrex-preview-radio-label input {
    accent-color: #0159a3;
}

.centrex-preview-file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 14px;
    gap: 8px;
}

.centrex-preview-file-icon {
    font-size: 28px;
}

.centrex-preview-header {
    margin: 0;
    color: #1e293b;
}

.centrex-preview-paragraph {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.centrex-preview-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    margin: 0;
}

/* Flyout Sections Container */
.centrex-field-flyout-sections {
    padding: 12px;
}

.centrex-field-flyout-no-props {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    padding: 40px 20px;
}

/* Collapsible Sections */
.centrex-field-section {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
    
    border: 1px solid #e5e7eb;
}

.centrex-field-section:last-child {
    margin-bottom: 0;
}

.centrex-field-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.centrex-field-section-header:hover {
    background: #f8fafc;
}

.centrex-field-section-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0159a3;
    border-radius: 4px;
    font-size: 11px;
}

.centrex-field-section-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.centrex-field-section-chevron {
    color: #94a3b8;
    font-size: 11px;
    transition: transform 0.2s ease;
    line-height: 1;
}

.centrex-field-section--collapsed .centrex-field-section-chevron {
    transform: rotate(-90deg);
}

.centrex-field-section-content {
    padding: 10px 12px 12px;
    border-top: 1px solid #f1f5f9;
}

.centrex-field-section--collapsed .centrex-field-section-content {
    display: none;
}

/* Form fields in flyout - using existing .centrex-settings-row styles */
.centrex-field-flyout .centrex-settings-row {
    margin-bottom: 12px;
}

.centrex-field-flyout .centrex-settings-row:last-child {
    margin-bottom: 0;
}

.centrex-field-flyout .centrex-settings-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.centrex-field-flyout .field-description {
    font-size: 11px;
    color: #6b7280;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

/* Input wrapping */
.centrex-field-input-wrap input[type="text"],
.centrex-field-input-wrap input[type="number"],
.centrex-field-input-wrap textarea,
.centrex-field-input-wrap select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.centrex-field-input-wrap input:focus,
.centrex-field-input-wrap textarea:focus,
.centrex-field-input-wrap select:focus {
    outline: none;
    border-color: #0159a3;
    box-shadow: 0 0 0 3px rgba(1, 89, 163, 0.1);
}

.centrex-field-input-wrap input:disabled,
.centrex-field-input-wrap textarea:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.centrex-field-input-wrap textarea {
    resize: vertical;
    min-height: 48px;
}

.centrex-field-input-wrap textarea.centrex-field-textarea--tall {
    min-height: 120px;
}

/* Toggle/Checkbox Styling - needs !important to override WordPress admin styles */
.centrex-field-checkbox-wrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer;
    position: relative;
    padding: 2px 0;
}

.centrex-field-checkbox-wrap input[type="checkbox"] {
    position: relative !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 22px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: #d1d5db !important;
    border-radius: 11px !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    line-height: normal !important;
    vertical-align: middle !important;
}

.centrex-field-checkbox-wrap input[type="checkbox"]:checked {
    background: #0159a3 !important;
}

.centrex-field-checkbox-wrap input[type="checkbox"]::before {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 18px !important;
    height: 18px !important;
    background: #fff !important;
    border-radius: 50% !important;
    transition: transform 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    margin: 0 !important;
    float: none !important;
    display: block !important;
}

.centrex-field-checkbox-wrap input[type="checkbox"]:checked::before {
    content: '' !important;
    transform: translateX(18px) !important;
    background: #fff !important;
}

.centrex-field-checkbox-wrap input[type="checkbox"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}
.centrex-field-toggle-text {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

/* Validation messages */
.centrex-field-validation:not(:empty) {
    font-size: 12px;
    
    margin-top: 6px;
}

.centrex-field-validation--error {
    color: #dc2626;
}

/* Values Editor (Options) in Flyout */
.centrex-field-values-editor {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    
}

.centrex-field-values-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f1f5f9;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.centrex-field-values-col-label {
    flex: 1;
    padding-left: 30px;
}

.centrex-field-values-col-value {
    flex: 1;
}

.centrex-field-values-col-default {
    width: 60px;
    text-align: center;
}

.centrex-field-values-col-actions {
    width: 36px;
}

.centrex-field-values-list {
    padding: 8px;
}

.centrex-field-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: box-shadow 0.15s ease;
}

.centrex-field-value-row:last-child {
    margin-bottom: 0;
}

.centrex-field-value-row:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.centrex-field-value-row--dragging {
    opacity: 0.5;
    background: #f1f5f9;
}

.centrex-field-value-handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 14px;
    padding: 4px;
    display: flex;
    align-items: center;
}

.centrex-field-value-handle:active {
    cursor: grabbing;
}

.centrex-field-value-label,
.centrex-field-value-value {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    min-width: 0;
    transition: border-color 0.15s ease;
}

.centrex-field-value-label:focus,
.centrex-field-value-value:focus {
    outline: none;
    border-color: #0159a3;
}

.centrex-field-value-selected-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    cursor: pointer;
}

.centrex-field-value-selected {
    width: 18px;
    height: 18px;
    accent-color: #0159a3;
    cursor: pointer;
}

.centrex-field-value-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-field-value-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.centrex-field-values-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-top: 1px dashed #d1d5db;
    font-size: 13px;
    font-weight: 500;
    color: #0159a3;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-field-values-add:hover {
    background: #f0f7ff;
}

/* File Types Editor */
.centrex-field-file-types-editor {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.centrex-field-file-type-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.centrex-field-file-type-item:hover {
    border-color: #0159a3;
    background: #f8fafc;
}

.centrex-field-file-type-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0159a3;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.centrex-field-file-type-item input[type="checkbox"]:checked + .centrex-field-file-type-label {
    color: #0159a3;
    font-weight: 600;
}

.centrex-field-file-type-label {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    display: block;
}

.centrex-field-file-type-desc {
    font-size: 11px;
    color: #6b7280;
    display: block;
    margin-top: 2px;
}

.centrex-field-file-types-note {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    margin: 8px 0 0 0;
    padding: 0;
}

/* Conditional Logic Section - Inline UI (Gravity Forms style) */
.centrex-field-section-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 8px;
}

.centrex-field-conditional-inline {
    padding: 0;
}

.centrex-conditional-enable-row {
    margin-bottom: 16px;
}

.centrex-conditional-builder {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.centrex-conditional-sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.centrex-conditional-text {
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
}

.centrex-conditional-action,
.centrex-conditional-field,
.centrex-conditional-operator,
.centrex-conditional-value {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    min-width: 120px;
    transition: border-color 0.15s ease;
}

.centrex-conditional-action:focus,
.centrex-conditional-field:focus,
.centrex-conditional-operator:focus,
.centrex-conditional-value:focus {
    outline: none;
    border-color: #0159a3;
    box-shadow: 0 0 0 3px rgba(1, 89, 163, 0.1);
}

.centrex-conditional-action {
    min-width: 80px;
    font-weight: 500;
}

.centrex-conditional-field {
    min-width: 160px;
    flex: 1;
    max-width: 200px;
}

.centrex-conditional-operator {
    min-width: 140px;
}

.centrex-conditional-value-container {
    flex: 1;
    min-width: 120px;
}

.centrex-conditional-value {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive: stack on smaller screens */
@media (max-width: 600px) {
    .centrex-conditional-sentence {
        flex-direction: column;
        align-items: stretch;
    }

    .centrex-conditional-action,
    .centrex-conditional-field,
    .centrex-conditional-operator,
    .centrex-conditional-value-container {
        width: 100%;
        max-width: none;
    }
}

/* Conditional Logic Preview */
.centrex-conditional-preview {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #1e3a5f;
}

.centrex-conditional-preview strong {
    color: #0159a3;
}

.centrex-field-conditional-btn:hover {
    background: #014a8c;
}

.centrex-field-conditional-btn i {
    font-size: 14px;
}

/* Select2 in Flyout */
.centrex-field-flyout .centrex-field-select2 + .select2-container {
    width: 100% !important;
}

.centrex-field-flyout .select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.centrex-field-flyout .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 12px;
    color: #1f2937;
}

.centrex-field-flyout .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.centrex-field-flyout .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #0159a3;
    box-shadow: 0 0 0 3px rgba(1, 89, 163, 0.1);
}

/* Flyout Footer - reusing existing .centrex-flyout-footer, .centrex-btn-discard, .centrex-btn-save */
.centrex-field-flyout .centrex-flyout-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #f8f9fa;
}

/* Mobile responsiveness for flyout */
@media (max-width: 600px) {
    .centrex-field-flyout {
        width: 100%;
        right: -100%;
    }

    .centrex-field-flyout.active {
        right: 0;
    }

    .centrex-field-value-row {
        flex-wrap: wrap;
    }

    .centrex-field-value-label,
    .centrex-field-value-value {
        flex: 1 1 100%;
    }

    .centrex-field-values-header {
        display: none;
    }
}

/* ============================================
   PRO-LOCKED PALETTE ITEMS (Free Version)
   ============================================ */

.centrex-fb-palette-item--pro-locked {
    opacity: 0.65;
    cursor: pointer;
    position: relative;
    border: 1px dashed #b8d4f0;
    background: #f5f9ff;
}

.centrex-fb-palette-item--pro-locked:hover {
    opacity: 0.9;
    border-color: #337EF1;
    background: #eef4fd;
    box-shadow: none;
}

.centrex-fb-pro-lock-icon {
    display: none;
}

.centrex-fb-pro-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #6FC3F7 0%, #337EF1 100%);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

/* PRO badge in editor section headers — override palette absolute positioning */
.centrex-field-section-header .centrex-fb-pro-badge {
    position: static;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.centrex-field-section--pro-locked .centrex-field-section-header {
    opacity: 0.7;
    cursor: pointer;
}

.centrex-field-section--pro-locked .centrex-field-section-header:hover {
    opacity: 0.9;
}

.centrex-field-section--pro-locked .centrex-field-section-content {
    display: none !important;
}

/* ============================================
   UPGRADE MODAL (Free Version)
   ============================================ */

.centrex-upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.centrex-upgrade-modal {
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.centrex-upgrade-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.centrex-upgrade-modal-close:hover {
    color: #333;
}

.centrex-upgrade-modal-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6FC3F7 0%, #337EF1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.centrex-upgrade-modal-icon i {
    font-size: 24px;
    color: #fff;
}

.centrex-upgrade-modal h3 {
    font-size: 20px;
    margin: 0 0 12px;
    color: #1d2327;
}

.centrex-upgrade-modal p {
    font-size: 14px;
    color: #555;
    margin: 0 0 12px;
    line-height: 1.5;
}

.centrex-upgrade-modal-btn {
    display: inline-block;
    background: linear-gradient(135deg, #6FC3F7 0%, #337EF1 100%);
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    margin-top: 8px;
    transition: opacity 0.2s;
}

.centrex-upgrade-modal-btn:hover {
    opacity: 0.9;
    color: #fff !important;
    text-decoration: none;
}

/* ============================================
   SETUP NOTICE (Email required)
   ============================================ */

.centrex-setup-notice {
    max-width: 520px;
    margin: 60px auto;
    text-align: center;
    padding: 40px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.centrex-setup-notice-icon {
    width: 56px;
    height: 56px;
    background: #f0f4ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.centrex-setup-notice-icon i {
    font-size: 24px;
    color: #3858e9;
}

.centrex-setup-notice h3 {
    font-size: 18px;
    margin: 0 0 8px;
    color: #1d2327;
}

.centrex-setup-notice p {
    font-size: 14px;
    color: #646970;
    margin: 0 0 20px;
    line-height: 1.5;
}

