/**
 * BIENTÔT CHEZ SOI - Design moderne et apaisant
 * Palette : Verts naturels + tons chauds
 */

:root {
    /* Couleurs principales */
    --primary: #6B9080;
    --primary-light: #A4C3B2;
    --primary-lighter: #CCE3DE;
    --primary-dark: #3D5A51;
    
    /* Backgrounds */
    --bg-main: #F6FFF8;
    --bg-card: #FFFFFF;
    --bg-section: #F0F7F4;
    
    /* Textes */
    --text-dark: #2C3E37;
    --text-medium: #6B7F76;
    --text-light: #A8B5B0;
    
    /* Accents */
    --accent-warm: #E8B4A0;
    --accent-gold: #D4AF7A;
    
    /* Ombres douces */
    --shadow-sm: 0 2px 8px rgba(61, 90, 81, 0.08);
    --shadow-md: 0 4px 16px rgba(61, 90, 81, 0.12);
    --shadow-lg: 0 8px 32px rgba(61, 90, 81, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ===================================
   HEADER - Logo et titre
   =================================== */

header {
    text-align: center;
    margin-bottom: 50px;
    padding: 50px 30px;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, rgba(255,255,255,0.7) 100%);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(107, 144, 128, 0.05) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.site-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.site-logo .icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 8px rgba(107, 144, 128, 0.3));
}

header h1 {
    font-size: 2.8rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.subtitle {
    color: var(--text-medium);
    font-size: 1.15rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ===================================
   FORMULAIRE
   =================================== */

.search-form {
    display: grid;
    gap: 25px;
}

.form-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(107, 144, 128, 0.1);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.form-section h3 {
    margin: 0 0 25px 0;
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--primary-lighter);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-main);
    box-shadow: 0 0 0 4px rgba(107, 144, 128, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* Checkboxes stylisées */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-section);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.checkbox-label:hover {
    background: var(--primary-lighter);
    border-color: var(--primary-light);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--primary-dark);
    font-weight: 600;
}

/* ===================================
   BOUTONS
   =================================== */

.btn-primary {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(107, 144, 128, 0.3);
}

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

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    color: var(--primary-dark);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 2px solid var(--primary-lighter);
    box-shadow: var(--shadow-sm);
}

.btn-back:hover {
    background: var(--primary-lighter);
    transform: translateX(-4px);
}

.btn-view {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-view:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===================================
   INFO BOX
   =================================== */

.info-box {
    background: linear-gradient(135deg, var(--primary-lighter) 0%, rgba(255,255,255,0.9) 100%);
    padding: 25px;
    border-radius: 16px;
    margin-top: 30px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.info-box h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-box p {
    color: var(--text-medium);
    margin-bottom: 10px;
    line-height: 1.7;
}

/* ===================================
   RÉSULTATS DE RECHERCHE
   =================================== */

.search-summary {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}

.search-summary h2 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 2rem;
}

.search-summary p {
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* Badges */
.dept-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 4px;
    box-shadow: var(--shadow-sm);
}

.filter-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-section);
    color: var(--text-dark);
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 4px;
    border: 1px solid var(--primary-lighter);
}

.filters-active {
    margin-top: 15px;
}

/* ===================================
   CARTES D'ANNONCES
   =================================== */

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.property-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(107, 144, 128, 0.1);
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.property-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--bg-section);
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.property-card:hover .property-image img {
    transform: scale(1.08);
}

.property-type {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(107, 144, 128, 0.95);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.property-source {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.property-info {
    padding: 25px;
}

.property-title {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 600;
}

.property-location {
    color: var(--text-medium);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.property-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.detail-item {
    background: var(--bg-section);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-dark);
    white-space: nowrap;
}

.property-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 15px 0;
}

.price-suffix {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-weight: 400;
}

.property-description {
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 15px 0;
}

/* ===================================
   CARTES LEAFLET
   =================================== */

.property-map {
    width: 100%;
    height: 180px;
    margin: 15px 0;
    border-radius: 12px;
    border: 2px solid var(--primary-lighter);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.property-map:hover {
    border-color: var(--primary);
}

.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: var(--bg-section);
    color: var(--text-medium);
    font-size: 14px;
}

.map-error {
    background: #FFF3E0;
    color: #E65100;
}

/* Badge viager */
.viager-badge {
    background: var(--accent-warm);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
}

/* ===================================
   PAS DE RÉSULTATS
   =================================== */

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-results h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.no-results ul {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
    color: var(--text-medium);
}

.no-results li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* ===================================
   MESSAGES
   =================================== */

.error-message {
    background: #FFEBEE;
    color: #C62828;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #C62828;
}

/* ===================================
   FOOTER
   =================================== */

.results-footer {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    color: white;
    box-shadow: var(--shadow-md);
}

.results-footer p {
    margin: 0;
    font-size: 1.1rem;
}

.results-footer strong {
    font-size: 1.3rem;
}

.results-footer small {
    display: block;
    margin-top: 8px;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* ===================================
   UTILITAIRES
   =================================== */

.info-hint {
    color: var(--text-medium);
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
}

.required-star {
    color: var(--accent-warm);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .site-logo .icon {
        font-size: 2.5rem;
    }
    
    .grid-2,
    .grid-3,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    header {
        padding: 30px 20px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

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

.property-card {
    animation: fadeIn 0.5s ease-out;
}

.property-card:nth-child(1) { animation-delay: 0.05s; }
.property-card:nth-child(2) { animation-delay: 0.1s; }
.property-card:nth-child(3) { animation-delay: 0.15s; }
.property-card:nth-child(4) { animation-delay: 0.2s; }
.property-card:nth-child(5) { animation-delay: 0.25s; }
.property-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-section {
    animation: slideIn 0.6s ease-out;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }
