/* =====================================================================
   SWEET SERVICE CAMEROUN — Design system
   Palette : grille électrique nocturne + étincelle ambre + vert de confiance
   Typo : Sora (titres) / Inter (texte courant)
   ===================================================================== */

:root {
    --ink: #0E1A2B;
    --ink-light: #172A44;
    --spark: #F6A623;
    --spark-dark: #D98C12;
    --signal: #1E8A6E;
    --paper: #F7F5F0;
    --paper-dim: #EFECE3;
    --white: #FFFFFF;
    --text: #1C1F26;
    --text-muted: #5B6472;
    --danger: #C4432B;
    --border: #E4E0D5;

    --font-display: 'Sora', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --radius-s: 6px;
    --radius-m: 12px;
    --shadow: 0 8px 24px rgba(14, 26, 43, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--paper);
    line-height: 1.55;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0 0 .5em; line-height: 1.15; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--ink); text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- Header ---------- */
.site-header {
    background: var(--ink);
    position: sticky; top: 0; z-index: 40;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--white); }
.brand__mark { color: var(--spark); font-size: 1.3rem; }
.brand__text em { font-style: normal; color: var(--spark); }
.brand--admin { padding: 20px; display: flex; }

.nav-toggle { display: flex; flex-direction: column; gap: 4px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--white); display: block; }

.site-nav {
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--ink);
    display: flex; flex-direction: column; padding: 12px 20px 40px;
    transform: translateY(-110%);
    transition: transform .25s ease;
    z-index: 39;
}
.site-nav.open { transform: translateY(0); }
.site-nav a { color: rgba(255,255,255,.85); padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-weight: 500; }
.site-nav .nav-cta { color: var(--spark); font-weight: 700; }

.lang-switch { display: flex; align-items: center; gap: 6px; padding: 14px 0; color: rgba(255,255,255,.5); font-size: .85rem; }
.lang-switch a { padding: 0; border: 0; font-weight: 600; color: rgba(255,255,255,.6); }
.lang-switch a.lang-switch__active { color: var(--spark); }

@media (min-width: 900px) {
    .nav-toggle { display: none; }
    .site-nav {
        position: static; transform: none; flex-direction: row; align-items: center;
        padding: 0; background: none; gap: 22px;
    }
    .site-nav a { border: 0; padding: 8px 0; color: rgba(255,255,255,.8); }
    .site-nav a:hover { color: var(--white); }
    .site-nav .nav-cta {
        background: var(--spark); color: var(--ink) !important; padding: 8px 16px; border-radius: 999px; font-weight: 700;
    }
}

/* ---------- Alerts ---------- */
.alert { padding: 14px 16px; border-radius: var(--radius-s); margin: 16px 0; font-weight: 500; }
.alert--success { background: #E4F5EF; color: #14543F; border: 1px solid #BEE3D5; }
.alert--error { background: #FBEAE6; color: var(--danger); border: 1px solid #F3CCC2; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 22px; border-radius: var(--radius-s); font-weight: 600; font-size: .96rem;
    border: 2px solid transparent; cursor: pointer; font-family: var(--font-body);
}
.btn-primary { background: var(--spark); color: var(--ink); }
.btn-primary:hover { background: var(--spark-dark); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline--light { border-color: rgba(255,255,255,.5); color: var(--white); }
.btn-success { background: var(--signal); color: var(--white); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* ---------- Hero ---------- */
.hero {
    background: var(--ink);
    color: var(--white);
    padding: 52px 0 64px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(246,166,35,.25), transparent 70%);
}
.hero__eyebrow { color: var(--spark); font-weight: 600; letter-spacing: .02em; margin-bottom: 10px; }
.hero h1 { color: var(--white); font-size: 2rem; max-width: 16ch; }
.hero p { color: rgba(255,255,255,.75); font-size: 1.05rem; }

.search-box {
    background: var(--white); border-radius: var(--radius-m); padding: 6px;
    display: flex; gap: 6px; max-width: 520px; margin-top: 24px; box-shadow: var(--shadow);
}
.search-box input {
    flex: 1; border: 0; padding: 12px 14px; font-size: 1rem; font-family: var(--font-body); border-radius: var(--radius-s);
}
.search-box input:focus { outline: none; }
.search-box button { border-radius: var(--radius-s); }

.hero__actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Category chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    color: var(--white); padding: 9px 16px; border-radius: 999px; font-size: .88rem; font-weight: 500;
}
.chip--soon { opacity: .55; }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section--muted { background: var(--paper-dim); }
.section__head { margin-bottom: 28px; }
.section__head p { color: var(--text-muted); }

/* ---------- Service list (not identical cards — left-accent list style) ---------- */
.service-list { display: flex; flex-direction: column; gap: 14px; }
.service-row {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--spark);
    border-radius: var(--radius-s); padding: 18px;
}
.service-row__icon {
    width: 42px; height: 42px; border-radius: 10px; background: var(--paper-dim);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.service-row__body { flex: 1; }
.service-row__body h3 { font-size: 1.05rem; margin-bottom: 4px; }
.service-row__body p { margin-bottom: 8px; color: var(--text-muted); font-size: .93rem; }
.tag { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tag--free { background: #E4F5EF; color: #14543F; }
.tag--paid { background: #FDF1DC; color: #8A5A0A; }

/* ---------- Category tiles ---------- */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 700px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
.category-tile {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-s);
    padding: 20px 16px; text-align: left;
}
.category-tile__icon { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.category-tile h3 { font-size: 1rem; margin-bottom: 4px; }
.category-tile span.soon { font-size: .78rem; color: var(--text-muted); font-weight: 600; }

/* ---------- Steps / procedures (real sequence -> numbering is justified) ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
    counter-increment: step;
    display: grid; grid-template-columns: 40px 1fr; gap: 14px;
    padding: 16px 0; border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
    content: counter(step);
    width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--spark);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700;
}
.steps h4 { margin-bottom: 3px; font-size: 1rem; }
.steps .meta { font-size: .82rem; color: var(--text-muted); }

/* ---------- Étapes horizontales (procédures) ---------- */
.steps-horizontal {
    list-style: none; margin: 0; padding: 8px 0 4px; counter-reset: hstep;
    display: flex; flex-direction: column; gap: 0;
}
.steps-horizontal li {
    counter-increment: hstep;
    position: relative; padding: 0 0 28px 52px; flex: 1;
}
.steps-horizontal li::before {
    content: counter(hstep);
    position: absolute; left: 0; top: 0;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--ink); color: var(--spark);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: .95rem; z-index: 1;
}
.steps-horizontal li::after {
    content: ''; position: absolute; left: 17px; top: 36px; bottom: 0;
    width: 2px; background: var(--border);
}
.steps-horizontal li:last-child::after { display: none; }
.steps-horizontal .step-label {
    display: block; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
    color: var(--spark-dark); font-weight: 700; margin-bottom: 2px;
}
.steps-horizontal h4 { margin: 0 0 4px; font-size: 1rem; }
.steps-horizontal .meta { font-size: .82rem; color: var(--text-muted); }

@media (min-width: 900px) {
    .steps-horizontal { flex-direction: row; align-items: flex-start; gap: 8px; }
    .steps-horizontal li { padding: 44px 16px 0 0; }
    .steps-horizontal li::before { left: 0; top: 0; }
    .steps-horizontal li::after {
        left: 36px; top: 17px; right: 0; bottom: auto; width: auto; height: 2px;
    }
    .steps-horizontal li:last-child { padding-right: 0; }
}

/* ---------- Contacts ---------- */
.contact-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-s);
    padding: 16px; margin-bottom: 10px;
}
.contact-card strong { display: block; margin-bottom: 4px; }

/* ---------- Documents list ---------- */
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.doc-list li:last-child { border-bottom: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; max-width: 560px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-s);
    font-family: var(--font-body); font-size: 1rem; background: var(--white);
}
.field textarea { min-height: 110px; resize: vertical; }
.field-hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 24px; max-width: 480px; margin: 0 auto; }

/* ---------- Status badges ---------- */
.status { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .01em; }
.status-NEW, .status-IN_REVIEW { background: #FDF1DC; color: #8A5A0A; }
.status-DOCUMENTS_REQUIRED, .status-DOCUMENTS_VERIFIED { background: #E7EEFB; color: #24467C; }
.status-QUOTE_SENT, .status-QUOTE_ACCEPTED { background: #F0E8FB; color: #5A2E9C; }
.status-PROCESSING, .status-SUBMITTED { background: #FFF3D6; color: #8A6300; }
.status-COMPLETED { background: #E4F5EF; color: #14543F; }
.status-CANCELLED, .status-REJECTED { background: #FBEAE6; color: var(--danger); }

/* ---------- Dashboard ---------- */
.app-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-s);
    padding: 16px; margin-bottom: 10px;
}
.app-row__ref { font-family: var(--font-display); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 44px 0 0; margin-top: 60px; }
.site-footer h4 { color: var(--white); font-size: .95rem; }
.site-footer a { color: rgba(255,255,255,.7); display: block; margin-bottom: 8px; font-size: .92rem; }
.site-footer__grid { display: grid; gap: 28px; grid-template-columns: 1fr; padding-bottom: 30px; }
@media (min-width: 760px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.brand__text--light { color: var(--white); }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; font-size: .8rem; }

/* ---------- Table (used in admin, kept here for reuse) ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--white); }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.table th { color: var(--text-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

.badge-count { font-family: var(--font-display); font-size: 2rem; color: var(--ink); }
.small-muted { color: var(--text-muted); font-size: .85rem; }

/* =====================================================================
   V3 — composants ajoutés (messagerie, checklist documents, devis, légal…)
   ===================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--spark); color: var(--ink); padding: 8px 14px; border-radius: var(--radius-s); z-index: 100; font-weight: 700; }
.skip-link:focus { left: 8px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.nav-badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: var(--white); font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.5; vertical-align: middle; }
.app-row { color: inherit; }

.search-box--light { background: var(--white); border: 1px solid var(--border); max-width: 640px; }
.search-box--light input { color: var(--text); }
.category-tile--soon { opacity: .6; }
.soon--on { color: var(--signal) !important; }
.empty-state { background: var(--white); border: 1px dashed var(--border); border-radius: var(--radius-m); padding: 24px; text-align: center; }
.empty-state p { margin: 0 auto 14px; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.section-title-row h2 { margin: 0; }
.contact-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }

.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.checkbox input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--signal); }

/* Fiche dossier */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0 0; }
.facts dt { color: var(--text-muted); font-size: .88rem; }
.facts dd { margin: 0; font-weight: 500; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 8px; } }
.status-help { color: var(--text-muted); margin-top: -4px; }

.doc-card { border-left: 4px solid var(--border); }
.doc-card--missing { border-left-color: var(--spark); }
.doc-card--pending { border-left-color: #24467C; }
.doc-card--approved { border-left-color: var(--signal); }
.doc-card--rejected { border-left-color: var(--danger); }
.doc-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.doc-card__head strong { margin: 0; }
.doc-status { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.doc-status--pending { background: #E7EEFB; color: #24467C; }
.doc-status--approved { background: #E4F5EF; color: #14543F; }
.doc-status--rejected { background: #FBEAE6; color: var(--danger); }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
.upload-form input[type=file] { max-width: 100%; font-size: .88rem; }
.upload-form .field-hint { margin: 0; }

.quote-status { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--paper-dim); }
.quote-status--sent { background: #F0E8FB; color: #5A2E9C; }
.quote-status--accepted { background: #E4F5EF; color: #14543F; }
.quote-status--rejected, .quote-status--expired { background: #FBEAE6; color: var(--danger); }
.quote-table { width: 100%; max-width: 420px; border-collapse: collapse; margin: 10px 0; }
.quote-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.quote-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.quote-table__total td { font-weight: 700; border-bottom: 0; font-size: 1.05rem; }

/* Messagerie */
.thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; max-height: 480px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--white); border: 1px solid var(--border); font-size: .94rem; overflow-wrap: anywhere; }
.bubble--mine { align-self: flex-end; background: #FFF3D6; border-color: #F3DDA6; border-bottom-right-radius: 4px; }
.bubble--theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble__meta { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.thread-form { display: flex; flex-direction: column; gap: 8px; }
.thread-form textarea { width: 100%; min-height: 80px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-s); font: inherit; resize: vertical; }
.thread-form .btn { align-self: flex-end; }

.notif--new { border-left: 4px solid var(--spark); }
.notif .tag { margin-left: 6px; }

/* FAQ & pages légales */
.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 0 18px; margin-bottom: 10px; }
.faq-item summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-family: var(--font-display); }
.faq-item p { margin: 0 0 16px; }
.legal h2 { margin-top: 28px; font-size: 1.2rem; }
.legal ul { padding-left: 20px; max-width: 68ch; }
.legal li { margin-bottom: 6px; }

.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.pagination__gap { color: var(--text-muted); padding: 0 4px; }

/* =====================================================================
   V4 — référencement : fil d'Ariane, en-tête de service, FAQ
   ===================================================================== */
.breadcrumb { padding-top: 16px; font-size: .85rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.breadcrumb li { color: var(--text-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.section--tight-top { padding-top: 20px; }
.service-hero { display: flex; gap: 16px; align-items: flex-start; }
.service-hero__icon { font-size: 2.2rem; line-height: 1; margin-top: 4px; }
.lead { font-size: 1.08rem; color: var(--text-muted); }
.step-title { font-size: 1rem; margin-bottom: .4em; }
.faq-item summary { list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q { display: inline; font-size: 1rem; margin: 0; }
.faq-item summary::after { content: "+"; float: right; color: var(--text-muted); font-weight: 400; }
.faq-item[open] summary::after { content: "–"; }

/* Déconnexion (formulaire POST présenté comme un lien de menu) */
.nav-logout { margin: 0; }
.nav-logout button { background: none; border: 0; padding: 14px 0; font: inherit; font-weight: 500; color: rgba(255,255,255,.85); cursor: pointer; text-align: left; width: 100%; border-bottom: 1px solid rgba(255,255,255,.08); }
@media (min-width: 900px) { .nav-logout button { padding: 8px 0; border: 0; width: auto; color: rgba(255,255,255,.8); } .nav-logout button:hover { color: var(--white); } }
