@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:wght@700&display=swap');

:root {
    --gold: #d4af77;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
}

.heading-font {
    font-family: 'Playfair Display', serif;
}

.hero-bg {
    background: linear-gradient(92deg, #0f172a 0%, #1e2937 100%);
}

.sticky-cta {
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 119, 0.45); }
    50% { box-shadow: 0 0 0 8px rgba(212, 175, 119, 0); }
}

.form-input {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 119, 0.35);
    border-color: var(--gold);
}

.phone-input {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    animation: pulse-ring 2.5s ease infinite;
}

.phone-input:focus {
    animation: none;
}

.success-message {
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    pointer-events: none;
}

.fallback-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.fallback-panel.is-open {
    max-height: 520px;
    opacity: 1;
}

.exit-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.exit-overlay[hidden] {
    display: none !important;
}

.exit-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.exit-modal {
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.exit-overlay.is-visible .exit-modal {
    transform: scale(1) translateY(0);
}

body.exit-modal-open {
    overflow: hidden;
}

.approval-stamp-inner {
    width: 5.5rem;
    height: 5.5rem;
    border: 3px solid #10b981;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15);
    animation: stampIn 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.approval-stamp-icon {
    font-size: 1.75rem;
    color: #059669;
    line-height: 1;
}

.approval-stamp-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #047857;
    margin-top: 0.15rem;
}

@keyframes stampIn {
    from { transform: scale(0.5) rotate(-12deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.area-chip {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(212, 175, 119, 0.55);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.area-chip:hover {
    background: rgba(212, 175, 119, 0.25);
    border-color: var(--gold);
}

.buyer-engage-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 4.5rem;
    z-index: 90;
    background: linear-gradient(90deg, #0f172a, #1e293b);
    border-top: 2px solid var(--gold);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.35);
    animation: slideUp 0.35s ease forwards;
}

@media (min-width: 1024px) {
    .buyer-engage-bar {
        bottom: 0;
    }
}

.buyer-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    padding: 0 0.75rem 0.75rem;
}

@media (min-width: 1024px) {
    .buyer-sticky-cta {
        display: none !important;
    }
}

#idx-root.idx-pending {
    cursor: pointer;
}

#idx-root.idx-pending:hover {
    border-color: var(--gold);
}

#idx-root.idx-mounted {
    border: none;
    min-height: 520px;
}

#idx-root .idx-iframe,
#idx-root iframe {
    display: block;
    width: 100%;
    min-height: 520px;
    border: 0;
    border-radius: 1rem;
}

/* ——— Listings buyer funnel ——— */
.listings-page {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.search-shell-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(212, 175, 119, 0.25);
    padding: 1.5rem 1.25rem 1.35rem;
}

@media (min-width: 640px) {
    .search-shell-card {
        padding: 1.75rem 2rem 1.5rem;
    }
}

.search-shell-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.search-shell-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b45309;
    margin-bottom: 0.25rem;
}

.search-shell-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

@media (min-width: 640px) {
    .search-shell-title {
        font-size: 1.5rem;
    }
}

.search-shell-hint {
    font-size: 0.8rem;
    color: #64748b;
    max-width: 14rem;
    text-align: right;
}

.search-filter-group {
    margin-bottom: 1rem;
}

.search-filter-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .search-filter-row {
        flex-direction: row;
    }
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.45rem;
}

.filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filter-chip {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 9999px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    transition: all 0.15s ease;
    cursor: pointer;
}

.filter-chip:hover {
    border-color: var(--gold);
    color: #0f172a;
}

.filter-chip.is-active {
    background: linear-gradient(145deg, #f5ecd8 0%, #ebe0c8 100%);
    border-color: var(--gold);
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(212, 175, 119, 0.35);
}

.criteria-preview-wrap {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.1rem;
}

.criteria-preview-wrap .filter-label {
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.criteria-preview {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.4;
}

.search-shell-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.shell-cta-primary {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: none;
    cursor: pointer;
    background: linear-gradient(145deg, #e0c48a 0%, #d4af77 45%, #c49a5c 100%);
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(212, 175, 119, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shell-cta-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(212, 175, 119, 0.5);
}

.shell-cta-main {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.shell-cta-sub {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
}

.shell-cta-secondary {
    width: 100%;
    padding: 0.65rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.shell-cta-secondary:hover {
    color: #0f172a;
}

.listings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .listings-grid {
        grid-template-columns: 1fr 380px;
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .listings-grid {
        grid-template-columns: 1fr 400px;
    }
}

.listings-map-col {
    min-width: 0;
}

.map-section-head {
    margin-bottom: 0.75rem;
}

.idx-map-frame {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    min-height: 420px;
}

@media (min-width: 768px) {
    .idx-map-frame {
        min-height: 560px;
    }
}

@media (min-width: 1024px) {
    .idx-map-frame {
        min-height: 680px;
    }
}

.idx-map-frame.idx-mounted,
#idx-root.idx-mounted {
    min-height: 420px;
}

@media (min-width: 768px) {
    .idx-map-frame.idx-mounted,
    #idx-root.idx-mounted {
        min-height: 560px;
    }
}

@media (min-width: 1024px) {
    .idx-map-frame.idx-mounted,
    #idx-root.idx-mounted {
        min-height: 680px;
    }
}

#idx-root.idx-mounted .idx-iframe,
#idx-root.idx-mounted iframe,
.idx-map-frame iframe {
    min-height: 420px;
    height: 65vh;
    max-height: 720px;
}

@media (min-width: 1024px) {
    #idx-root.idx-mounted iframe,
    .idx-map-frame iframe {
        height: 680px;
        max-height: none;
    }
}

.idx-placeholder-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    color: #64748b;
}

.listings-lead-col {
    min-width: 0;
}

.lead-card-premium {
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.5rem 1.35rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(212, 175, 119, 0.2);
}

.listings-stack .lead-card-premium {
    position: static;
}

.lead-card-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    margin-bottom: 0.65rem;
}

.lead-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.35rem;
    line-height: 1.25;
}

.lead-card-sub {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.lead-trust-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    font-size: 0.8125rem;
    color: #475569;
}

.lead-trust-list li {
    padding: 0.35rem 0 0.35rem 1.35rem;
    position: relative;
}

.lead-trust-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: 700;
}

.buyer-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.06) 30%, rgba(15, 23, 42, 0.12) 100%);
    pointer-events: none;
}

.buyer-sticky-cta[hidden] {
    display: none !important;
}

.buyer-sticky-inner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #0f172a;
    border: 2px solid var(--gold);
    border-radius: 1rem;
    padding: 0.65rem 0.75rem 0.65rem 1rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.buyer-sticky-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold);
}

.buyer-sticky-criteria {
    font-size: 0.75rem;
    color: #cbd5e1;
    line-height: 1.3;
    max-width: 12rem;
}

.buyer-sticky-btn {
    flex-shrink: 0;
    background: var(--gold);
    color: #0f172a;
    font-weight: 800;
    font-size: 0.875rem;
    padding: 0.75rem 1.1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
}

.buyer-sticky-btn:hover {
    background: #e0c48a;
}

@media (min-width: 1024px) {
    .buyer-sticky-cta {
        display: none !important;
    }
}

.buyer-engage-bar {
    bottom: 5.25rem;
}

@media (min-width: 1024px) {
    .buyer-engage-bar {
        bottom: 0;
    }
}

.listings-stack { display: flex; flex-direction: column; gap: 1.5rem; }
.listings-map-section { background: #fff; border-radius: 1.25rem; padding: 1.25rem; box-shadow: 0 8px 30px rgba(15,23,42,.06); }
.idx-map-wrap { position: relative; }
.fab-save-home { position: absolute; bottom: 1rem; right: 1rem; z-index: 20; display: flex; align-items: center; gap: .4rem; padding: .65rem 1rem; border-radius: 9999px; border: none; cursor: pointer; background: linear-gradient(145deg,#e0c48a,#d4af77); color: #0f172a; font-weight: 800; font-size: .8125rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.shortlist-section { background: #fff; border-radius: 1.25rem; padding: 1.5rem 1.25rem; border: 2px solid rgba(212,175,119,.35); box-shadow: 0 12px 40px rgba(15,23,42,.08); }
.shortlist-count-badge { display: inline-flex; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: 9999px; background: #d4af77; color: #0f172a; font-size: .75rem; font-weight: 800; }
.shortlist-add-form { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1rem; margin-bottom: 1rem; }
.shortlist-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.shortlist-field-span2 { grid-column: 1 / -1; }
.shortlist-add-btn { width: 100%; margin-top: .75rem; padding: .85rem; border: none; border-radius: .75rem; background: #0f172a; color: #fff; font-weight: 700; cursor: pointer; }
.shortlist-empty { text-align: center; padding: 2rem 1rem; border: 2px dashed #e2e8f0; border-radius: 1rem; margin-bottom: 1rem; }
.shortlist-empty-icon { font-size: 2rem; color: #d4af77; }
.shortlist-list { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-direction: column; gap: .65rem; }
.shortlist-item { display: flex; gap: .75rem; padding: .85rem 1rem; background: linear-gradient(90deg,#fffbeb,#fff); border: 1px solid rgba(212,175,119,.45); border-radius: .85rem; }
.shortlist-item-body { flex: 1; min-width: 0; }
.shortlist-item-address { font-weight: 700; color: #0f172a; }
.shortlist-item-meta, .shortlist-item-notes { font-size: .8125rem; color: #64748b; margin-top: .15rem; }
.shortlist-remove { flex-shrink: 0; width: 2rem; height: 2rem; border: none; border-radius: 50%; background: #f1f5f9; cursor: pointer; }
.shortlist-cta-block { background: linear-gradient(180deg,#0f172a,#1e293b); border-radius: 1rem; padding: 1.25rem; text-align: center; }
.shortlist-cta-lead { color: #fff; font-weight: 700; font-size: 1.1rem; }
.shortlist-cta-block .text-slate-500 { color: #94a3b8 !important; }
.shortlist-in-form { background: #fffbeb; border: 1px solid rgba(212,175,119,.5); border-radius: .75rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.shortlist-in-form-list { list-style: none; padding: 0; margin: 0; font-size: .8125rem; }
.lead-card-highlight { animation: leadPulse .6s ease 2; box-shadow: 0 0 0 4px rgba(212,175,119,.55); }
@keyframes leadPulse { 50% { box-shadow: 0 0 0 8px rgba(212,175,119,.35); } }
.save-home-sheet { position: fixed; inset: 0; z-index: 210; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .25s; }
.save-home-sheet.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.save-home-sheet-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.save-home-sheet-panel { position: relative; width: 100%; max-width: 28rem; background: #fff; border-radius: 1.25rem 1.25rem 0 0; padding: 1.5rem 1.25rem 2rem; transform: translateY(100%); transition: transform .35s ease; }
.save-home-sheet.is-open .save-home-sheet-panel { transform: translateY(0); }
.save-sheet-close { position: absolute; top: .75rem; right: .75rem; border: none; background: none; font-size: 1.75rem; cursor: pointer; }
