/* ==========================================================================
   Login Page Customizer and Designer — Settings CSS
   Redesigned to match the polished reference UI.
   ========================================================================== */

:root {
    --lpcd-primary: #330066;
    --lpcd-primary-hover: #220044;
    --lpcd-primary-light: #f3ecf9;
    --lpcd-primary-10: rgba(51, 0, 102, 0.1);
    --lpcd-primary-20: rgba(51, 0, 102, 0.2);
    --lpcd-text: #1e293b;
    --lpcd-text-700: #334155;
    --lpcd-text-600: #475569;
    --lpcd-text-500: #64748b;
    --lpcd-text-400: #94a3b8;
    --lpcd-border: #e2e8f0;
    --lpcd-border-light: #f1f5f9;
    --lpcd-bg: #f8fafc;
    --lpcd-card-bg: #ffffff;
    --lpcd-sidebar-bg: #f8fafc;
    --lpcd-font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

/* ── Pro Badge Pill ── */
.lpcd-pro-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(51, 0, 102, 0.2);
    vertical-align: middle;
}

/* ── App Wrapper ── */
.lpcd-settings-app {
    font-family: var(--lpcd-font);
    color: var(--lpcd-text);
    display: flex;
    min-height: calc(100vh - 32px);
    margin-left: -20px;
    margin-top: -6px;
    background: var(--lpcd-bg);
}

.lpcd-settings-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 40vh;
    gap: 16px;
    width: 100%;
}

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
.lpcd-settings-nav {
    width: 240px;
    min-width: 240px;
    background: var(--lpcd-sidebar-bg);
    border-right: 1px solid var(--lpcd-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.lpcd-settings-nav-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lpcd-settings-nav-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #330066, #5170ff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(51, 0, 102, 0.25);
    flex-shrink: 0;
}

.lpcd-settings-nav-brand-icon .dashicons {
    color: #fff;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.lpcd-settings-nav-brand-text h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--lpcd-text);
    margin: 0;
    line-height: 1.2;
}

.lpcd-settings-nav-brand-text span {
    font-size: 11px;
    color: var(--lpcd-text-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.lpcd-settings-nav-tabs {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lpcd-settings-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--lpcd-text-600);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.lpcd-settings-tab:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--lpcd-text);
}

.lpcd-settings-tab.active {
    background: var(--lpcd-primary-light);
    color: var(--lpcd-text);
    font-weight: 700;
}

.lpcd-settings-tab.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #330066, #5170ff);
    border-radius: 0 4px 4px 0;
}

.lpcd-settings-tab .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--lpcd-text-500);
}

.lpcd-settings-tab.active .dashicons {
    color: var(--lpcd-primary);
}

.lpcd-settings-tab:hover .dashicons {
    color: var(--lpcd-primary);
}

/* ══════════════════════════════════════════════
   MAIN CONTENT AREA
   ══════════════════════════════════════════════ */
.lpcd-settings-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Header Bar */
.lpcd-settings-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--lpcd-card-bg);
    border-bottom: 1px solid var(--lpcd-border);
    flex-shrink: 0;
}

.lpcd-settings-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--lpcd-text-700);
    margin: 0;
}

/* Content Scroll Area */
.lpcd-settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* ── Notice ── */
.lpcd-notice {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: lpcd-fadeIn 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;
}

.lpcd-notice-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

@keyframes lpcd-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* ══════════════════════════════════════════════
   SECTIONS & CARDS
   ══════════════════════════════════════════════ */
.lpcd-section {
    margin-bottom: 32px;
}

.lpcd-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--lpcd-text-700);
    margin: 0 0 12px;
}

.lpcd-card {
    background: var(--lpcd-card-bg);
    border: 1px solid var(--lpcd-border);
    border-radius: 12px;
    overflow: visible;
    padding: 20px 24px;
}

.lpcd-card h3 {
    display: none;
    /* Hidden — section title is outside */
}

/* ── Form Fields (Grid: label left 1/3, input right 2/3) ── */
.lpcd-form-field {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid var(--lpcd-border-light);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.lpcd-form-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.lpcd-form-field>div:first-child>label,
.lpcd-form-field>label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--lpcd-text-700);
    margin: 0;
}

.lpcd-field-desc {
    font-size: 12px;
    color: var(--lpcd-text-500);
    margin: 4px 0 0;
    line-height: 1.5;
}

.lpcd-field-input-wrap {
    min-width: 0;
}

/* ── Inputs ── */
.lpcd-input,
.lpcd-select,
.lpcd-textarea {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--lpcd-font);
    outline: none;
    box-sizing: border-box;
    background: var(--lpcd-card-bg);
    color: var(--lpcd-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lpcd-textarea {
    resize: vertical;
}

/* ── Custom Select Dropdown ── */
.lpcd-custom-select {
    position: relative;
    width: 100%;
}

.lpcd-custom-select-trigger {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--lpcd-font);
    background: var(--lpcd-card-bg);
    color: var(--lpcd-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
}

.lpcd-custom-select-trigger:hover {
    border-color: #94a3b8;
}

.lpcd-custom-select-trigger.open {
    border-color: var(--lpcd-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}

.lpcd-custom-select-chevron {
    color: var(--lpcd-text-500);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.lpcd-custom-select-chevron.open {
    transform: rotate(180deg);
}

.lpcd-custom-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--lpcd-card-bg);
    border: 1px solid var(--lpcd-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    padding: 6px;
    animation: lpcd-fadeIn 0.15s ease-out;
    max-height: 240px;
    overflow-y: auto;
}

.lpcd-custom-select-dropdown.flip-up {
    top: auto;
    bottom: calc(100% + 6px);
}

.lpcd-custom-select-option {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    font-family: var(--lpcd-font);
    color: var(--lpcd-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.1s;
    text-align: left;
}

.lpcd-custom-select-option:hover {
    background: var(--lpcd-bg);
}

.lpcd-custom-select-option.selected {
    background: var(--lpcd-primary-light);
    color: var(--lpcd-primary);
    font-weight: 600;
}

.lpcd-custom-select-option.selected svg {
    color: var(--lpcd-primary);
}

.lpcd-input:focus,
.lpcd-select:focus,
.lpcd-textarea:focus {
    border-color: var(--lpcd-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}

.lpcd-input::placeholder {
    color: var(--lpcd-text-400);
}

.lpcd-input[type="password"] {
    letter-spacing: 2px;
    padding: 12px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    width: 100%;
    background: var(--lpcd-card-bg);
    box-sizing: border-box;
    outline: none;
}

/* ── Toggle Switch (matches reference exactly) ── */
.lpcd-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
}

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

.lpcd-toggle input:focus+.lpcd-toggle-slider {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}

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

.lpcd-toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.lpcd-toggle input:checked+.lpcd-toggle-slider::before {
    transform: translateX(24px);
    border-color: transparent;
}

/* ── Message Fields ── */
.lpcd-message-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lpcd-message-field .lpcd-input {
    flex: 1;
}

.lpcd-btn-reset {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    color: var(--lpcd-text-500);
    border-radius: 6px;
    transition: all 0.15s;
}

.lpcd-btn-reset:hover {
    background: var(--lpcd-bg);
    color: var(--lpcd-primary);
}

/* ── Buttons ── */
.lpcd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--lpcd-font);
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.01em;
}

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

.lpcd-btn-primary {
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(51, 0, 102, 0.25);
}

.lpcd-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #220044, #3d5ce6);
    box-shadow: 0 4px 16px rgba(51, 0, 102, 0.35);
}

.lpcd-btn-secondary {
    background: var(--lpcd-card-bg);
    color: var(--lpcd-text-700);
    border: 1px solid var(--lpcd-border);
}

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

/* ── Loading spinner ── */
.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);
    }
}

/* ── Media Upload Field ── */
.lpcd-media-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lpcd-media-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--lpcd-bg);
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s;
    flex-shrink: 0;
}

.lpcd-media-placeholder:hover {
    border-color: var(--lpcd-primary);
}

.lpcd-media-placeholder .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: var(--lpcd-text-400);
}

.lpcd-media-preview {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--lpcd-border);
    flex-shrink: 0;
}

.lpcd-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lpcd-media-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.lpcd-media-remove .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ── Help Banner ── */
.lpcd-help-banner {
    background: var(--lpcd-primary-10);
    border: 1px solid var(--lpcd-primary-20);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 8px;
}

.lpcd-help-banner .dashicons {
    color: var(--lpcd-primary);
    font-size: 22px;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}

.lpcd-help-banner h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--lpcd-primary);
    margin: 0 0 4px;
}

.lpcd-help-banner p {
    font-size: 13px;
    color: var(--lpcd-text-600);
    margin: 0;
    line-height: 1.6;
}

/* -- Pro Gating UI -- */
.lpcd-pro-notice-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #faf5ff, #f0f0ff);
    border: 1px dashed #c4b5fd;
    border-radius: 8px;
    font-size: 12px;
    color: var(--lpcd-text-600);
}

.lpcd-pro-notice-inline .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--lpcd-primary);
}

.lpcd-pro-notice-inline a {
    color: var(--lpcd-primary);
    font-weight: 700;
    text-decoration: none;
}

.lpcd-pro-notice-inline a:hover {
    text-decoration: underline;
}

.lpcd-pro-locked {
    position: relative;
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.lpcd-custom-select-option.lpcd-pro-locked {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.lpcd-custom-select-option.lpcd-pro-locked:hover {
    background: transparent !important;
}

.lpcd-form-field.lpcd-pro-locked {
    opacity: 0.5;
    pointer-events: none;
}

.lpcd-toggle input:disabled + .lpcd-toggle-slider {
    background: #e2e8f0 !important;
    cursor: not-allowed;
}

.lpcd-toggle input:disabled + .lpcd-toggle-slider::before {
    background: #f1f5f9;
}

.lpcd-textarea:disabled,
.lpcd-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}