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

:root {
    --primary-color: #6369d1;
    --primary-dark: #4f54b8;
    --primary-light: #7d82e0;
    --secondary-color: #6369d1;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-bg: #f5f6fa;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(99, 105, 209, 0.15);
    --shadow-hover: 0 4px 20px rgba(99, 105, 209, 0.25);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

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

/* ========== Header / Menu ========== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    background: transparent;
    transition: opacity 0.2s;
}
.logo-link:hover { opacity: 0.9; }
.logo-link:focus { outline: 2px solid var(--primary-color); outline-offset: 2px; }

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.menu-toggle {
    display: none;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-main ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.nav-main ul li { display: flex; align-items: center; }

.nav-main ul li.has-submenu {
    position: relative;
}

.nav-main ul li.has-submenu > a {
    padding-right: 1.4rem;
}

.nav-main ul li.has-submenu > a::after {
    content: '▾';
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    opacity: 0.75;
}

.nav-main ul.submenu {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 260px;
    padding: 0.4rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    z-index: 1200;
}

.nav-main ul.submenu li {
    display: block;
}

.nav-main ul.submenu a {
    display: block;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.nav-main ul.submenu a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.nav-main li.has-submenu:hover > ul.submenu,
.nav-main li.has-submenu:focus-within > ul.submenu {
    display: block;
}

.nav-main a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}
.nav-main a:hover,
.nav-main a.active {
    color: var(--primary-color);
    background: transparent;
}
.nav-main a.active {
    font-weight: 600;
}

.nav-overlay {
    display: none;
}

/* Bouton loupe */
.search-toggle {
    background: var(--white);
    border: 1.5px solid var(--primary-light);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0;
    color: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(99, 105, 209, 0.2);
    font-weight: normal;
}

.search-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(99, 105, 209, 0.35);
    transform: scale(1.03);
}

/* Popup de recherche */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background-color: var(--white);
    border-radius: 15px;
    padding: 2rem;
    padding-top: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--primary-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: 300;
}

.search-close:hover {
    background-color: var(--light-bg);
    transform: rotate(90deg);
    color: var(--primary-dark);
}

.search-modal-input {
    width: 100%;
    padding: 1.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 105, 209, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    margin-top: 0.5rem;
}

.search-modal .search-results {
    position: relative;
    top: auto;
    margin-top: 1rem;
    max-height: 500px;
    display: block;
}

.search-modal .search-results:not(.active) {
    display: none;
}

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

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.search-result-item:hover {
    background-color: var(--light-bg);
}

.search-result-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.search-result-item p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.search-highlight {
    background-color: #fff9e6;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 600;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 300px);
}

.section {
    margin-bottom: 3rem;
}

.section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.baseline {
    color: var(--text-light);
    font-size: 1.35rem;
    font-style: italic;
    margin: 0 auto 1.5rem;
    max-width: 42rem;
    text-align: center;
}

.section-subtitle {
    margin-top: 2rem;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.card h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.card p {
    margin-bottom: 0.5rem;
}

.card ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.card li {
    margin-bottom: 0.5rem;
}

.card.important {
    border-left: 4px solid var(--warning-color);
    background-color: #fff9e6;
}

.card.emergency {
    border-left: 4px solid var(--accent-color);
    background-color: #ffe6e6;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Info Card */
.info-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.info-card h3 {
    color: var(--white);
    margin-bottom: 1rem;
}

.address {
    font-size: 1.1rem;
}

/* Description */
.description {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 1.1rem;
}

.description p {
    margin-bottom: 1rem;
}

/* Hero image + texte - page d'accueil (image à gauche, texte à droite) */
.hero-intro {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin: 2rem 0;
}

.hero-intro-img {
    flex-shrink: 0;
}

.hero-intro-img .hero-home-img {
    width: 260px;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    display: block;
}

.hero-intro-text {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .hero-intro {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .hero-intro-img .hero-home-img {
        width: 220px;
    }

    .hero-intro-text {
        width: 100%;
    }
}

/* Quick Links */
.quick-links {
    margin-top: 3rem;
}

.quick-link-card {
    display: block;
    background-color: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-link-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.quick-link-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.quick-link-card p {
    color: var(--text-light);
    margin: 0;
}

/* Contact Section */
.contact-section {
    margin-bottom: 2rem;
}

.contact-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.contact-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.contact-details p {
    margin-bottom: 0.8rem;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Code */
.code {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Bus Lines */
.bus-lines {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

/* Schedule */
.schedule {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.schedule p {
    margin-bottom: 0.5rem;
}

/* Notes and Warnings */
.note {
    background-color: #e8f4f8;
    padding: 0.8rem;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
    margin-top: 1rem;
    font-size: 0.95rem;
}

.warning {
    background-color: #ffe6e6;
    padding: 1rem;
    border-radius: 5px;
    border-left: 3px solid var(--accent-color);
    margin-top: 1rem;
    font-weight: 500;
}

.info-note {
    background-color: #e8f5e9;
    padding: 1rem;
    border-radius: 5px;
    border-left: 3px solid var(--success-color);
    margin-top: 1rem;
}

/* Emergency Contacts */
.emergency-contacts {
    margin-top: 2rem;
}

/* Form Styles */
.form-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

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

.form-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: var(--white) !important;
}

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

a.btn-primary:hover {
    color: var(--white) !important;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

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

/* Success Message */
.success-message {
    background-color: #e8f5e9;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--success-color);
    font-weight: 500;
}

.success-message p {
    margin: 0;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

.footer-nav {
    margin-bottom: 1.25rem;
}
.footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
}
.footer-nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    opacity: 0.95;
    transition: opacity 0.2s;
}
.footer-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}
.footer-nav a.active {
    font-weight: 600;
    text-decoration: underline;
}

/* ========== Menu mobile ========== */
@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
    }

    .logo-link { flex-shrink: 0; z-index: 1002; }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 48px;
        min-height: 48px;
        padding: 0 1rem;
        border: 2px solid var(--primary-color);
        border-radius: 8px;
        background: var(--white);
        color: var(--primary-color);
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        z-index: 1002;
        transition: background 0.2s, color 0.2s;
        touch-action: manipulation;
    }
    .menu-toggle:hover {
        background: var(--primary-color);
        color: var(--white);
    }
    .nav-check:checked ~ .header-right .menu-toggle {
        background: var(--primary-color);
        color: var(--white);
    }

    .header-right .nav-main {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 85vw;
        height: 100%;
        height: 100dvh;
        flex-direction: column;
        align-items: stretch;
        padding: 4rem 0 1rem;
        background: var(--white);
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        z-index: 1002;
        overflow-y: auto;
    }
    .nav-check:checked ~ .header-right .nav-main {
        display: flex;
    }

    .nav-main ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
        gap: 0;
    }
    .nav-main ul li {
        border-bottom: 1px solid var(--border-color);
    }
    .nav-main ul li.has-submenu {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-main a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        text-align: left;
    }
    .nav-main a:hover { background: var(--light-bg); color: var(--primary-color); }

    .nav-main ul.submenu {
        position: static;
        display: block;
        min-width: 0;
        padding: 0 0 0.75rem;
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
    .nav-main ul.submenu a {
        padding: 0.55rem 1.25rem;
        font-size: 0.95rem;
        color: var(--text-light);
    }
    .nav-main ul.submenu a:hover {
        color: var(--primary-color);
        background: transparent;
    }
    .nav-main .search-toggle {
        margin: 1rem 1rem 0;
        align-self: center;
        width: 44px;
        height: 44px;
    }

    .header-right .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1001;
        background: rgba(0,0,0,0.4);
        cursor: pointer;
    }
    .nav-check:checked ~ .header-right .nav-overlay {
        display: block;
    }
    body:has(.nav-check:checked) { overflow: hidden; }

    .logo-img { height: 32px; }

    .search-modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .search-modal-input {
        font-size: 1rem;
        padding: 1rem;
    }

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

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

    .card {
        padding: 1rem;
    }

    .info-card {
        padding: 1.5rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo-img { height: 28px; }

    .section h2 {
        font-size: 1.3rem;
    }

    .card h3 {
        font-size: 1.1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    .site-header {
        display: none;
    }

    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
