/* BienImmo — design inspiré Houzy (teal, épuré, cartes arrondies) */
:root {
    --brand: #00857A;
    --brand-dark: #00695C;
    --brand-light: #E0F2F1;
    --navy: #0A2540;
    --accent: #FFC857;
    --surface: #F4FAF9;
    --border: #E2EBEA;
    --text: #1A2E35;
    --muted: #5C737A;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(10, 37, 64, 0.08);
    --shadow-lg: 0 20px 50px rgba(10, 37, 64, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

/* Splash */
.splash {
    position: fixed; inset: 0; z-index: 9999;
    background: #fff; display: flex; align-items: center; justify-content: center;
}
.splash-logo { font-size: 2rem; font-weight: 800; color: var(--brand); }
.splash-logo span { color: var(--navy); }
.splash-bar { width: 120px; height: 4px; background: var(--brand-light); border-radius: 99px; margin-top: 1rem; overflow: hidden; }
.splash-bar-fill { height: 100%; width: 40%; background: var(--brand); border-radius: 99px; animation: splash 1.2s ease-in-out infinite; }
@keyframes splash { 0%,100% { transform: translateX(-100%); } 50% { transform: translateX(200%); } }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .7rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: .925rem;
    border: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(0,133,122,.35); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #061829; }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); padding: .5rem .85rem; border-radius: 10px; }
.btn-ghost:hover { background: var(--surface); color: var(--navy); }
.btn-sm { padding: .45rem .9rem; font-size: .82rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 10px; }

/* Forms */
.field { margin-bottom: 1rem; }
.label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .03em; }
.input, .select, .textarea {
    width: 100%; padding: .72rem 1rem; border: 1.5px solid var(--border);
    border-radius: 12px; font-size: .95rem; background: #fff; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,133,122,.12);
}
.textarea { min-height: 120px; resize: vertical; }

/* Cards */
.card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-flat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }

/* Header Houzy-style */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; gap: 1rem;
    padding: .85rem 0; min-height: 64px;
}
.logo { font-size: 1.45rem; font-weight: 800; color: var(--brand); text-decoration: none; letter-spacing: -.02em; }
.logo span { color: var(--navy); }
.nav-main { display: none; gap: .25rem; margin-left: 1rem; }
@media (min-width: 900px) { .nav-main { display: flex; } }
.nav-link {
    padding: .5rem .85rem; border-radius: 999px; font-size: .875rem; font-weight: 500;
    color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active { background: var(--brand-light); color: var(--brand-dark); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

/* Hero Houzy */
.hero {
    background: linear-gradient(165deg, var(--navy) 0%, #0D3D4A 45%, var(--brand-dark) 100%);
    color: #fff; padding: 3.5rem 0 4rem; position: relative; overflow: hidden;
}
.hero::after {
    content: ''; position: absolute; right: -10%; top: -20%; width: 50%; height: 140%;
    background: radial-gradient(circle, rgba(0,133,122,.35) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 { font-size: clamp(1.85rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; margin: 0 0 .75rem; }
.hero p { font-size: 1.05rem; color: rgba(255,255,255,.78); max-width: 540px; margin: 0 0 2rem; }
.hero-tabs { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.hero-tab {
    padding: .55rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .875rem;
    background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); border: 1.5px solid transparent;
    cursor: pointer; transition: all .15s;
}
.hero-tab.active { background: #fff; color: var(--navy); border-color: #fff; }
.search-box {
    background: #fff; border-radius: 18px; padding: 1rem;
    box-shadow: var(--shadow-lg); display: grid; gap: .75rem;
}
@media (min-width: 768px) {
    .search-box { grid-template-columns: 1fr 160px 160px auto; align-items: end; padding: 1rem 1.25rem; }
}

/* Tool cards (Houzy grid) */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.tool-card {
    padding: 1.35rem; border-radius: var(--radius); border: 1px solid var(--border);
    background: #fff; transition: transform .15s, box-shadow .15s; cursor: pointer; text-decoration: none; color: inherit;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-light); }
.tool-icon {
    width: 44px; height: 44px; border-radius: 12px; background: var(--brand-light);
    color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: .85rem;
}
.tool-card h3 { margin: 0 0 .35rem; font-size: 1rem; font-weight: 700; }
.tool-card p { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.45; }

/* Stats band */
.stats-band {
    background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    padding: 2.5rem 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; text-align: center; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--brand); }
.stat-label { font-size: .85rem; color: var(--muted); margin-top: .25rem; }

/* Listing cards */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.listing-card {
    border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
    background: #fff; transition: transform .15s, box-shadow .15s; cursor: pointer; text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
}
.listing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.listing-thumb {
    aspect-ratio: 4/3; background: var(--brand-light) center/cover no-repeat; position: relative;
}
.listing-badge {
    position: absolute; top: .65rem; left: .65rem; padding: .25rem .6rem; border-radius: 999px;
    font-size: .7rem; font-weight: 700; background: var(--accent); color: var(--navy);
}
.listing-pro-badge {
    position: absolute; top: .65rem; right: .65rem; padding: .25rem .55rem; border-radius: 999px;
    font-size: .68rem; font-weight: 700; background: var(--navy); color: #fff;
}
.listing-body { padding: 1rem 1.1rem 1.15rem; flex: 1; display: flex; flex-direction: column; }
.listing-price { font-size: 1.35rem; font-weight: 800; color: var(--brand-dark); }
.listing-title { font-weight: 600; margin: .35rem 0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .35rem; }
.listing-loc { margin-top: auto; padding-top: .65rem; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }

/* Search layout */
.search-layout { display: grid; gap: 1.25rem; min-height: calc(100vh - 140px); }
@media (min-width: 1024px) {
    .search-layout.with-map { grid-template-columns: 380px 1fr; }
    .search-layout.split { grid-template-columns: 1fr 1fr; }
}
.filters-panel {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; height: fit-content; position: sticky; top: 80px;
}
.filter-section { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.filter-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.zone-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.zone-chip {
    padding: .4rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
    border: 1.5px solid var(--border); background: #fff; cursor: pointer; transition: all .15s;
}
.zone-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.map-panel { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 420px; position: relative; }
.map-panel #search-map, .map-fullscreen #fullscreen-map { width: 100%; height: 100%; min-height: 420px; }
.map-toolbar {
    position: absolute; top: .75rem; right: .75rem; z-index: 500;
    display: flex; gap: .4rem; flex-wrap: wrap;
}

.map-fullscreen {
    position: fixed; inset: 0; z-index: 200; background: #fff;
    display: grid; grid-template-columns: 380px 1fr;
}
@media (max-width: 900px) {
    .map-fullscreen { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; }
}
.map-sidebar { overflow-y: auto; border-right: 1px solid var(--border); background: #fff; }
.map-sidebar-header { padding: 1rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 10; }

/* Listing detail */
.detail-gallery { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; background: var(--brand-light) center/cover; }
.detail-thumbs { display: flex; gap: .5rem; padding: .75rem; overflow-x: auto; }
.detail-thumb { width: 72px; height: 56px; border-radius: 8px; background-size: cover; background-position: center; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.detail-thumb.active { border-color: var(--brand); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.spec-item { padding: .85rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.spec-item i { color: var(--brand); margin-bottom: .35rem; }
.spec-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.spec-value { font-weight: 700; font-size: .95rem; }

/* Pro section */
.pro-hero {
    background: linear-gradient(135deg, var(--brand-light) 0%, #fff 60%);
    border: 1px solid var(--brand-light); border-radius: 20px; padding: 2.5rem; text-align: center;
}
.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 2rem; }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); padding: 3rem 0 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-title { color: #fff; font-weight: 700; margin-bottom: .85rem; }
.footer-link { display: block; padding: .25rem 0; color: rgba(255,255,255,.65); text-decoration: none; font-size: .875rem; }
.footer-link:hover { color: #fff; }

/* Misc */
.skeleton { background: linear-gradient(90deg, #E8F0EF 25%, #F4FAF9 50%, #E8F0EF 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.tag { display: inline-flex; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--brand-light); color: var(--brand-dark); }
.toast {
    position: fixed; top: 1rem; right: 1rem; z-index: 9999; padding: .85rem 1.15rem;
    border-radius: 12px; color: #fff; font-weight: 500; box-shadow: var(--shadow-lg);
    animation: toastIn .25s ease;
}
.toast-success { background: var(--brand); }
.toast-error { background: #C62828; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: .75rem; opacity: .4; }
.view-toggle { display: inline-flex; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.view-toggle button { padding: .45rem .85rem; border: none; background: #fff; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--muted); }
.view-toggle button.active { background: var(--brand); color: #fff; }
.section-title { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin: 0 0 .35rem; }
.section-sub { color: var(--muted); margin: 0 0 1.75rem; }
.publish-steps { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.publish-step { padding: .4rem .85rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface); color: var(--muted); }
.publish-step.active { background: var(--brand); color: #fff; }
.publish-step.done { background: var(--brand-light); color: var(--brand-dark); }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }
.listings-map-popup .leaflet-popup-content { margin: 0; font-family: Inter, sans-serif; }
.listing-mini-card { width: 200px; }
.listing-mini-card img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; }

@media (max-width: 640px) {
    .listings-grid { grid-template-columns: 1fr; }
    .hero { padding: 2.5rem 0 3rem; }
}
