/* ================================================================
   Law Firm Listings — Public CSS  v5.0  Premium
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ── CSS variables ───────────────────────────────────────────── */
.lfl-listings-wrap,
.lfl-submit-wrap,
.lfl-search-widget,
.lfl-single-wrap {
    --lfl-primary:       #1a4fa0;
    --lfl-primary-dark:  #133a7a;
    --lfl-primary-light: #e8f0fb;
    --lfl-gold:          #c9a227;
    --lfl-green:         #16a34a;
    --lfl-gray-50:  #f9fafb;
    --lfl-gray-100: #f3f4f6;
    --lfl-gray-200: #e5e7eb;
    --lfl-gray-300: #d1d5db;
    --lfl-gray-400: #9ca3af;
    --lfl-gray-500: #6b7280;
    --lfl-gray-700: #374151;
    --lfl-gray-900: #111827;
    --lfl-radius-sm: 8px;
    --lfl-radius:    12px;
    --lfl-radius-lg: 16px;
    --lfl-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --lfl-shadow:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --lfl-shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    --lfl-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-family: var(--lfl-font);
    color: #1a1f2e;
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   DIRECTORY — Wrapper & Heading
   ================================================================ */
.lfl-listings-wrap {
    /* Sensible fallback layout — overridden by the dynamic <style> block
       injected by listings-grid.php with values from Settings > Spacing. */
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

.lfl-directory-heading {
    font-size: 30px;
    font-weight: 800;
    color: #1a1f2e;
    margin: 0 0 28px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}
@media (max-width: 600px) { .lfl-directory-heading { font-size: 22px; margin-bottom: 20px; } }

/* ================================================================
   FILTER BAR
   ================================================================ */
.lfl-filter-bar {
    margin-bottom: 0;  /* summary bar sits directly below, manages its own spacing */
}
.lfl-filter-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: stretch;
    background: #fff;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius-lg);
    padding: 12px 14px;
    box-shadow: var(--lfl-shadow-sm);
    transition: box-shadow 0.2s;
}
.lfl-filter-form:focus-within {
    box-shadow: 0 0 0 3px rgba(26,79,160,0.08), var(--lfl-shadow-sm);
    border-color: rgba(26,79,160,0.3);
}
.lfl-search-input,
.lfl-select-filter {
    padding: 0 14px;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius-sm);
    font-size: 14px;
    background: var(--lfl-gray-50);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
    color: #1a1f2e;
    height: 42px;
    line-height: 42px;
}
.lfl-search-input { flex: 2; min-width: 160px; }
.lfl-select-filter { flex: 1; min-width: 130px; cursor: pointer; appearance: auto; }
.lfl-search-input:focus,
.lfl-select-filter:focus {
    border-color: var(--lfl-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,79,160,0.1);
}
.lfl-search-input::placeholder { color: var(--lfl-gray-400); }

.lfl-filter-btn {
    padding: 0 22px;
    background: var(--lfl-primary);
    color: #fff;
    border: none;
    border-radius: var(--lfl-radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    height: 42px;
    transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.1px;
}
.lfl-filter-btn:hover  {
    background: var(--lfl-primary-dark);
    box-shadow: 0 4px 12px rgba(26,79,160,0.3);
}
.lfl-filter-btn:active { transform: scale(0.97); }

/* Filter clear link (inside form, next to button) */
.lfl-filter-clear {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: var(--lfl-gray-400);
    text-decoration: none;
    padding: 0 4px;
    white-space: nowrap;
    align-self: center;
    transition: color 0.15s;
}
.lfl-filter-clear:hover { color: var(--lfl-gray-700); }

/* ── Active filter summary bar ───────────────────────────────── */
.lfl-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 28px;
    padding: 11px 18px;
    background: var(--lfl-primary-light);
    border-radius: var(--lfl-radius-sm);
    border-left: 3px solid var(--lfl-primary);
    animation: lfl-fade-in 0.25s ease;
    flex-wrap: wrap;
}
.lfl-filter-summary-text {
    font-size: 14px;
    color: #1a1f2e;
    line-height: 1.4;
}
.lfl-filter-summary-text strong {
    color: var(--lfl-primary);
    font-weight: 700;
}
.lfl-filter-summary-count {
    color: var(--lfl-gray-500);
    font-weight: 400;
    font-size: 13px;
}
.lfl-filter-summary-clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--lfl-primary);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1.5px solid rgba(26,79,160,0.25);
    background: #fff;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}
.lfl-filter-summary-clear:hover {
    background: var(--lfl-primary);
    border-color: var(--lfl-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,79,160,0.25);
}
.lfl-filter-summary-clear svg {
    transition: transform 0.15s;
}
.lfl-filter-summary-clear:hover svg { transform: rotate(90deg); }

/* Keep old tag classes hidden */
.lfl-active-filter-tag { display: none; }
.lfl-results-count { display: none; }

@media (max-width: 640px) {
    .lfl-filter-form { flex-direction: column; gap: 8px; }
    .lfl-search-input, .lfl-select-filter { width: 100%; flex: none; }
    .lfl-filter-btn { width: 100%; }
    .lfl-filter-summary { margin-bottom: 20px; }
}

/* Gap between filter/summary bar and the listings grid */
.lfl-listings-grid,
.lfl-no-results {
    margin-top: 28px;
}
/* When summary bar is present it provides its own bottom margin,
   so the grid doesn't need extra top margin */
.lfl-filter-summary + * { margin-top: 0; }

/* ================================================================
   CARD GRID — Entry animations
   ================================================================ */
.lfl-listings-grid {
    display: grid;
    gap: 24px;
}

/* Staggered entrance animation */
@keyframes lfl-card-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.lfl-card {
    animation: lfl-card-in 0.35s ease both;
}
.lfl-card:nth-child(1)  { animation-delay: 0.03s; }
.lfl-card:nth-child(2)  { animation-delay: 0.07s; }
.lfl-card:nth-child(3)  { animation-delay: 0.11s; }
.lfl-card:nth-child(4)  { animation-delay: 0.15s; }
.lfl-card:nth-child(5)  { animation-delay: 0.18s; }
.lfl-card:nth-child(6)  { animation-delay: 0.21s; }
.lfl-card:nth-child(7)  { animation-delay: 0.24s; }
.lfl-card:nth-child(8)  { animation-delay: 0.26s; }
.lfl-card:nth-child(n+9){ animation-delay: 0.28s; }

/* ── Card base ───────────────────────────────────────────────── */
.lfl-card {
    background: #fff;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    transition: box-shadow 0.25s cubic-bezier(0.4,0,0.2,1),
                transform   0.25s cubic-bezier(0.4,0,0.2,1),
                border-color 0.2s;
    will-change: transform;
}
.lfl-card:hover {
    box-shadow: var(--lfl-shadow-lg);
    transform: translateY(-4px);
    border-color: var(--lfl-gray-300);
}
.lfl-tier-premium  { border-top: 3px solid var(--lfl-gold); }
.lfl-tier-essential{ border-top: 3px solid var(--lfl-primary); }
.lfl-tier-standard { border-top: 3px solid #e2e8f0; }
.lfl-card-featured { box-shadow: 0 4px 24px rgba(26,79,160,0.13); }

/* Rank number */
.lfl-card-rank-inline {
    font-size: 13px;
    font-weight: 800;
    color: var(--lfl-gray-300);
    margin-right: 4px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Top-rated banner */
.lfl-top-rated-banner {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 10px 20px 6px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 100% !important;
}
.lfl-top-rated-banner::before,
.lfl-top-rated-banner::after { display: none !important; }
.lfl-top-rated-banner > span {
    background: transparent !important;
    color: #1a1f2e !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Tier badge chip */
.lfl-card-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    z-index: 2;
}
.lfl-badge-premium  { background: #fef4d4; color: #7c5a00; }
.lfl-badge-essential{ background: var(--lfl-primary-light); color: var(--lfl-primary); }

/* ── Card body ───────────────────────────────────────────────── */
.lfl-card-body {
    padding: 20px 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

/* Logo + name row */
.lfl-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.lfl-card-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid var(--lfl-gray-200);
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
    padding: 4px;
    transition: border-color 0.2s;
}
.lfl-card:hover .lfl-card-logo { border-color: var(--lfl-gray-300); }
.lfl-card-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}
.lfl-logo-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, var(--lfl-primary) 0%, #2d6fd4 100%);
}

.lfl-card-title-wrap { flex: 1; min-width: 0; }
.lfl-card-title {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px;
}
.lfl-card-title a {
    color: #1a1f2e;
    text-decoration: none;
    transition: color 0.15s;
}
.lfl-card-title a:hover { color: var(--lfl-primary); }

.lfl-card-location {
    margin: 0;
    font-size: 12px;
    color: var(--lfl-gray-500);
    display: flex;
    align-items: center;
    gap: 3px;
}
.lfl-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px; height: 15px;
    background: var(--lfl-green);
    color: #fff;
    border-radius: 50%;
    font-size: 8px;
    font-weight: 800;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Divider */
.lfl-card-divider {
    height: 1px;
    background: var(--lfl-gray-100);
    margin: 0 -22px;
}

/* Practice area pills */
.lfl-card-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.lfl-term-pill {
    background: var(--lfl-primary-light);
    color: var(--lfl-primary);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.lfl-term-pill:hover { background: var(--lfl-primary); color: #fff; }
.lfl-term-more { background: var(--lfl-gray-100); color: var(--lfl-gray-500); }

/* Meta grid */
.lfl-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}
.lfl-meta-item {
    font-size: 12px;
    color: var(--lfl-gray-500);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}
a.lfl-meta-item:hover { color: var(--lfl-primary); }
.lfl-meta-icon { flex-shrink: 0; opacity: 0.65; }
a.lfl-meta-item:hover .lfl-meta-icon { opacity: 1; }

/* ── Card footer ─────────────────────────────────────────────── */
.lfl-card-footer {
    padding: 12px 22px 16px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--lfl-gray-100);
}
.lfl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: var(--lfl-radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.18s, color 0.18s, border-color 0.18s,
                transform 0.1s, box-shadow 0.18s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: 0.1px;
}
.lfl-btn:active { transform: scale(0.97); }
.lfl-btn-primary {
    background: var(--lfl-primary);
    color: #fff !important;
    flex: 1;
}
.lfl-btn-primary:hover {
    background: var(--lfl-primary-dark);
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(26,79,160,0.25);
}
.lfl-btn-secondary {
    background: #fff;
    color: #374151 !important;
    border-color: var(--lfl-gray-200);
    flex: 1;
}
.lfl-btn-secondary:hover {
    background: var(--lfl-gray-50);
    border-color: var(--lfl-gray-300);
    color: #1a1f2e !important;
}

/* ── No results ──────────────────────────────────────────────── */
.lfl-no-results {
    padding: 72px 24px;
    text-align: center;
    color: var(--lfl-gray-400);
    background: var(--lfl-gray-50);
    border: 1.5px dashed var(--lfl-gray-200);
    border-radius: var(--lfl-radius-lg);
    animation: lfl-fade-in 0.3s ease;
}
.lfl-no-results p { font-size: 15px; margin: 0 0 12px; }

/* ── Shared animations ───────────────────────────────────────── */
@keyframes lfl-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lfl-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .lfl-card-meta { grid-template-columns: 1fr; }
    .lfl-card-badge { position: static; display: inline-block; margin-bottom: 8px; }

    /* Logo stacks above name+address — column layout */
    .lfl-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .lfl-card-logo {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
    }
    /* Title wrap takes full width */
    .lfl-card-title-wrap {
        width: 100%;
        min-width: 0;
    }
    /* Address: allow wrapping, pin icon to first line */
    .lfl-card-location {
        white-space: normal;
        align-items: flex-start;
        line-height: 1.45;
        gap: 4px;
    }
    .lfl-card-location svg {
        margin-top: 2px;
        flex-shrink: 0;
    }
    /* Meta items: stack single-column, allow wrapping */
    .lfl-meta-item {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    /* Divider: reset hardcoded -22px bleed so it matches the dynamic card padding */
    .lfl-card-divider {
        margin-left: 0;
        margin-right: 0;
    }
}

/* ================================================================
   SUBMISSION FORM
   ================================================================ */
.lfl-submit-wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: var(--lfl-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

/* ── Form intro ─────────────────────────────────────────────── */
.lfl-form-intro {
    text-align: center;
    margin-bottom: 40px;
}
.lfl-form-intro h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: #1a1f2e;
    letter-spacing: -0.4px;
}
.lfl-form-intro p {
    color: #6b7280;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* ── Step indicator ─────────────────────────────────────────── */
.lfl-steps {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 8px;
}
.lfl-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.lfl-step-num {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}
.lfl-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    transition: color 0.3s;
    white-space: nowrap;
}
.lfl-step.active .lfl-step-num {
    border-color: var(--lfl-primary, #1a4fa0);
    background:   var(--lfl-primary, #1a4fa0);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(26,79,160,0.14);
}
.lfl-step.active .lfl-step-label { color: #1a1f2e; }
.lfl-step.done .lfl-step-num {
    border-color: #16a34a;
    background:   #16a34a;
    color: #fff;
}
.lfl-step.done .lfl-step-label { color: #374151; }
.lfl-step-line {
    flex: 1; height: 2px;
    background: #e5e7eb;
    margin: 0 10px;
    transition: background 0.4s;
    border-radius: 2px;
}
.lfl-step-line.done { background: #16a34a; }
@media (max-width: 480px) {
    .lfl-step-label { display: none; }
    .lfl-step-line  { margin: 0 6px; }
}

/* ── Step panels ────────────────────────────────────────────── */
.lfl-step-panel          { display: none; }
.lfl-step-panel.active   { display: block; animation: lfl-slide-up 0.3s ease; }

/* ── Form sections ──────────────────────────────────────────── */
.lfl-form-section {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 28px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}
.lfl-form-section:focus-within { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.lfl-form-section:last-of-type { margin-bottom: 0; }
.lfl-form-section-title {
    margin: 0 0 22px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1f2e;
    padding-bottom: 14px;
    border-bottom: 1.5px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Form grid & fields ─────────────────────────────────────── */
.lfl-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 560px) { .lfl-form-grid { grid-template-columns: 1fr; } }
.lfl-field-full { grid-column: 1 / -1; }

.lfl-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lfl-form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}
.lfl-form-field input,
.lfl-form-field textarea,
.lfl-form-field select {
    padding: 10px 13px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    width: 100%;
    background: #f9fafb;
    color: #1a1f2e;
    line-height: 1.5;
    -webkit-appearance: none;
    box-sizing: border-box;
}
.lfl-form-field input::placeholder,
.lfl-form-field textarea::placeholder { color: #9ca3af; }
.lfl-form-field input:focus,
.lfl-form-field textarea:focus,
.lfl-form-field select:focus {
    border-color: var(--lfl-primary, #1a4fa0);
    box-shadow: 0 0 0 3px rgba(26,79,160,0.09);
    background: #fff;
}
.lfl-form-field input.is-invalid { border-color: #e53e3e; box-shadow: 0 0 0 3px rgba(229,62,62,0.09); }
.lfl-form-field textarea { resize: vertical; min-height: 100px; }
.lfl-field-hint { font-size: 11px; color: #9ca3af; margin: 0; line-height: 1.4; }

/* ── Logo upload ────────────────────────────────────────────── */
.lfl-logo-drop-zone {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 2px dashed #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.lfl-logo-drop-zone:hover,
.lfl-logo-drop-zone.dragover {
    border-color: var(--lfl-primary, #1a4fa0);
    background: #e8f0fb;
}
.lfl-logo-drop-icon {
    width: 52px; height: 52px;
    border-radius: 10px;
    background: #e8f0fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}
.lfl-logo-drop-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.lfl-logo-drop-text  { flex: 1; }
.lfl-logo-drop-title { font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 2px; }
.lfl-logo-drop-sub   { font-size: 11px; color: #9ca3af; margin: 0; }

/* ── Category / practice area chips ────────────────────────── */
.lfl-practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.lfl-practice-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    user-select: none;
    position: relative;
}
/* Hide the native checkbox — .lfl-chip-check is the visual replacement */
.lfl-practice-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.lfl-practice-chip:hover {
    border-color: var(--lfl-primary, #1a4fa0);
    background: #e8f0fb;
    color: var(--lfl-primary, #1a4fa0);
}
.lfl-practice-chip.selected {
    border-color: var(--lfl-primary, #1a4fa0);
    background: #e8f0fb;
    color: var(--lfl-primary, #1a4fa0);
    font-weight: 600;
}
.lfl-chip-check {
    width: 16px; height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.15s;
    background: #fff;
    color: transparent;
}
.lfl-practice-chip.selected .lfl-chip-check {
    background: var(--lfl-primary, #1a4fa0);
    border-color: var(--lfl-primary, #1a4fa0);
    color: #fff;
}

/* ── Tier grid ──────────────────────────────────────────────── */
.lfl-tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.lfl-tier-card {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px 20px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Hide the radio input visually */
.lfl-tier-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.lfl-tier-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}
.lfl-tier-card.selected {
    border-color: var(--lfl-primary, #1a4fa0);
    box-shadow: 0 0 0 3px rgba(26,79,160,0.12);
}
.lfl-tier-badge-wrap {
    position: absolute;
    top: 12px;
    right: 12px;
}
.lfl-tier-popular {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lfl-tier-free-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lfl-tier-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1f2e;
    margin-top: 4px;
}
.lfl-tier-card-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--lfl-primary, #1a4fa0);
    line-height: 1;
}
.lfl-tier-card-price span {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
}
.lfl-tier-card-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}
.lfl-tier-features {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lfl-tier-features li {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}
.lfl-tier-features li::before {
    content: "✓";
    color: #16a34a;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Form footer (navigation buttons row) ───────────────────── */
.lfl-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    gap: 12px;
    flex-wrap: wrap;
}
.lfl-form-note {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    flex: 1;
}

/* ── Buttons ────────────────────────────────────────────────── */
.lfl-submit-btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: 1.5px solid transparent;
    transition: all 0.18s;
    letter-spacing: 0.1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.lfl-submit-btn-next {
    background: var(--lfl-primary, #1a4fa0);
    color: #fff;
    border-color: var(--lfl-primary, #1a4fa0);
    box-shadow: 0 2px 8px rgba(26,79,160,0.2);
}
.lfl-submit-btn-next:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 14px rgba(26,79,160,0.3);
    transform: translateY(-1px);
}
.lfl-submit-btn-next:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.lfl-submit-btn-back {
    background: #fff;
    color: #374151;
    border-color: #e5e7eb;
}
.lfl-submit-btn-back:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* ── Form error messages ────────────────────────────────────── */
.lfl-form-error {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
    animation: lfl-fade-in 0.2s ease;
}
.lfl-payment-cancelled {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    color: #92400e;
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.required { color: #e53e3e; }

/* ── Processing step ────────────────────────────────────────── */
.lfl-processing-panel {
    text-align: center;
    padding: 60px 20px;
}
.lfl-processing-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--lfl-primary, #1a4fa0);
    border-radius: 50%;
    animation: lfl-spin 0.75s linear infinite;
    margin: 0 auto 20px;
}
@keyframes lfl-spin { to { transform: rotate(360deg); } }
.lfl-processing-panel h3 { font-size: 18px; color: #1a1f2e; margin: 0 0 8px; }
.lfl-processing-panel p  { font-size: 14px; color: #6b7280; margin: 0; }

/* ── Thank-you / success screen ─────────────────────────────── */
.lfl-thankyou {
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    animation: lfl-fade-in 0.4s ease;
}
.lfl-thankyou.paid { border-color: #bbf7d0; background: #f0fdf4; }
.lfl-thankyou-icon {
    width: 64px;
    height: 64px;
    background: #1a4fa0;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    flex-shrink: 0;
}
.lfl-thankyou.paid .lfl-thankyou-icon { background: #16a34a; }
.lfl-thankyou h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1a1f2e;
    margin: 0 0 10px;
}
.lfl-thankyou-sub {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0 0 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.lfl-thankyou-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    background: #f9fafb;
    border: 1.5px solid #f3f4f6;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.lfl-thankyou-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.lfl-thankyou-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a4fa0;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    flex-shrink: 0;
}
.lfl-thankyou-step p {
    margin: 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}
.lfl-thankyou-step p strong {
    display: block;
    font-weight: 600;
    color: #1a1f2e;
    margin-bottom: 2px;
}
.lfl-thankyou-cta {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: #1a4fa0;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: filter 0.18s, transform 0.15s;
}
.lfl-thankyou-cta:hover { filter: brightness(0.9); transform: translateY(-1px); }

/* ================================================================
   SEARCH WIDGET
   ================================================================ */
.lfl-search-widget {
    padding: 0;
}
.lfl-search-widget-form {
    display: flex;
    gap: 0;
    align-items: stretch;
    background: #fff;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius-lg);
    padding: 10px 10px 10px 10px;
    box-shadow: var(--lfl-shadow-sm);
    flex-wrap: wrap;
    gap: 8px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.lfl-search-widget-form:focus-within {
    box-shadow: 0 0 0 3px rgba(26,79,160,0.08), var(--lfl-shadow-sm);
    border-color: rgba(26,79,160,0.25);
}
.lfl-sw-input-wrap {
    flex: 2;
    min-width: 180px;
    position: relative;
    display: flex;
    align-items: center;
}
.lfl-sw-icon {
    position: absolute;
    left: 12px;
    color: var(--lfl-gray-400);
    flex-shrink: 0;
    pointer-events: none;
}
.lfl-sw-text {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: #1a1f2e;
    background: var(--lfl-gray-50);
    outline: none;
    height: 42px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lfl-sw-text:focus {
    border-color: var(--lfl-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,79,160,0.09);
}
.lfl-sw-select {
    flex: 1;
    min-width: 120px;
    padding: 0 12px;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: #1a1f2e;
    background: var(--lfl-gray-50);
    outline: none;
    height: 42px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.lfl-sw-select:focus { border-color: var(--lfl-primary); background: #fff; }
.lfl-sw-btn {
    padding: 0 22px;
    background: var(--lfl-primary);
    color: #fff;
    border: none;
    border-radius: var(--lfl-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    height: 42px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.18s, box-shadow 0.18s, transform 0.1s;
    letter-spacing: 0.1px;
}
.lfl-sw-btn:hover {
    background: var(--lfl-primary-dark);
    box-shadow: 0 3px 10px rgba(26,79,160,0.25);
}
.lfl-sw-btn:active { transform: scale(0.97); }
@media (max-width: 600px) {
    .lfl-search-widget-form { flex-direction: column; }
    .lfl-sw-input-wrap, .lfl-sw-select, .lfl-sw-btn { width: 100%; flex: none; }
    .lfl-sw-btn { height: 44px; }
}

/* OSM autocomplete dropdown */
.lfl-osm-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius);
    box-shadow: var(--lfl-shadow-lg);
    list-style: none;
    margin: 0;
    padding: 4px;
    z-index: 9999;
    max-height: 260px;
    overflow-y: auto;
    animation: lfl-fade-in 0.15s ease;
}
.lfl-osm-item {
    padding: 9px 12px;
    border-radius: var(--lfl-radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.1s;
}
.lfl-osm-item:hover, .lfl-osm-item.active { background: var(--lfl-primary-light); }
.lfl-osm-main { font-size: 13px; font-weight: 600; color: #1a1f2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfl-osm-sub  { font-size: 11px; color: var(--lfl-gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================
   SINGLE LISTING — Breadcrumbs & back button
   ================================================================ */
.lfl-single-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    animation: lfl-fade-in 0.25s ease;
}
.lfl-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--lfl-gray-500);
    flex-wrap: wrap;
}
.lfl-breadcrumbs a {
    color: var(--lfl-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.lfl-breadcrumbs a:hover { text-decoration: underline; }
.lfl-breadcrumb-sep { color: var(--lfl-gray-300); font-size: 12px; }
.lfl-breadcrumb-current {
    color: #374151;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.lfl-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1.5px solid var(--lfl-gray-200);
    border-radius: var(--lfl-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: all 0.18s;
    white-space: nowrap;
    box-shadow: var(--lfl-shadow-sm);
}
.lfl-back-btn:hover {
    background: var(--lfl-primary-light);
    border-color: var(--lfl-primary);
    color: var(--lfl-primary);
    box-shadow: none;
}
.lfl-back-btn svg { flex-shrink: 0; transition: transform 0.18s; }
.lfl-back-btn:hover svg { transform: translateX(-2px); }

/* Related card hover classes */
.lfl-rel-card-lift { transition: box-shadow 0.22s, transform 0.22s; }
.lfl-rel-card-lift:hover { transform: translateY(-4px) !important; box-shadow: 0 12px 32px rgba(0,0,0,0.13) !important; }
.lfl-rel-card-glow { transition: box-shadow 0.22s; }

/* ================================================================
   COPIED feedback for shortcode reference
   ================================================================ */
.lfl-copied {
    background: #dcfce7 !important;
    transition: background 0.2s;
}

/* ================================================================
   CATEGORY PAGES — Hero & page wrapper
   ================================================================ */

/* Category page scope — pure transparent passthrough.
   lfl-listings-wrap handles its own width from Settings → Spacing. */
.lfl-cat-page-scope {
    background: transparent;
    box-sizing: border-box;
    width: 100%;
}

/* Hero typography and animation only.
   Colours/padding come from inline styles set by the PHP renderer. */
.lfl-cat-hero {
    box-sizing: border-box;
    animation: lfl-fade-in 0.35s ease;
    width: 100%;
}
/* Full-bleed when the hero has a background colour */
.lfl-cat-hero[style*="background:"] {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.lfl-cat-hero-inner {
    box-sizing: border-box;
}
.lfl-cat-hero-title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin: 0 0 16px;
}
.lfl-cat-hero-desc {
    font-size: 17px;
    line-height: 1.7;
    opacity: 0.88;
    margin: 0;
}

/* Listing grid on a category page inherits all rules from the shortcode's
   dynamic <style> block (listings-grid.php) — no overrides needed here. */
.lfl-cat-page-scope .lfl-listings-wrap {
    /* On category pages the outer scope wrapper handles vertical space.
       Strip the shortcode's section_padding_y from top/bottom. */
    padding-top:    0 !important;
    padding-bottom: 0 !important;
}

/* Category index page wrapper — width set via inline style from PHP */
.lfl-idx-wrap {
    box-sizing: border-box;
}

/* Category index grid — columns/gap injected via wp_head per page */
.lfl-idx-grid {
    width: 100%;
    box-sizing: border-box;
}
.lfl-idx-card {
    box-sizing: border-box;
    transition: box-shadow 0.22s, transform 0.22s;
}
.lfl-idx-card:hover { transform: translateY(-3px); }

@media (max-width: 600px) {
    .lfl-cat-hero-title { font-size: 26px; }
    .lfl-cat-hero-desc  { font-size: 15px; }
    /* Disable full-bleed on mobile — avoids horizontal scroll */
    .lfl-cat-hero[style*="background:"] {
        width: 100%;
        position: static;
        left: auto;
        margin-left: 0;
        margin-right: 0;
    }
}

/* ================================================================
   PAGINATION
   ================================================================ */
.lfl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--lfl-gray-100, #f3f4f6);
    flex-wrap: wrap;
    font-family: var(--lfl-font, inherit);
}
/* The page-numbers wrapper must be a flex row that aligns with prev/next */
.lfl-page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
/* Every interactive element in the pagination row shares the same 36px height */
.lfl-page-num,
.lfl-page-btn,
.lfl-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    box-sizing: border-box;
    line-height: 1;
}
.lfl-page-num {
    min-width: 36px;
    padding: 0 6px;
    border-radius: var(--lfl-radius-sm, 8px);
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    background: #fff;
    border: 1.5px solid var(--lfl-gray-200, #e5e7eb);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lfl-page-num:hover {
    border-color: var(--lfl-primary, #1a4fa0);
    color: var(--lfl-primary, #1a4fa0);
    background: var(--lfl-primary-light, #e8f0fb);
}
.lfl-page-num.lfl-page-current {
    background: var(--lfl-primary, #1a4fa0);
    border-color: var(--lfl-primary, #1a4fa0);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,79,160,0.22);
    pointer-events: none;
}
.lfl-page-ellipsis {
    min-width: 28px;
    font-size: 14px;
    color: var(--lfl-gray-400, #9ca3af);
    user-select: none;
    border: none;
    background: transparent;
}
.lfl-page-btn {
    gap: 5px;
    padding: 0 14px;
    border-radius: var(--lfl-radius-sm, 8px);
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    border: 1.5px solid var(--lfl-gray-200, #e5e7eb);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}
.lfl-page-btn:hover {
    border-color: var(--lfl-primary, #1a4fa0);
    color: var(--lfl-primary, #1a4fa0);
    background: var(--lfl-primary-light, #e8f0fb);
}
.lfl-page-info {
    font-size: 12px;
    color: var(--lfl-gray-400, #9ca3af);
    white-space: nowrap;
    height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
}
@media (max-width: 500px) {
    .lfl-page-info { display: none; }
    .lfl-page-btn  { padding: 0 10px; }
    .lfl-pagination { gap: 4px; }
}
