/* ==========================================================================
   IvoirImmo – CSS Principal
   Palette Confiance & Chaleur : Indigo #4F46E5 | Émeraude #10B981 | Ambre #F59E0B
   ========================================================================== */

/* =========================
   Variables CSS
   ========================= */
:root {
    /* Couleurs principales */
    --indigo:         #4F46E5;   /* Indigo — confiance, stabilité, premium */
    --indigo-dark:    #3730A3;   /* Hover indigo */
    --emeraude:       #10B981;   /* Émeraude — croissance, succès */
    --emeraude-dark:  #059669;   /* Hover émeraude */
    --amber:          #F59E0B;   /* Ambre — chaleur, énergie, accessibilité */
    --amber-light:    #FCD34D;   /* Ambre clair */

    /* Alias Bootstrap-friendly */
    --primary-color:  var(--indigo);
    --primary-hover:  var(--indigo-dark);
    --secondary-color: var(--emeraude);
    --accent-color:   var(--amber);

    /* Neutres */
    --bg-warm:        #F8FAFF;   /* Blanc légèrement bleuté */
    --dark-color:     #111827;   /* Sombre */
    --gray-color:     #6B7280;
    --light-color:    #EEF2FF;   /* Indigo très clair */
    --white-color:    #FFFFFF;

    /* États */
    --success-color:  #10B981;
    --warning-color:  #F59E0B;
    --danger-color:   #EF4444;
    --info-color:     #3B82F6;

    /* UI */
    --border-color:   rgba(79, 70, 229, 0.18);
    --border-neutral: #E5E7EB;
    --radius-lg:      18px;
    --radius-md:      12px;
    --radius-sm:      8px;
    --shadow-warm:    0 8px 32px rgba(79, 70, 229, 0.12);
    --shadow-card:    0 4px 20px rgba(17, 24, 39, 0.08);
    --transition:     all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================
   Reset & Base
   ========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg-warm);
    color: var(--dark-color);
    line-height: 1.65;
    font-size: 0.95rem;
}

/* =========================
   Navigation Glassmorphism
   ========================= */
.navbar {
    background: rgba(248, 250, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(79, 70, 229, 0.15);
    transition: var(--transition);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

/* Effet au scroll : ajouté via JS → classe .navbar-scrolled */
.navbar.navbar-scrolled {
    background: rgba(248, 250, 255, 0.96);
    box-shadow: 0 4px 24px rgba(79, 70, 229, 0.15);
    border-bottom-color: rgba(79, 70, 229, 0.3);
}

.navbar-brand {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--indigo) !important;
    letter-spacing: -0.3px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.navbar-brand .brand-flag {
    display: inline-flex;
    gap: 2px;
    vertical-align: middle;
    margin-left: 6px;
    border-radius: 2px;
    overflow: hidden;
    height: 12px;
    width: 24px;
    flex-shrink: 0;
}

.navbar-brand .brand-flag span {
    flex: 1;
    display: block;
}

.navbar-brand .brand-flag .fl-orange { background: #4F46E5; }
.navbar-brand .brand-flag .fl-blanc  { background: #F59E0B; }
.navbar-brand .brand-flag .fl-vert   { background: #10B981; }

.nav-link {
    color: var(--gray-color);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem !important;
    border-radius: 999px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--indigo);
    background: rgba(79, 70, 229, 0.08);
}

/* Badge notifications */
.notif-badge {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Dropdown utilisateur */
.dropdown-menu {
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(17, 24, 39, 0.12);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--indigo);
}

/* =========================
   Boutons Pill & Dégradés
   ========================= */
.btn {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.55rem 1.5rem;
    transition: var(--transition);
    letter-spacing: 0.02em;
    font-size: 0.88rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--indigo) 0%, var(--amber) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--indigo-dark) 0%, var(--indigo) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    color: #fff;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary,
.btn-outline-secondary {
    background: transparent;
    border: 1.5px solid var(--border-neutral);
    color: var(--dark-color);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background: var(--light-color);
    border-color: var(--indigo);
    color: var(--indigo);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--emeraude) 0%, #34D399 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--emeraude-dark) 0%, var(--emeraude) 100%);
    transform: translateY(-2px);
    color: #fff;
}

.btn-outline-primary {
    border: 1.5px solid var(--indigo);
    color: var(--indigo);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--indigo);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    border: none;
    color: #fff;
}

/* Bouton CTA pulse */
.btn-cta-pulse {
    animation: pulse-cta 2.2s ease-in-out infinite;
}

@keyframes pulse-cta {
    0%   { box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35); }
    50%  { box-shadow: 0 6px 28px rgba(79, 70, 229, 0.6), 0 0 0 8px rgba(79, 70, 229, 0.08); }
    100% { box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35); }
}

/* =========================
   Badges
   ========================= */
.badge {
    font-weight: 600;
    padding: 0.4em 0.75em;
    border-radius: 999px;
    font-size: 0.75em;
}

.badge-ivoire {
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
}

.badge.bg-primary {
    background: var(--indigo) !important;
}

.badge.bg-success {
    background: var(--emeraude) !important;
}

/* =========================
   Cards Ivoiriennes
   ========================= */
.card {
    background-color: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.card:hover {
    box-shadow: var(--shadow-warm);
    transform: translateY(-5px);
    border-color: rgba(79, 70, 229, 0.3);
}

.card-header {
    border-bottom: 1px solid var(--border-neutral);
    background: transparent;
    font-weight: 600;
}

/* Card Annonce logement */
.logement-card {
    overflow: hidden;
}

.logement-card .card-img-top {
    height: 210px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.logement-card:hover .card-img-top {
    transform: scale(1.04);
}

/* Card Shimmer Skeleton */
.card-skeleton {
    background: linear-gradient(
        90deg,
        var(--light-color) 25%,
        #d4d9ff 37%,
        var(--light-color) 63%
    );
    background-size: 400% 100%;
    animation: shimmer 1.6s linear infinite;
    border-radius: var(--radius-lg);
    min-height: 240px;
}

@keyframes shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================
   Hero Section
   ========================= */
.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--indigo) 0%, #312ECB 40%, #1e1b8a 100%);
    min-height: 520px;
}

/* Pattern adinkra géométrique en SVG inline */
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1' stroke-opacity='0.12'%3E%3Crect x='5' y='5' width='50' height='50' rx='4'/%3E%3Cline x1='5' y1='30' x2='55' y2='30'/%3E%3Cline x1='30' y1='5' x2='30' y2='55'/%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3Cpath d='M5 5 L30 30 L55 5 M5 55 L30 30 L55 55'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 60px 60px;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

.hero-section > * {
    position: relative;
    z-index: 1;
}

.hero-section .hero-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.hero-section .hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.92;
}

/* Card recherche dans le hero */
.hero-search-card {
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    border: none;
}

.hero-search-card .card-body {
    padding: 1.75rem;
}

/* =========================
   Stats Section
   ========================= */
.stats-section {
    background: var(--white-color);
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--indigo), var(--amber), var(--emeraude)) 1;
}

.stat-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.stat-card:hover {
    background: var(--bg-warm);
    transform: translateY(-4px);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
}

.stat-icon-orange { background: linear-gradient(135deg, var(--indigo), var(--amber)); color: #fff; }
.stat-icon-vert   { background: linear-gradient(135deg, var(--emeraude), #34D399); color: #fff; }
.stat-icon-or     { background: linear-gradient(135deg, var(--amber), #FCD34D); color: var(--dark-color); }
.stat-icon-dark   { background: linear-gradient(135deg, var(--dark-color), #1F2937); color: #fff; }

.stat-number {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.stat-label {
    color: var(--gray-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.3rem;
}

/* =========================
   Section "Comment ça marche"
   ========================= */
.how-it-works-section {
    background: var(--bg-warm);
}

.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--white-color);
    border: 1px solid var(--border-neutral);
    transition: var(--transition);
    position: relative;
}

.step-card:hover {
    border-color: var(--indigo);
    box-shadow: var(--shadow-warm);
    transform: translateY(-5px);
}

.step-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    font-size: 2rem;
    position: relative;
}

.step-icon-1 {
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.step-icon-2 {
    background: linear-gradient(135deg, var(--emeraude), #34D399);
    color: #fff;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.step-icon-3 {
    background: linear-gradient(135deg, var(--amber), #FCD34D);
    color: var(--dark-color);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.step-number {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background: var(--dark-color);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   Section CTA Finale
   ========================= */
.cta-section {
    background: linear-gradient(135deg, var(--indigo) 0%, #312ECB 50%, var(--dark-color) 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23fff' stroke-width='0.8' stroke-opacity='0.08'%3E%3Ccircle cx='20' cy='20' r='15'/%3E%3Ccircle cx='20' cy='20' r='8'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 40px 40px;
    pointer-events: none;
}

.cta-section > * { position: relative; z-index: 1; }

.cta-section .btn-cta-light {
    background: #fff;
    color: var(--emeraude);
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cta-section .btn-cta-light:hover {
    background: var(--amber);
    color: #fff;
    transform: translateY(-2px);
}

/* =========================
   Formulaires
   ========================= */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-neutral);
    background: var(--white-color);
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark-color);
    margin-bottom: 0.4rem;
}

/* =========================
   Filtres de recherche
   ========================= */
.filter-section {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-neutral);
    box-shadow: var(--shadow-card);
}

/* =========================
   Prix
   ========================= */
.price-tag {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-primary {
    color: var(--indigo) !important;
}

.bg-primary {
    background-color: var(--indigo) !important;
}

.bg-success {
    background-color: var(--emeraude) !important;
}

/* =========================
   Galerie photos
   ========================= */
.gallery-image {
    border-radius: var(--radius-md);
    transition: transform 0.28s ease;
    cursor: pointer;
}

.gallery-image:hover {
    transform: scale(1.04);
}

/* =========================
   Notation par étoiles
   ========================= */
.rating-stars {
    color: var(--amber);
}

.rating-stars i {
    margin-right: 2px;
}

/* =========================
   Dashboard
   ========================= */
.dashboard-card {
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(0,154,68,0.08));
    border-left: 4px solid var(--indigo);
    border-radius: var(--radius-lg);
}

.dashboard-stat {
    background: var(--white-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-neutral);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.dashboard-stat:hover {
    border-color: var(--indigo);
    box-shadow: var(--shadow-warm);
}

/* =========================
   Animations au scroll
   ========================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Délais pour stagger */
.fade-in-up:nth-child(1) { transition-delay: 0s; }
.fade-in-up:nth-child(2) { transition-delay: 0.1s; }
.fade-in-up:nth-child(3) { transition-delay: 0.2s; }
.fade-in-up:nth-child(4) { transition-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

/* =========================
   Loader
   ========================= */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(248, 250, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border-orange {
    border-color: var(--indigo) var(--indigo) transparent transparent;
}

/* =========================
   Toast notifications Ivoiriennes
   ========================= */
.toast-container {
    position: fixed;
    top: 85px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
}

.toast-container .alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 8px 32px rgba(17, 24, 39, 0.15);
    font-size: 0.875rem;
    font-weight: 500;
}

.toast-container .alert-success {
    background: linear-gradient(135deg, var(--emeraude), #34D399);
    color: #fff;
}

.toast-container .alert-warning {
    background: linear-gradient(135deg, var(--amber), #FCD34D);
    color: var(--dark-color);
}

.toast-container .alert-danger {
    background: linear-gradient(135deg, var(--danger-color), #FF6B5B);
    color: #fff;
}

.toast-container .alert-info,
.toast-container .alert-secondary {
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
}

/* =========================
   Bouton Chat Flottant
   ========================= */
.chat-fab {
    position: fixed;
    bottom: 88px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--emeraude), #34D399);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9997;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.45);
    transition: var(--transition);
    text-decoration: none;
    animation: fab-bounce 3s ease-in-out infinite;
}

.chat-fab:hover {
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.5);
    color: #fff;
}

.chat-fab i {
    font-size: 1.4rem;
}

.chat-fab .chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--indigo);
    color: #fff;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.chat-fab-tooltip {
    position: absolute;
    right: 64px;
    background: var(--dark-color);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.chat-fab-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right: none;
    border-left-color: var(--dark-color);
}

.chat-fab:hover .chat-fab-tooltip {
    opacity: 1;
}

@keyframes fab-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* =========================
   Widget Chat Flottant
   ========================= */
.chat-widget {
    position: fixed;
    bottom: 156px;
    right: 28px;
    width: 360px;
    max-height: 520px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 9996;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.85) translateY(20px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.chat-widget.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* En-tête */
.chat-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
    flex-shrink: 0;
}

.chat-widget-header-info {
    flex: 1;
    min-width: 0;
}

#chatWidgetTitle {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-widget-sub {
    font-size: 0.72rem;
    opacity: 0.85;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-widget-back,
.chat-widget-close,
.chat-widget-full-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
    flex-shrink: 0;
    text-decoration: none;
}

.chat-widget-back:hover,
.chat-widget-close:hover,
.chat-widget-full-btn:hover {
    background: rgba(255,255,255,0.35);
    color: #fff;
}

/* Corps */
.chat-widget-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Liste conversations */
.chat-conv-list {
    padding: 8px 0;
}

.chat-conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f3f3f3;
}

.chat-conv-item:hover {
    background: var(--bg-warm, #fff9f5);
}

.chat-conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-conv-info {
    flex: 1;
    min-width: 0;
}

.chat-conv-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-conv-logement {
    font-size: 0.72rem;
    color: var(--emeraude);
    margin-top: 1px;
}

.chat-conv-preview {
    font-size: 0.78rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-conv-time {
    font-size: 0.7rem;
    color: #aaa;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.chat-badge {
    background: var(--indigo);
    color: #fff;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
}

/* Messages */
.chat-msg-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.chat-bubble-row {
    display: flex;
}

.chat-bubble-row.mine {
    justify-content: flex-end;
}

.chat-bubble-row.theirs {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 78%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}

.chat-bubble.mine {
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
    background: #f0f0f0;
    color: var(--dark-color);
    border-bottom-left-radius: 4px;
}

.chat-bubble-time {
    display: block;
    font-size: 0.65rem;
    margin-top: 3px;
    opacity: 0.7;
    text-align: right;
}

/* Pied — envoi */
.chat-widget-footer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.chat-widget-input {
    flex: 1;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.84rem;
    resize: none;
    outline: none;
    max-height: 100px;
    line-height: 1.4;
    font-family: inherit;
    transition: border-color 0.2s;
}

.chat-widget-input:focus {
    border-color: var(--indigo);
}

.chat-widget-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: transform 0.15s, opacity 0.15s;
}

.chat-widget-send:hover {
    transform: scale(1.1);
}

.chat-widget-send:disabled {
    opacity: 0.5;
    transform: none;
}

/* États vides / loading */
.chat-loading,
.chat-empty {
    text-align: center;
    padding: 32px 16px;
    color: #aaa;
    font-size: 0.85rem;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Responsive mobile */
@media (max-width: 480px) {
    .chat-widget {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 140px;
        max-height: 60vh;
    }
}

/* =========================
   Back-to-top Ivoirien
   ========================= */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
    transition: var(--transition);
    border: none;
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--emeraude), #34D399);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
    color: #fff;
}

/* =========================
   Chat Ivoirien
   ========================= */
.chat-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Liste conversations */
.conversation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border-bottom: 1px solid var(--border-neutral);
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
}

.conversation-item:hover {
    background: rgba(79, 70, 229, 0.06);
    color: var(--dark-color);
}

.conversation-item.unread {
    background: rgba(79, 70, 229, 0.05);
    border-left: 3px solid var(--indigo);
}

.conv-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.conv-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.conv-body {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conv-last-msg {
    font-size: 0.82rem;
    color: var(--gray-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-meta {
    font-size: 0.75rem;
    color: var(--gray-color);
    white-space: nowrap;
}

.conv-unread-badge {
    background: var(--indigo);
    color: #fff;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    min-width: 20px;
    text-align: center;
}

/* Bulles de messages */
.chat-messages-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-warm);
    min-height: 0;
}

.chat-messages-wrapper::-webkit-scrollbar {
    width: 4px;
}

.chat-messages-wrapper::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.3);
    border-radius: 99px;
}

/* Bulle message */
.msg-bubble {
    max-width: 70%;
    padding: 0.65rem 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

/* Message de MOI (à droite) */
.msg-mine {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Message de l'autre (à gauche) */
.msg-other {
    align-self: flex-start;
    background: var(--white-color);
    color: var(--dark-color);
    border: 1px solid var(--border-neutral);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.msg-time {
    font-size: 0.68rem;
    opacity: 0.65;
    display: block;
    margin-top: 0.25rem;
    text-align: right;
}

.msg-sender-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--indigo);
    margin-bottom: 0.2rem;
}

/* Barre d'envoi chat */
.chat-input-bar {
    background: var(--white-color);
    border-top: 1px solid var(--border-neutral);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input-bar textarea {
    flex: 1;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-neutral);
    padding: 0.6rem 0.9rem;
    resize: none;
    max-height: 120px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.chat-input-bar textarea:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, var(--emeraude), #34D399);
    transform: scale(1.08);
}

/* En-tête conversation */
.chat-header {
    background: var(--white-color);
    border-bottom: 1px solid var(--border-neutral);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.chat-header .interlocutor-name {
    font-weight: 700;
    font-size: 1rem;
}

.chat-header .chat-logement-info {
    font-size: 0.78rem;
    color: var(--gray-color);
}

/* Logement card dans le chat */
.chat-logement-card {
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.chat-logement-card a {
    color: var(--indigo);
    font-weight: 600;
    text-decoration: none;
}

.chat-logement-card a:hover {
    text-decoration: underline;
}

/* Séparateur date chat */
.chat-date-sep {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-color);
    position: relative;
    margin: 0.5rem 0;
}

.chat-date-sep::before,
.chat-date-sep::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--border-neutral);
}

.chat-date-sep::before { left: 0; }
.chat-date-sep::after  { right: 0; }

/* =========================
   Footer Ivoirien
   ========================= */
footer.footer-ivoire {
    background: linear-gradient(180deg, #111827 0%, #0a0f1e 100%);
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    overflow: hidden;
}

footer.footer-ivoire::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--indigo), var(--amber), var(--emeraude));
}

footer.footer-ivoire .footer-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--indigo);
}

footer.footer-ivoire .footer-tagline {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

footer.footer-ivoire h6.footer-title {
    color: var(--amber);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
}

footer.footer-ivoire a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-block;
}

footer.footer-ivoire a:hover {
    color: var(--indigo);
    transform: translateX(4px);
}

footer.footer-ivoire .social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
    transform: none;
    margin-right: 0.5rem;
}

footer.footer-ivoire .social-link:hover {
    background: var(--indigo);
    border-color: var(--indigo);
    color: #fff;
    transform: translateY(-3px);
}

footer.footer-ivoire .footer-divider {
    border-color: rgba(255,255,255,0.08);
}

footer.footer-ivoire .made-with {
    background: rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    color: var(--amber);
    display: inline-block;
}

/* =========================
   Sections générales
   ========================= */
.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--dark-color);
}

.section-title span {
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--gray-color);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
}

/* =========================
   Breadcrumb
   ========================= */
.breadcrumb-item a {
    color: var(--indigo);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--gray-color);
}

/* =========================
   Alertes
   ========================= */
.alert-info {
    background: rgba(59, 168, 212, 0.1);
    border-color: rgba(59, 168, 212, 0.3);
    color: var(--dark-color);
}

/* =========================
   Pagination
   ========================= */
.page-link {
    color: var(--indigo);
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    border: 1px solid var(--border-neutral);
}

.page-link:hover {
    background: var(--indigo);
    border-color: var(--indigo);
    color: #fff;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--indigo), var(--amber));
    border-color: transparent;
    color: #fff;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(248, 250, 255, 0.98);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: var(--shadow-warm);
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .msg-bubble {
        max-width: 85%;
    }

    .back-to-top {
        bottom: 20px;
        right: 16px;
        width: 42px;
        height: 42px;
    }

    .chat-fab {
        bottom: 74px;
        right: 16px;
        width: 50px;
        height: 50px;
    }
}

/* =========================
   Impression
   ========================= */
@media print {
    .navbar,
    footer,
    .btn,
    .filter-section,
    .back-to-top,
    .chat-fab,
    .chat-input-bar {
        display: none !important;
    }
}

/* ==========================================================================
   Consentement Cookies
   ========================================================================== */

/* ── Bannière ── */
#cookieBanner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--dark-color);
    color: #e8e8e8;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#cookieBanner.show {
    transform: translateY(0);
}
#cookieBanner .cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
#cookieBanner .cookie-text {
    flex: 1;
    min-width: 240px;
    font-size: 0.875rem;
    line-height: 1.55;
}
#cookieBanner .cookie-text strong {
    color: var(--indigo);
    font-size: 0.95rem;
}
#cookieBanner .cookie-text a {
    color: var(--amber);
    text-decoration: underline;
}
#cookieBanner .cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
#cookieBanner .btn-cookie-accept {
    background: var(--emeraude);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
#cookieBanner .btn-cookie-accept:hover { background: var(--emeraude-dark); }
#cookieBanner .btn-cookie-reject {
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}
#cookieBanner .btn-cookie-reject:hover { border-color: #aaa; color: #fff; }
#cookieBanner .btn-cookie-settings {
    background: transparent;
    color: var(--amber);
    border: 1px solid var(--amber);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
#cookieBanner .btn-cookie-settings:hover {
    background: var(--amber);
    color: var(--dark-color);
}

/* ── Modal paramétrage ── */
#cookieModal .modal-header {
    background: var(--dark-color);
    color: #fff;
    border-bottom: 2px solid var(--indigo);
}
#cookieModal .modal-header .btn-close {
    filter: invert(1);
}
#cookieModal .cookie-category {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
#cookieModal .cookie-category:hover { border-color: var(--indigo); }
#cookieModal .cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
#cookieModal .cookie-category-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#cookieModal .cookie-category-title i {
    color: var(--indigo);
    width: 18px;
    text-align: center;
}
#cookieModal .cookie-category-desc {
    font-size: 0.82rem;
    color: var(--gray-color);
    margin: 0;
}
#cookieModal .badge-required {
    font-size: 0.7rem;
    background: var(--emeraude);
    color: #fff;
    padding: 0.2em 0.6em;
    border-radius: 50px;
    font-weight: 500;
}
/* Toggle switch custom */
.cookie-toggle .form-check-input {
    width: 2.5em;
    height: 1.35em;
    cursor: pointer;
}
.cookie-toggle .form-check-input:checked { background-color: var(--emeraude); border-color: var(--emeraude); }
.cookie-toggle .form-check-input:focus { box-shadow: 0 0 0 0.15rem rgba(0,154,68,0.3); }

/* ── Bouton rouvrir (footer) ── */
.cookie-reopen-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    text-decoration: underline;
}
.cookie-reopen-btn:hover { opacity: 1; }

@media (max-width: 576px) {
    #cookieBanner .cookie-banner-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
    #cookieBanner .cookie-actions { width: 100%; justify-content: flex-start; }
}

/* ==========================================================================
   PWA — Prompt d'installation
   ========================================================================== */
#pwaInstallBanner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;   /* sous le banner cookies (9999) */
    background: linear-gradient(135deg, #111827 0%, #1F2937 100%);
    color: #fff;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -3px 20px rgba(0,0,0,0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
    flex-wrap: wrap;
}
#pwaInstallBanner.show { transform: translateY(0); }
#pwaInstallBanner .pwa-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}
#pwaInstallBanner .pwa-text { flex: 1; min-width: 160px; }
#pwaInstallBanner .pwa-text strong { font-size: 0.9rem; display: block; }
#pwaInstallBanner .pwa-text small { color: rgba(255,255,255,0.6); font-size: 0.78rem; }
#pwaInstallBanner .pwa-actions { display: flex; gap: 0.5rem; align-items: center; }
.btn-pwa-install {
    background: var(--indigo);
    color: #fff;
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-pwa-install:hover { background: var(--indigo-dark); }
.btn-pwa-dismiss {
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}
.btn-pwa-dismiss:hover { color: #fff; }

/* ── Badge iOS instructions ── */
#pwaIosTip {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    z-index: 9998;
    background: #111827;
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    font-size: 0.83rem;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    width: min(340px, 92vw);
    transition: transform 0.35s ease;
    border: 1px solid rgba(79, 70, 229, 0.4);
}
#pwaIosTip.show { transform: translateX(-50%) translateY(0); }
#pwaIosTip .ios-arrow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #111827;
}
