/* ==========================================================================
   Login Page Customizer and Designer — Editor CSS
   ========================================================================== */

:root {
    --lpcd-primary: #330066;
    --lpcd-primary-hover: #220044;
    --lpcd-primary-light: #f3ecf9;
    --lpcd-success: #059669;
    --lpcd-danger: #dc2626;
    --lpcd-warning: #d97706;
    --lpcd-text: #1e293b;
    --lpcd-text-secondary: #64748b;
    --lpcd-border: #e2e8f0;
    --lpcd-bg: #f8fafc;
    --lpcd-card-bg: #ffffff;
    --lpcd-radius: 8px;
    --lpcd-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --lpcd-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --lpcd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Hide WP admin notices inside our app */
.lpcd-admin-wrapper .notice,
.lpcd-admin-wrapper .updated {
    display: none !important;
}

/* ── App Container ── */
.lpcd-app {
    font-family: var(--lpcd-font);
    color: var(--lpcd-text);
    margin: 0 0 0 -20px;
    min-height: calc(100vh - 32px);
    background: var(--lpcd-bg);
    position: relative;
    overflow-x: hidden;
    width: calc(100% + 20px);
    box-sizing: border-box;
}

@media screen and (max-width: 782px) {
    .lpcd-app {
        min-height: calc(100vh - 46px);
    }
}

/* ── Notices ── */
.lpcd-notices {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lpcd-notice {
    padding: 10px 20px;
    border-radius: var(--lpcd-radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--lpcd-shadow-md);
    animation: lpcd-slideIn 0.3s ease-out;
}

.lpcd-notice-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.lpcd-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes lpcd-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Loading ── */
.lpcd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 16px;
}

.lpcd-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--lpcd-border);
    border-top-color: var(--lpcd-primary);
    border-radius: 50%;
    animation: lpcd-spin 0.8s linear infinite;
}

@keyframes lpcd-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Buttons ── */
.lpcd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

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

.lpcd-btn-primary {
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
}

.lpcd-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #220044, #3d5ce6);
}

.lpcd-btn-secondary {
    background: #fff;
    color: var(--lpcd-text);
    border: 1px solid var(--lpcd-border);
}

.lpcd-btn-secondary:hover:not(:disabled) {
    background: var(--lpcd-bg);
    border-color: #5170ff;
    color: #330066;
}

.lpcd-btn-success {
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
}

.lpcd-btn-ghost {
    background: transparent;
    color: var(--lpcd-text);
}

.lpcd-btn-ghost:hover {
    background: var(--lpcd-bg);
}

.lpcd-btn-icon {
    background: transparent;
    color: var(--lpcd-text-secondary);
    padding: 6px;
}

.lpcd-btn-icon:hover:not(:disabled) {
    background: var(--lpcd-primary-light);
    color: var(--lpcd-primary);
}

.lpcd-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.lpcd-btn-light {
    background: rgba(255, 255, 255, 0.9);
    color: var(--lpcd-text);
    font-weight: 600;
}

.lpcd-btn-light:hover {
    background: #fff;
}

/* ── Gallery Layout ── */
.lpcd-gallery-layout {
    display: flex;
    height: calc(100vh - 32px - 22px);
}

@media screen and (max-width: 782px) {
    .lpcd-gallery-layout {
        height: calc(100vh - 46px - 22px);
    }
}

/* ── Sidebar ── */
.lpcd-sidebar {
    width: 340px;
    min-width: 340px;
    background: var(--lpcd-bg);
    border-right: 1px solid var(--lpcd-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lpcd-sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--lpcd-border);
}

.lpcd-sidebar-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.lpcd-sidebar-filters {
    padding: 12px 16px;
    border-bottom: 1px solid var(--lpcd-border);
}

.lpcd-category-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.lpcd-cat-tab {
    background: none;
    border: none;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--lpcd-text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.lpcd-cat-tab:hover {
    background: var(--lpcd-bg);
}

.lpcd-cat-tab.active {
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
}

.lpcd-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--lpcd-border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.lpcd-search-input:focus {
    border-color: var(--lpcd-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── Template Grid ── */
.lpcd-template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: #f1f5f9;
    /* Light slaty gray to make white cards pop */
}

.lpcd-template-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 120px;
}

.lpcd-template-card:hover {
    border-color: var(--lpcd-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.lpcd-template-card.selected {
    border-color: var(--lpcd-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 4px 10px rgba(0, 0, 0, 0.1);
}

.lpcd-template-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
}

.lpcd-template-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lpcd-template-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
}

.lpcd-template-thumb-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* SVG template previews */
.lpcd-template-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Image template previews (WebP) */
.lpcd-template-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-bottom: 1px solid var(--lpcd-border);
}

/* Create Your Own — highlighted CTA button */
.lpcd-create-blank-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(51, 0, 102, 0.3);
    white-space: nowrap;
}

.lpcd-create-blank-btn:hover {
    background: linear-gradient(135deg, #220044, #3d5ce6);
    box-shadow: 0 4px 14px rgba(51, 0, 102, 0.4);
    transform: translateY(-1px);
}

.lpcd-create-blank-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.lpcd-badge-active {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--lpcd-success);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.lpcd-badge-pro {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(51, 0, 102, 0.45);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.lpcd-template-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lpcd-fadeInQuick 0.15s ease-out;
}

@keyframes lpcd-fadeInQuick {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lpcd-template-info {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 40px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    flex-grow: 1;
}

.lpcd-template-name {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.lpcd-template-delete {
    background: #fee2e2;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: #ef4444;
    line-height: 1;
    transition: all 0.2s;
}

.lpcd-template-delete:hover {
    color: var(--lpcd-danger);
}

/* ── Preview Panel ── */
.lpcd-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lpcd-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--lpcd-card-bg);
    border-bottom: 1px solid var(--lpcd-border);
    gap: 12px;
}

.lpcd-preview-left,
.lpcd-preview-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpcd-preview-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.lpcd-preview-template-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--lpcd-text);
}

.lpcd-device-toggle {
    display: flex;
    background: var(--lpcd-bg);
    border-radius: 6px;
    padding: 2px;
}

.lpcd-device-btn {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--lpcd-text-secondary);
    transition: all 0.15s;
}

.lpcd-device-btn:hover {
    color: var(--lpcd-text);
}

.lpcd-device-btn.active {
    background: var(--lpcd-card-bg);
    color: var(--lpcd-primary);
    box-shadow: var(--lpcd-shadow);
}

.lpcd-preview-container {
    flex: 1;
    background: var(--lpcd-bg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
}

.lpcd-iframe-wrap {
    width: 100%;
    height: 100%;
    transition: max-width 0.3s ease;
    background: var(--lpcd-card-bg);
    border-radius: var(--lpcd-radius);
    box-shadow: var(--lpcd-shadow-md);
    overflow: hidden;
}

.lpcd-preview-iframe {
    width: 100%;
    height: 100%;
    min-height: 600px;
    border: none;
}

.lpcd-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--lpcd-text-secondary);
}

.lpcd-preview-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

/* ── Block Editor (Fullscreen) ── */
.lpcd-editor-fullscreen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 32px - 22px);
    background: var(--lpcd-bg);
}

@media screen and (max-width: 782px) {
    .lpcd-editor-fullscreen {
        height: calc(100vh - 46px - 22px);
    }
}

/* ── Draft Banner ── */
.lpcd-draft-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    font-size: 13px;
    color: #92400e;
}

/* ── Top Toolbar ── */
.lpcd-top-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--lpcd-card-bg);
    border-bottom: 1px solid var(--lpcd-border);
    gap: 12px;
}

.lpcd-toolbar-left,
.lpcd-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpcd-toolbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.lpcd-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--lpcd-border);
}

.lpcd-template-name-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--lpcd-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
}

.lpcd-template-name-btn:hover {
    background: var(--lpcd-bg);
}

.lpcd-template-name-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--lpcd-text-secondary);
}

.lpcd-template-name-input {
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--lpcd-primary);
    border-radius: 4px;
    padding: 4px 8px;
    outline: none;
    text-align: center;
    min-width: 200px;
}

/* ── Editor Body ── */
.lpcd-editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Block Inserter ── */
.lpcd-inserter-panel {
    width: 260px;
    min-width: 260px;
    background: var(--lpcd-card-bg);
    border-right: 1px solid var(--lpcd-border);
    padding: 16px;
    overflow-y: auto;
}

.lpcd-inserter-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lpcd-text-secondary);
    margin: 0 0 12px;
}

.lpcd-layout-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.lpcd-layout-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    border: 2px solid var(--lpcd-border);
    border-radius: 8px;
    background: var(--lpcd-card-bg);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--lpcd-text-secondary);
}

.lpcd-layout-option:hover {
    border-color: var(--lpcd-primary);
    color: var(--lpcd-primary);
}

.lpcd-layout-option.active {
    border-color: var(--lpcd-primary);
    background: var(--lpcd-primary-light);
    color: var(--lpcd-primary);
}

.lpcd-layout-icon {
    width: 100%;
    max-width: 60px;
}

.lpcd-layout-icon svg {
    width: 100%;
    height: auto;
}

.lpcd-layout-label {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.lpcd-inserter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lpcd-inserter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--lpcd-border);
    border-radius: 6px;
    background: var(--lpcd-card-bg);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    color: var(--lpcd-text);
}

.lpcd-inserter-item:hover:not(.disabled) {
    border-color: var(--lpcd-primary);
    background: var(--lpcd-primary-light);
}

.lpcd-inserter-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lpcd-inserter-item .dashicons {
    color: var(--lpcd-text-secondary);
}

/* ── Canvas ── */
.lpcd-canvas-wrapper {
    flex: 1;
    background: #e5e7eb;
    padding: 24px;
    overflow: auto;
    display: flex;
    justify-content: center;
}

.lpcd-canvas {
    width: 100%;
    min-height: 500px;
    border-radius: var(--lpcd-radius);
    box-shadow: var(--lpcd-shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    transition: max-width 0.3s ease;
    position: relative;
}

.lpcd-canvas-inner {
    width: 100%;
    max-width: 480px;
}

/* Split Canvas */
.lpcd-canvas.lpcd-canvas-split {
    padding: 0;
    border-radius: var(--lpcd-radius);
    overflow: hidden;
}

.lpcd-canvas-branding,
.lpcd-canvas-form-panel {
    position: relative;
    min-height: 400px;
}

.lpcd-panel-label {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.75);
    z-index: 5;
    pointer-events: none;
}

.lpcd-canvas-form-panel .lpcd-panel-label {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.45);
}

.lpcd-branding-content {
    width: 100%;
    max-width: 350px;
}

.lpcd-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    opacity: 0.4;
}

.lpcd-panel-empty .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.lpcd-panel-empty p {
    font-size: 12px;
    margin: 0;
}

/* Switch panel button highlight */
.lpcd-switch-panel-btn {
    background: #0ea5e9 !important;
    color: #fff !important;
    border-radius: 4px;
}

.lpcd-switch-panel-btn:hover {
    background: #0284c7 !important;
}

.lpcd-switch-panel-btn .dashicons {
    color: #fff !important;
}

/* Form block width constraint in split panels */
.lpcd-canvas-form-panel .lpcd-canvas-block,
.lpcd-canvas-branding .lpcd-canvas-block {
    max-width: 100%;
}

.lpcd-canvas-form-panel .lpcd-block-loginform {
    max-width: 100%;
    box-sizing: border-box;
}


.lpcd-canvas-block {
    position: relative;
    margin-bottom: 4px;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.15s;
}

.lpcd-canvas-block:hover {
    border-color: rgba(37, 99, 235, 0.3);
}

.lpcd-canvas-block.selected {
    border-color: var(--lpcd-primary);
}

/* ── Block Toolbar ── */
.lpcd-block-toolbar {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    background: var(--lpcd-card-bg);
    border: 1px solid var(--lpcd-border);
    border-radius: 6px;
    box-shadow: var(--lpcd-shadow-md);
    padding: 2px;
    z-index: 10;
}

.lpcd-block-action {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--lpcd-text-secondary);
    transition: all 0.1s;
}

.lpcd-block-action:hover {
    background: var(--lpcd-primary-light);
    color: var(--lpcd-primary);
}

.lpcd-block-action.delete:hover {
    background: #fef2f2;
    color: var(--lpcd-danger);
}

/* ── Inspector Panel ── */
.lpcd-inspector-panel {
    width: 300px;
    min-width: 300px;
    background: var(--lpcd-card-bg);
    border-left: 1px solid var(--lpcd-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lpcd-inspector-tabs {
    display: flex;
    border-bottom: 1px solid var(--lpcd-border);
}

.lpcd-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--lpcd-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.lpcd-tab:hover {
    color: var(--lpcd-text);
    background: var(--lpcd-bg);
}

.lpcd-tab.active {
    color: var(--lpcd-primary);
    border-bottom-color: var(--lpcd-primary);
}

.lpcd-inspector-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
}

.lpcd-inspector-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--lpcd-text-secondary);
}

/* ── Inspector Sections ── */
.lpcd-inspector-section {
    border-bottom: 1px solid var(--lpcd-border);
}

.lpcd-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--lpcd-text);
}

.lpcd-section-header:hover {
    background: var(--lpcd-bg);
}

.lpcd-section-body {
    padding: 0 16px 16px;
}

/* ── Form Fields ── */
.lpcd-field {
    margin-bottom: 12px;
}

.lpcd-field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--lpcd-text-secondary);
    margin-bottom: 4px;
}

.lpcd-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--lpcd-border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    background: var(--lpcd-card-bg);
    color: var(--lpcd-text);
}

.lpcd-input:focus {
    border-color: var(--lpcd-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.lpcd-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--lpcd-border);
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.lpcd-textarea:focus {
    border-color: var(--lpcd-primary);
}

.lpcd-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--lpcd-border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: var(--lpcd-card-bg);
    color: var(--lpcd-text);
    cursor: pointer;
    box-sizing: border-box;
}

.lpcd-range {
    width: 100%;
    accent-color: var(--lpcd-primary);
}

.lpcd-color-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpcd-color-field input[type="color"] {
    width: 32px;
    height: 32px;
    border: 2px solid var(--lpcd-border);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: none;
    -webkit-appearance: none;
}

.lpcd-color-field input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.lpcd-color-field input[type="color"]::-webkit-color-swatch {
    border-radius: 50%;
    border: none;
}

.lpcd-color-text {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--lpcd-border);
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    width: 0;
}

/* ── Toggle Switch ── */
.lpcd-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.lpcd-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lpcd-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: 0.2s;
}

.lpcd-toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.lpcd-toggle input:checked+.lpcd-toggle-slider {
    background: linear-gradient(135deg, #330066, #5170ff);
}

.lpcd-toggle input:checked+.lpcd-toggle-slider::before {
    transform: translateX(18px);
}

/* ── Login Form Block Preview ── */
.lpcd-block-loginform {
    transition: all 0.2s ease;
}

.lpcd-form-label {
    pointer-events: none;
}

.lpcd-block-loginform input:read-only {
    pointer-events: none;
}

/* ── Logo Placeholder ── */
.lpcd-logo-placeholder {
    border: 2px dashed var(--lpcd-border);
}

/* Animated gradient preview */
@keyframes lpcd-gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ── Advanced Text Editor Panel ── */
.lpcd-advanced-editor {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    background: var(--lpcd-surface);
    border-left: 1px solid var(--lpcd-border);
    overflow-y: auto;
    padding: 20px 16px;
    box-sizing: border-box;
}

.lpcd-advanced-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.lpcd-advanced-header .dashicons {
    color: #7c3aed;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.lpcd-advanced-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--lpcd-text);
}

/* Warning banner across the top of editor */
.lpcd-advanced-warning-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    border-bottom: 1px solid #f59e0b;
    color: #92400e;
    font-size: 13px;
    line-height: 1.4;
}

.lpcd-advanced-warning-banner .dashicons {
    color: #d97706;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.lpcd-advanced-warning-banner strong {
    color: #78350f;
}

/* In-panel notice box */
.lpcd-advanced-notice {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fef9ee;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.lpcd-advanced-notice .dashicons {
    color: #f59e0b;
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.lpcd-advanced-notice p {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: #78350f;
}

.lpcd-advanced-notice strong {
    color: #92400e;
}

/* Advanced Canvas — Live Template Preview */
.lpcd-advanced-canvas {
    border-radius: var(--lpcd-radius);
    transition: max-width 0.3s ease;
}

.lpcd-advanced-yeti-wrap {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    pointer-events: none;
}

.lpcd-yeti-svg-preview {
    width: 100%;
    height: 100%;
}

.lpcd-advanced-form-preview {
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.lpcd-advanced-form-preview input[type="text"],
.lpcd-advanced-form-preview input[type="password"] {
    display: block;
}

.lpcd-advanced-form-preview input[type="text"]:focus,
.lpcd-advanced-form-preview input[type="password"]:focus {
    outline: none;
}


.lpcd-advanced-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--lpcd-border);
}

.lpcd-advanced-section:last-child {
    border-bottom: none;
}

.lpcd-advanced-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #7c3aed;
    margin: 0 0 12px;
}

.lpcd-advanced-field {
    margin-bottom: 12px;
}

.lpcd-advanced-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--lpcd-text);
    margin-bottom: 4px;
}

.lpcd-advanced-field input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--lpcd-border);
    border-radius: 6px;
    background: #fff;
    color: var(--lpcd-text);
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.lpcd-advanced-field input[type="text"]:focus {
    border-color: #7c3aed;
    outline: none;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
}

.lpcd-advanced-toggle {
    margin-bottom: 8px;
}

.lpcd-advanced-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;

/* Pro Overlay in Editor */
.lpcd-pro-sidebar-overlay {
    position: absolute;
    top: 56px; /* Below toolbar */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lpcd-pro-overlay-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 300px;
    border: 1px solid #e2e8f0;
}

.lpcd-pro-overlay-content .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #7c3aed;
    margin-bottom: 15px;
}

.lpcd-pro-overlay-content h4 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #0f172a;
}

.lpcd-pro-overlay-content p {
    margin: 0 0 20px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}
    color: var(--lpcd-text);
    cursor: pointer;
}

.lpcd-advanced-toggle input[type="checkbox"] {
    accent-color: #7c3aed;
    width: 16px;
    height: 16px;
}

.lpcd-advanced-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--lpcd-text-muted);
}

.lpcd-advanced-empty .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

/* ==========================================================================
   Custom Design Sidebar Footer & Modal
   ========================================================================== */

.lpcd-sidebar-footer {
    grid-column: 1 / -1;
    padding-top: 10px;
}

.lpcd-custom-design-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(51, 0, 102, 0.3);
    transition: all 0.2s ease;
}

.lpcd-custom-design-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(51, 0, 102, 0.4);
    background: linear-gradient(135deg, #220044, #3d5ce6);
}

.lpcd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.lpcd-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: lpcdModalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lpcdModalFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lpcd-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--lpcd-text-500);
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lpcd-modal-close:hover {
    background: var(--lpcd-border-light);
    color: var(--lpcd-text);
}

.lpcd-modal-content {
    padding: 40px 32px;
    text-align: center;
}

.lpcd-custom-design-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 16px rgba(255, 107, 107, 0.25);
}

.lpcd-custom-design-icon .dashicons {
    color: #fff;
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.lpcd-custom-design-modal h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--lpcd-text);
    margin: 0 0 12px;
}

.lpcd-custom-design-modal p {
    font-size: 15px;
    color: var(--lpcd-text-600);
    line-height: 1.6;
    margin: 0 0 32px;
}

.lpcd-custom-design-modal p strong {
    color: var(--lpcd-primary);
    background: var(--lpcd-primary-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.lpcd-modal-actions {
    display: flex;
    justify-content: center;
}

.lpcd-modal-actions .lpcd-btn-large {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: 8px;
    width: 100%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    text-align: center;
}