
:root {
    --bg: #0f172a;
    --bg-elevated: #111827;
    --accent: #06b6d4;
    --accent-soft: rgba(6, 182, 212, 0.12);
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border-subtle: #1f2933;
    --radius-lg: 1.25rem;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.7);
    --shadow-card: 0 14px 35px rgba(15, 23, 42, 0.7);
    --container-width: 960px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1f2937 0, #020617 52%, #000 100%);
    color: var(--text);
    line-height: 1.7;
}

/* Layout */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    padding: 2.5rem 0 3.5rem;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: linear-gradient(to bottom, rgba(15,23,42,0.92), rgba(15,23,42,0.75), transparent);
    border-bottom: 1px solid rgba(15,23,42,0.9);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
}

.logo a {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

    .nav-links a {
        color: var(--text-muted);
        text-decoration: none;
        padding: 0.45rem 0.9rem;
        border-radius: var(--radius-pill);
        border: 1px solid transparent;
        transition: all 0.18s ease-out;
    }

        .nav-links a:hover {
            color: var(--text);
            background: rgba(15,23,42,0.9);
            border-color: rgba(31,41,55,0.9);
        }

        .nav-links a.active {
            color: var(--text);
            background: var(--accent-soft);
            border-color: rgba(56,189,248,0.35);
        }

/* Hero */

.hero {
    padding: 2.5rem 2.25rem 2rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 1.75rem;
    background: radial-gradient(circle at top left, rgba(56,189,248,0.16), transparent 55%), radial-gradient(circle at bottom right, rgba(147,197,253,0.14), transparent 55%), linear-gradient(135deg, #020617 0%, #020617 22%, #020617 55%, #020617 100%);
    border: 1px solid rgba(15,23,42,0.9);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

    /* glow accent */
    .hero::before {
        content: "";
        position: absolute;
        inset: -40%;
        background: radial-gradient(circle at 10% 0%, rgba(56,189,248,0.18), transparent 55%), radial-gradient(circle at 80% 110%, rgba(59,130,246,0.16), transparent 60%);
        opacity: 0.9;
        mix-blend-mode: screen;
        pointer-events: none;
    }

    .hero > * {
        position: relative;
        z-index: 1;
    }

    .hero h1 {
        font-size: clamp(1.9rem, 3vw, 2.2rem);
        margin: 0.6rem 0 0.75rem;
    }

    .hero p {
        margin: 0;
        max-width: 42rem;
        color: var(--text-muted);
        font-size: 0.98rem;
    }

/* Badge */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(56,189,248,0.45);
    background: linear-gradient(to right, rgba(15,23,42,0.9), rgba(15,23,42,0.7));
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

/* Cards */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(2,6,23,0.98));
    border-radius: 1.5rem;
    padding: 1.5rem 1.5rem 1.65rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

    .card h2 {
        font-size: 1.15rem;
        margin: 0 0 0.5rem;
    }

    .card p {
        margin: 0 0 1.25rem;
        color: var(--text-muted);
        font-size: 0.95rem;
    }

/* Article */

.article {
    background: radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(2,6,23,0.98));
    border-radius: 1.75rem;
    padding: 2.25rem 2rem 2.5rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-top: 1.75rem;
}

.article-header h1 {
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
}

.meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.article h2 {
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.article h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
    font-size: 1.02rem;
}

.article p {
    margin: 0.4rem 0;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.article ul,
.article ol {
    margin: 0.4rem 0 0.9rem 1.2rem;
    padding-left: 0.6rem;
    color: var(--text-muted);
    font-size: 0.94rem;
}

/* Buttons */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.35rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(56,189,248,0.65);
    background: radial-gradient(circle at 0 0, rgba(56,189,248,0.3), rgba(8,47,73,1));
    color: #ecfeff;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(8,47,73,0.9);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out;
}

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 18px 40px rgba(8,47,73,1);
        background: radial-gradient(circle at 0 0, rgba(56,189,248,0.42), rgba(8,47,73,1));
    }

/* Related section */

.related {
    margin-top: 2.25rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--border-subtle);
}

    .related ul {
        list-style: none;
        padding-left: 0;
        margin: 0.6rem 0 0;
    }

    .related li {
        margin-bottom: 0.3rem;
    }

    .related a {
        color: #7dd3fc;
        text-decoration: none;
        font-size: 0.93rem;
    }

        .related a:hover {
            text-decoration: underline;
        }

/* Footer */

.site-footer {
    border-top: 1px solid rgba(15,23,42,0.85);
    padding: 1.5rem 0 2.2rem;
    background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.95), #020617 100%);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

    .footer-links a {
        color: var(--text-muted);
        text-decoration: none;
    }

        .footer-links a:hover {
            text-decoration: underline;
        }

/* Responsive */

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 2rem 1.5rem 1.75rem;
    }

    .article {
        padding: 1.75rem 1.4rem 2rem;
    }
}

@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}


/* Extra layout for NejCompany homepage */

.sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stats-section {
    margin-top: 2.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.stat-card {
    padding: 1rem 1.25rem;
    border-radius: 1.1rem;
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(2,6,23,0.98));
    box-shadow: 0 10px 28px rgba(15,23,42,0.85);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 600;
}

.stat-helper {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.3rem;
}

.testimonial {
    padding: 1.3rem 1.4rem;
    border-radius: 1.3rem;
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(2,6,23,0.96));
}

.testimonial-quote {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.testimonial-author {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.testimonial-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cta-section {
    text-align: center;
}

    .cta-section h2 {
        margin-bottom: 0.4rem;
    }

    .cta-section p {
        max-width: 30rem;
        margin-left: auto;
        margin-right: auto;
    }

.badge-new {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    background: rgba(34,197,94,0.16);
    border: 1px solid rgba(34,197,94,0.45);
    color: #bbf7d0;
    margin-left: 0.35rem;
}

/* =========================================================
   Compat outils (Lettre-Bail / Attestations / Simulateurs)
   ========================================================= */

/* Alias pour anciens boutons .btn */
.btn {
    margin: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.35rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(56,189,248,0.65);
    background: radial-gradient(circle at 0 0, rgba(56,189,248,0.3), rgba(8,47,73,1));
    color: #ecfeff;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(8,47,73,0.9);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 18px 40px rgba(8,47,73,1);
        background: radial-gradient(circle at 0 0, rgba(56,189,248,0.42), rgba(8,47,73,1));
        color: #ecfeff;
    }

/* Variante secondaire éventuellement utilisée dans les anciens projets */
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text);
    box-shadow: none;
}

    .btn-secondary:hover {
        background: rgba(15,23,42,0.9);
    }


/* =======================
   Formulaires des outils
   ======================= */

.form-group {
    margin-bottom: 1.4rem;
}

    .form-group label,
    .form-group .form-label {
        display: block;
        margin-bottom: 0.4rem;
        font-size: 0.9rem;
        color: var(--text);
        font-weight: 500;
    }

.input,
.form-control,
select,
textarea,
input[type="text"],
input[type="date"],
input[type="number"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15,23,42,0.9);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
}

    .input:focus,
    .form-control:focus,
    select:focus,
    textarea:focus,
    input[type="text"]:focus,
    input[type="date"]:focus,
    input[type="number"]:focus {
        border-color: rgba(56,189,248,0.8);
        box-shadow: 0 0 0 1px rgba(56,189,248,0.5);
    }


/* ===============================
   Aperçu de lettre / texte généré
   =============================== */

.letter-preview,
pre {
    background: radial-gradient(circle at top left, rgba(15,23,42,0.85), rgba(15,23,42,0.98));
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 1.25rem;
    line-height: 1.6;
    color: var(--text);
    font-size: 0.95rem;
    overflow-x: auto;
}


/* ==========================================
   Champs avec unité (€, %, m²…) pour simu
   ========================================== */

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-with-unit .with-unit {
        width: 100%;
        padding-right: 4.5rem; /* laisse de la place pour l'unité à droite */
    }

    /* Unité (€, %, etc.) */
    .input-with-unit .unit {
        position: absolute;
        right: 1.2rem;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        font-size: 0.9rem;
        color: var(--text-muted);
        font-weight: 600;
    }

    /* suppression des flèches number (Chrome / Edge / Safari) */
    .input-with-unit input[type="number"]::-webkit-outer-spin-button,
    .input-with-unit input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* suppression des flèches number (Firefox) */
    .input-with-unit input[type="number"] {
        -moz-appearance: textfield;
    }


/* ==========================
   Blocs recherche / catégories
   (listes de modèles, simu, etc.)
   ========================== */

.search-card {
    margin-bottom: 2rem;
}

.search-form .search-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.75rem;
}

.search-input {
    flex: 1;
    min-width: 220px;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148,163,184,0.5);
    background: rgba(15,23,42,0.95);
    color: var(--text);
    font-size: 0.95rem;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    background: rgba(15,23,42,0.95);
}

    .chip:hover {
        color: var(--text);
        border-color: rgba(56,189,248,0.7);
    }

.chip-active {
    background: rgba(56,189,248,0.2);
    color: var(--text);
    border-color: rgba(56,189,248,0.9);
}

.category-block {
    margin-bottom: 2.5rem;
}

.category-title {
    margin-bottom: 0.25rem;
}

.category-subtitle {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.inline-form {
    display: inline-block;
    margin-right: 0.5rem;
}

/* Petit conteneur pour un bouton "Retour à l'accueil" utilisé dans certains écrans */
.back-button-container {
    margin-bottom: 0.8rem;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 0.75rem;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.4);
    color: var(--text);
    font-size: 0.9rem;
    text-decoration: none;
    transition: 0.18s ease;
}

    .btn-back-home:hover {
        background: rgba(15,23,42,1);
        border-color: rgba(56,189,248,0.7);
        transform: translateY(-1px);
    }


/* Fil d’Ariane (breadcrumb) pour les outils */
.breadcrumb {
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: #7dd3fc;
    text-decoration: none;
}

    .breadcrumb-item a:hover {
        text-decoration: underline;
    }

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--text-muted);
    margin: 0 0.35rem 0 0.15rem;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}


.m3u-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .m3u-layout {
        grid-template-columns: 1fr;
    }
}

.m3u-logo {
    height: 24px;
    width: auto;
    margin-right: 0.5rem;
    vertical-align: middle;
    border-radius: 4px;
}

.m3u-player {
    position: sticky;
    top: 1rem;
    align-self: flex-start;
}

.url-cell {
    max-width: 260px;
    word-break: break-all;
    font-size: 0.85rem;
}

.card textarea {
    width: 100%;
    font-family: monospace;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.3);
    color: inherit;
    border-radius: 8px;
    padding: 0.75rem;
    resize: vertical;
}

/* Bouton hamburger - caché par défaut (desktop) */
.nav-toggle {
    display: none !important;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle-line {
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}


    .nav-toggle-line + .nav-toggle-line {
        margin-top: 4px;
    }

/* État ouvert (classe ajoutée sur le bouton via JS) */
.nav-toggle.nav-open .nav-toggle-line:first-child {
    transform: translateY(3px) rotate(45deg);
}

.nav-toggle.nav-open .nav-toggle-line:last-child {
    transform: translateY(-3px) rotate(-45deg);
}

/* Mobile */
@media (max-width: 768px) {

    .header-inner {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        left: 0;
        right: 0;
        top: 60px; /* adapte si ton header est plus haut/bas */
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem 1rem;
        background: radial-gradient(circle at top, #020617 0%, #020617 55%, #020617 100%);
        border-bottom: 1px solid rgba(148, 163, 184, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
        z-index: 40;
    }

        .nav-links a {
            width: 100%;
            padding: 0.35rem 0;
        }

    /* Quand le body a la classe nav-open, on affiche le menu */
    body.nav-open .nav-links {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
    }

    .nav-links a {
        display: block;
        padding: 0.6rem 0;
        border: none; /* on supprime la bordure pour tous les liens */
        outline: none;
    }

        .nav-links a.active {
            background: none;
            border: none; /* très important */
            border-radius: 0;
            color: var(--text);
            font-weight: 600; /* petit highlight propre */
        }

        .nav-links a:focus {
            outline: none;
        }
}

