/* ============================================
   POMPE A CHALEUR BAS-RHIN - CSS PRINCIPAL
   ============================================ */

/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --accent-color: #10b981;
    --accent-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg-light: #f9fafb;
    --bg-gray: #f3f4f6;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.3s ease;
}

/* Reset et Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.logo img {
    height: 45px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 40px;
    width: auto;
}

.btn-urgence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--danger-color);
    color: var(--white) !important;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    animation: pulse 2s infinite;
}

.btn-urgence:hover {
    background: var(--danger-dark);
    color: var(--white);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    display: block;
}

.hero-stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Ville Hero */
.ville-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: var(--white);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.ville-hero::before,
.ville-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.ville-hero::before {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
}

.ville-hero::after {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
}

.ville-infos {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.ville-info {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ville-info strong {
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: var(--white);
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Variante pour fonds sombres */
.hero .btn-outline,
.ville-hero .btn-outline,
.section-dark .btn-outline,
.urgence-banner .btn-outline {
    color: var(--white);
    border-color: var(--white);
}

.hero .btn-outline:hover,
.ville-hero .btn-outline:hover,
.section-dark .btn-outline:hover,
.urgence-banner .btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 4rem 0;
}

.section-gray {
    background: var(--bg-gray);
}

.section-dark {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a5f 100%);
    color: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.section-dark .section-title h2 {
    color: var(--white);
}

.section-title p {
    color: var(--text-light);
    font-size: 1.125rem;
}

.section-dark .section-title p {
    color: rgba(255,255,255,0.8);
}

/* ============================================
   SERVICE CARDS
   ============================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

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

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

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.service-card .price {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
}

.service-card ul {
    margin-top: 1rem;
}

.service-card ul li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-light);
}

.service-card ul li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: 700;
}

/* ============================================
   AVANTAGES
   ============================================ */
.avantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.avantage-item {
    text-align: center;
    padding: 1.5rem;
}

.avantage-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.avantage-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.avantage-item p {
    color: var(--text-light);
}

/* ============================================
   FORMULAIRES
   ============================================ */
.form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox RGPD */
.form-rgpd {
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-light);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: underline;
}

.checkbox-label a:hover {
    color: var(--primary-dark);
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    display: none;
}

.autocomplete-results.active {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--bg-light);
}

.autocomplete-item .ville-name {
    font-weight: 500;
    color: var(--text-color);
}

.autocomplete-item .canton-name {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    background: var(--bg-light);
    padding: 1rem 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    color: var(--text-muted);
}

.breadcrumb-list a {
    color: var(--text-light);
}

.breadcrumb-list a:hover {
    color: var(--primary-color);
}

.breadcrumb-list li:last-child {
    color: var(--text-color);
    font-weight: 500;
}

/* ============================================
   FAQ
   ============================================ */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.25rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-light);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item.active .faq-question::after {
    content: '-';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer-content {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* ============================================
   COMMUNES LIST
   ============================================ */
.communes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.communes-list a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    color: var(--text-color);
    font-size: 0.875rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.communes-list a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ============================================
   CANTONS LIST
   ============================================ */
.cantons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

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

.canton-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.canton-card .communes-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.canton-card .btn {
    margin-top: 1rem;
}

/* ============================================
   URGENCE BANNER
   ============================================ */
.urgence-banner {
    background: linear-gradient(135deg, var(--danger-color) 0%, #b91c1c 100%);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.urgence-banner h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.urgence-banner p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.urgence-banner .phone {
    font-size: 2rem;
    font-weight: 800;
    display: block;
    margin-bottom: 1rem;
}

/* ============================================
   CONTENT TEXT
   ============================================ */
.content-text {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-text h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.content-text p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.content-text ul {
    margin: 1rem 0 1rem 1.5rem;
}

.content-text ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.content-text ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.9rem;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: #1f2937;
    color: var(--white);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: rgba(255,255,255,0.7);
}

.footer-col a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

/* ============================================
   FORM VALIDATION ERRORS
   ============================================ */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ============================================
   CONTACT PAGE GRID
   ============================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-container {
        flex-wrap: wrap;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .ville-infos {
        flex-direction: column;
        align-items: center;
    }

    .section {
        padding: 2.5rem 0;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .cantons-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .faq-question {
        padding: 1rem;
        font-size: 0.9375rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .header,
    .footer,
    .urgence-banner,
    .btn {
        display: none;
    }

    .hero {
        background: none;
        color: var(--text-color);
    }
}
