/* ==================================================================
   Annuaire IA / Digital Marrakech — design system v2
   Palette : bleu Majorelle (nuit) + terre cuite + sable de la médina.
   Typo    : Bricolage Grotesque (titres) + Figtree (texte).
   ================================================================== */
:root {
    --bg: #F7F1E8;
    --surface: #FFFFFF;
    --ink: #1B1B33;
    --muted: #6A6577;
    --line: #E7DDCC;
    --primary: #263A99;
    --primary-dark: #182770;
    --primary-soft: #E8EBF9;
    --deep: #121A4A;
    --accent: #BE4B23;
    --accent-dark: #973A19;
    --accent-soft: #FBEADF;
    --gold: #E9A93B;
    --ok-bg: #E3F4EA;  --ok: #15703F;
    --err-bg: #FCE8E8; --err: #B42318;
    --info-bg: #E8EBF9; --info: #263A99;

    --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
    --shadow-pop: 0 12px 32px rgba(18, 26, 74, .18), 0 2px 6px rgba(18, 26, 74, .08);
    --header-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.55;
    background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--primary); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.container { max-width: 1120px; margin: 0 auto; padding: 36px 24px 72px; }
.container-narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------
   Header : logo — recherche globale — actions + menu ⋮
   ------------------------------------------------------------------ */
.site-header {
    position: sticky; top: 0; z-index: 50; background: rgba(255,253,249,.94);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.header-inner {
    max-width: 1280px; margin: 0 auto; height: var(--header-h); padding: 0 24px;
    display: flex; align-items: center; gap: 20px;
}
.logo {
    display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
    font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; white-space: nowrap;
}
.logo-mark {
    width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff;
    display: grid; place-items: center; font-size: 1rem;
}
.logo small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .7rem; color: var(--muted); margin-top: -3px; }

.header-search {
    flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center;
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px 0 16px;
}
.header-search:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.header-search input { flex: 1; border: 0; background: transparent; padding: 10px 8px; font: inherit; font-size: .95rem; min-width: 0; outline: none; color: var(--ink); }
.header-search button { border: 0; background: var(--primary); color: #fff; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.header-search button:hover { background: var(--primary-dark); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-search + .header-actions { margin-left: 0; }

.avatar {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--primary-soft);
    color: var(--primary-dark); display: inline-grid; place-items: center; font-weight: 700; font-size: .9rem;
    font-family: var(--font-display); flex: none;
}
.avatar-lg { width: 96px; height: 96px; font-size: 1.9rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }

.kebab { position: relative; }
.kebab-btn {
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
    cursor: pointer; display: grid; place-items: center; color: var(--ink); font-size: 1.35rem; line-height: 1;
}
.kebab-btn:hover, .kebab-btn[aria-expanded="true"] { background: var(--primary-soft); border-color: var(--primary); }
.kebab-menu {
    position: absolute; right: 0; top: calc(100% + 10px); min-width: 270px; background: #fff;
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 8px;
    display: none; transform-origin: top right;
}
.kebab-menu.open { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-user { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-user strong { display: block; line-height: 1.2; }
.menu-user span { font-size: .8rem; color: var(--muted); word-break: break-all; }
.menu-item, .menu-form button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 9px;
    color: var(--ink); text-decoration: none; font: inherit; font-size: .94rem; background: none; border: 0;
    cursor: pointer; text-align: left;
}
.menu-item:hover, .menu-form button:hover { background: var(--bg); }
.menu-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.menu-ico { width: 22px; text-align: center; color: var(--primary); flex: none; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-label { font-size: .75rem; color: var(--muted); padding: 8px 12px 4px; font-weight: 600; }
.menu-danger, .menu-danger .menu-ico { color: var(--err); }

@media (max-width: 860px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
    .header-search { order: 3; flex-basis: 100%; max-width: none; }
    .header-actions { margin-left: auto; }
    .logo small { display: none; }
    html { scroll-padding-top: 130px; }
    .hide-sm { display: none !important; }
}

/* ------------------------------------------------------------------
   Boutons / formulaires
   ------------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px;
    border-radius: 10px; border: 1.5px solid transparent; font: inherit; font-size: .95rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-danger { background: #fff; color: var(--err); border-color: #F1C0BC; }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: 7px 13px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-linkedin { background: #0A66C2; color: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .88rem; font-weight: 600; }
.field .hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url],
input[type=search], select, textarea {
    width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
    font: inherit; font-size: .95rem; color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=file] { font: inherit; font-size: .9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; margin-bottom: 16px; }
.check input { margin-top: 4px; accent-color: var(--primary); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .row-2 { grid-template-columns: 1fr; } }

/* Flash */
.flash-wrap { margin-bottom: 22px; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 10px; font-size: .92rem; display: flex; justify-content: space-between; gap: 12px; }
.flash button { background: none; border: 0; cursor: pointer; font-size: 1.1rem; color: inherit; opacity: .6; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--info-bg); color: var(--info); }

/* ------------------------------------------------------------------
   Accueil
   ------------------------------------------------------------------ */
.hero {
    background-color: var(--deep); color: #fff; position: relative; overflow: hidden;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23E9A93B' stroke-opacity='.16' stroke-width='1.2'%3E%3Cpath d='M36 4 L44 28 L68 36 L44 44 L36 68 L28 44 L4 36 L28 28 Z'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
    max-width: 1120px; margin: 0 auto; padding: 64px 24px 72px; display: grid;
    grid-template-columns: 1.25fr .75fr; gap: 48px; align-items: center;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 700; margin-bottom: 16px; max-width: 16ch; }
.hero p.lead { color: #C9CFF0; font-size: 1.08rem; max-width: 52ch; margin-bottom: 28px; }
.hero-search {
    background: #fff; border-radius: 16px; padding: 8px; display: flex; gap: 8px; flex-wrap: wrap;
    box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.hero-search input[type=search] { flex: 2; min-width: 200px; border: 0; padding: 14px 16px; font-size: 1.02rem; }
.hero-search select { flex: 1; min-width: 160px; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 14px; }
.hero-search input:focus, .hero-search select:focus { box-shadow: none; }
.hero-search .btn { padding: 14px 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
    border: 1px solid rgba(255,255,255,.25); color: #E8EAF8; text-decoration: none; padding: 6px 14px;
    border-radius: 999px; font-size: .85rem;
}
.chip:hover { background: rgba(255,255,255,.12); }

.cv-mock { position: relative; justify-self: center; width: 100%; max-width: 330px; }
.cv-sheet {
    background: #fff; color: var(--ink); border-radius: 6px; padding: 22px 22px 26px;
    box-shadow: 0 24px 50px rgba(0,0,0,.35); transform: rotate(2.5deg);
}
.cv-sheet .mk-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.cv-sheet .mk-title { color: var(--primary); font-size: .8rem; margin-bottom: 14px; }
.mk-line { height: 7px; background: var(--line); border-radius: 4px; margin: 7px 0; }
.mk-line.s { width: 60%; } .mk-line.m { width: 82%; }
.mk-h { height: 8px; width: 38%; background: var(--primary); border-radius: 4px; margin: 16px 0 8px; }
.cv-tag {
    position: absolute; left: -22px; bottom: 30px; background: var(--accent); color: #fff; padding: 10px 14px;
    border-radius: 12px; font-size: .82rem; font-weight: 600; box-shadow: 0 10px 24px rgba(0,0,0,.3);
    transform: rotate(-3deg); max-width: 230px;
}
@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; padding: 44px 20px 52px; }
    .cv-mock { display: none; }
}

.stat-strip { background: #fff; border-bottom: 1px solid var(--line); }
.stat-strip-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; }
.stat { padding: 18px 36px 18px 0; margin-right: 36px; display: flex; align-items: baseline; gap: 10px; }
.stat-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: .9rem; }

.section { margin-top: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.5rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; position: relative; }
.step::before {
    counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark); font-family: var(--font-display); font-weight: 700;
    display: grid; place-items: center; margin-bottom: 14px;
}
.step:nth-child(2)::before { background: var(--accent-soft); color: var(--accent-dark); }
.step p { color: var(--muted); margin: 0; font-size: .94rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sector-tile {
    --accent: var(--primary); display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
    text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem;
}
.sector-tile:hover { border-color: var(--accent); }
.sector-tile .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.sector-tile .n { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

.cta-band {
    margin-top: 64px; background: var(--primary); color: #fff; border-radius: 20px; padding: 40px 44px;
    display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin: 0 0 6px; font-size: 1.6rem; }
.cta-band p { margin: 0; color: #D5DAF5; }

/* ------------------------------------------------------------------
   Cartes entreprises + annuaire
   ------------------------------------------------------------------ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card {
    --accent: var(--primary); background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 20px 20px 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column;
    border-top: 4px solid var(--accent); transition: border-color .12s, box-shadow .12s;
}
.card:hover { box-shadow: 0 8px 22px rgba(18,26,74,.1); border-color: var(--accent); }
.card-sector { font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.card-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 650; margin: 0 0 6px; }
.card-address { color: var(--muted); font-size: .87rem; margin: 0 0 14px; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; }
.rating { color: #A9650C; font-weight: 700; }
.rating small { color: var(--muted); font-weight: 400; }
.card-links { color: var(--muted); font-size: .8rem; }

.filters {
    display: flex; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; padding: 12px; margin: 22px 0 8px;
}
.filters input[type=search] { flex: 2; min-width: 200px; }
.filters select { flex: 1; min-width: 150px; }
.result-bar { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin: 14px 0; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; grid-column: 1 / -1; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 38px; height: 38px; padding: 0 12px; display: grid; place-items: center; border-radius: 9px;
    border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-size: .9rem;
}
.pagination a:hover { border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* ------------------------------------------------------------------
   Détail entreprise
   ------------------------------------------------------------------ */
.back-link { display: inline-block; margin-bottom: 18px; text-decoration: none; font-size: .92rem; font-weight: 600; }
.detail-header {
    --accent: var(--primary); background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--accent);
    border-radius: 14px; padding: 24px 28px; margin-bottom: 28px;
}
.detail-header h1 { margin: 4px 0 6px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.12rem; }
.contact-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.contact-list li { display: flex; gap: 12px; align-items: baseline; word-break: break-word; }
.contact-list .ico { color: var(--primary); width: 20px; text-align: center; flex: none; }
.contact-list a { text-decoration: none; font-weight: 500; }
.contact-list a:hover { text-decoration: underline; }
.map-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-top: 16px; }
.map-wrap iframe { display: block; border: 0; }

.ai-callout {
    background: linear-gradient(135deg, var(--primary-soft), #fff 70%); border: 1.5px solid #C5CCF0;
    border-radius: 14px; padding: 18px 20px; margin-bottom: 20px;
}
.ai-callout h3 { margin-bottom: 4px; }
.ai-callout p { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card input { margin-top: 4px; accent-color: var(--primary); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--primary-soft); color: var(--primary-dark); }
.badge-ia { background: var(--accent-soft); color: var(--accent-dark); }
.badge-Envoyée { background: var(--info-bg); color: var(--info); }
.badge-Relancée { background: #FFF3D6; color: #8A5A00; }
.badge-Entretien { background: #EADCFB; color: #5B2BB0; }
.badge-Acceptée { background: var(--ok-bg); color: var(--ok); }
.badge-Refusée { background: var(--err-bg); color: var(--err); }

/* ------------------------------------------------------------------
   Authentification
   ------------------------------------------------------------------ */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--header-h) - 80px); gap: 0; max-width: 980px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.auth-side { background: var(--deep); color: #fff; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h2 { color: #fff; font-size: 1.7rem; }
.auth-side ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; color: #C9CFF0; }
.auth-side li::before { content: "✓"; color: var(--gold); margin-right: 10px; font-weight: 700; }
.auth-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 1.7rem; }
.auth-alt { text-align: center; margin-top: 18px; font-size: .92rem; color: var(--muted); }
@media (max-width: 760px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-form { padding: 28px 22px; } }

/* ------------------------------------------------------------------
   Dashboard / profil / listes
   ------------------------------------------------------------------ */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; }
.greet { display: flex; align-items: center; gap: 16px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.kpi-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.1; display: block; }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi.kpi-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.kpi.kpi-primary .kpi-label { color: #D5DAF5; }
.kpi.kpi-accent .kpi-num { color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-2e { grid-template-columns: 1fr; } }

.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 10px 0 12px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #5C73E0); border-radius: 999px; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { text-decoration: none; font-weight: 600; color: var(--ink); }
.mini-list a:hover { color: var(--primary); }

.profile-grid { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-side { position: sticky; top: calc(var(--header-h) + 20px); text-align: center; }
@media (max-width: 900px) { .profile-side { position: static; } }
.profile-side .avatar { margin: 0 auto 12px; }
.fieldset-title { font-family: var(--font-display); font-weight: 650; font-size: 1.1rem; margin: 0 0 4px; }
.fieldset-sub { color: var(--muted); font-size: .86rem; margin-bottom: 14px; }
.example { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: .8rem; color: var(--muted); white-space: pre-line; margin-top: 4px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 20px 22px; }
.timeline li::before {
    content: attr(data-ico); position: absolute; left: -35px; top: -2px; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-size: .8rem; font-weight: 700; border: 2px solid var(--bg);
}
.timeline li.t-apply::before, .timeline li.t-cv_generated::before { background: var(--accent-soft); color: var(--accent-dark); }
.timeline li.t-login_failed::before { background: var(--err-bg); color: var(--err); }
.timeline .t-title { font-weight: 600; }
.timeline .t-time { color: var(--muted); font-size: .8rem; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-size: .87rem; }
.tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--bg); font-family: var(--font-display); font-weight: 650; font-size: .82rem; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form select { padding: 6px 8px; font-size: .84rem; width: auto; }

/* ------------------------------------------------------------------
   CV (aperçu) + builder
   ------------------------------------------------------------------ */
.cv-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .cv-layout { grid-template-columns: 1fr; } }
.cv-paper {
    background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 40px 44px;
    box-shadow: 0 10px 30px rgba(18,26,74,.08); font-size: .93rem;
}
.cv-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.cv-name { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin: 0; }
.cv-role { color: var(--primary); font-size: 1.05rem; margin: 2px 0 6px; }
.cv-contact { color: var(--muted); font-size: .85rem; }
.cv-photo { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex: none; }
.cv-section h3 { color: var(--primary); font-size: .95rem; border-bottom: 1.5px solid var(--primary); padding-bottom: 3px; margin: 22px 0 10px; }
.cv-item { margin-bottom: 10px; }
.cv-item .meta { color: var(--muted); font-size: .84rem; }
.cv-item ul { margin: 4px 0 0; padding-left: 18px; }
.cv-skill { display: grid; grid-template-columns: 150px 1fr; gap: 10px; margin-bottom: 4px; }
@media (max-width: 560px) { .cv-paper { padding: 24px 20px; } .cv-skill { grid-template-columns: 1fr; gap: 0; } }
.letter { white-space: pre-wrap; line-height: 1.65; font-size: .95rem; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tips li { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.mode-note { font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------------
   Statistiques / admin
   ------------------------------------------------------------------ */
.chart-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 860px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.chart-card h2 { font-size: 1.02rem; margin-bottom: 14px; }
.chart-box { position: relative; height: 280px; }
.leaderboard { list-style: none; padding: 0; margin: 0; }
.leaderboard li { border-bottom: 1px solid var(--line); }
.leaderboard li:last-child { border-bottom: 0; }
.leaderboard-item { display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 14px; padding: 12px 0; text-decoration: none; color: var(--ink); }
.leaderboard-rank { font-family: var(--font-display); color: var(--muted); font-weight: 700; }
.leaderboard-name { font-weight: 600; }
.leaderboard-sector { font-size: .78rem; font-weight: 700; text-align: right; }
@media (max-width: 640px) { .leaderboard-item { grid-template-columns: 24px 1fr auto; } .leaderboard-sector { display: none; } }

.error-page { text-align: center; padding: 70px 0; }
.error-code { font-family: var(--font-display); font-size: 5rem; font-weight: 700; color: var(--primary); line-height: 1; }

.site-footer { background: var(--deep); color: #A9AFD6; margin-top: 40px; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 32px 24px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .87rem; }
.footer-inner a { color: #DDE1F5; text-decoration: none; margin-right: 18px; }
.footer-inner a:hover { text-decoration: underline; }

@media print {
    .site-header, .site-footer, .no-print, .flash-wrap { display: none !important; }
    body { background: #fff; }
    .container { padding: 0; max-width: none; }
    .cv-layout { display: block; }
    .cv-paper { border: 0; box-shadow: none; padding: 0; }
}

/* ==================================================================
   Finitions v2
   ================================================================== */
.logo-mark { background: linear-gradient(135deg, var(--primary), var(--deep)); box-shadow: 0 2px 8px rgba(38,58,153,.35); }
.logo-mark { color: var(--gold); }
.site-header { border-bottom-color: var(--line); }

.hero {
    background-image:
        radial-gradient(900px 420px at 85% -10%, rgba(233,169,59,.22), transparent 60%),
        radial-gradient(700px 380px at 0% 110%, rgba(190,75,35,.28), transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23E9A93B' stroke-opacity='.16' stroke-width='1.2'%3E%3Cpath d='M36 4 L44 28 L68 36 L44 44 L36 68 L28 44 L4 36 L28 28 Z'/%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 { text-wrap: balance; }
.hero-search { border: 1px solid rgba(233,169,59,.35); }
.hero-search .btn-accent { box-shadow: 0 6px 16px rgba(190,75,35,.35); }

.card, .step, .sector-tile, .panel, .kpi, .chart-card { box-shadow: 0 1px 2px rgba(18,26,74,.04); }
.card { transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(18,26,74,.12); }
.sector-tile { transition: transform .12s, border-color .12s, box-shadow .12s; }
.sector-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(18,26,74,.08); }

.btn-primary { box-shadow: 0 2px 6px rgba(38,58,153,.28); }
.btn-accent  { box-shadow: 0 2px 6px rgba(190,75,35,.28); }

.cta-band {
    background:
        radial-gradient(500px 220px at 100% 0%, rgba(233,169,59,.25), transparent 60%),
        linear-gradient(120deg, var(--primary), var(--deep));
}
.stat-strip { background: #FFFDF9; }
.stat-num { color: var(--primary); }
.kpi.kpi-primary { background: linear-gradient(135deg, var(--primary), var(--deep)); }
.table th { background: #FBF6EC; }
.error-code { color: var(--accent); }
.site-footer { border-top: 4px solid var(--gold); }

/* Impression : le CV reste sobre, noir sur blanc */
@media print {
    .cv-section h3 { color: #000; border-bottom-color: #000; }
    .cv-role { color: #000; }
}

/* ==================================================================
   Organisation v2.1 — rythme vertical, états vides, cartes alignées
   ================================================================== */

/* Colonnes du dashboard : espacement régulier entre blocs (plus de blocs collés) */
.grid-2 > div, .grid-2e > div { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.grid-2 > div > .panel + .panel,
.grid-2e > div > .panel + .panel { margin-top: 0; }
.grid-2 > div > .section { margin-top: 12px !important; }

/* En-têtes de page et de section */
.page-head { margin-bottom: 28px; }
.greet h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); overflow-wrap: anywhere; }
.greet p { margin: 2px 0 0; }
.section-head h2::before {
    content: ""; display: inline-block; width: 4px; height: .95em; border-radius: 2px;
    background: var(--accent); margin-right: 10px; vertical-align: -.1em;
}
.panel .section-head h2 { font-size: 1.12rem; }

/* KPI : chiffre au-dessus, libellé en dessous, hauteur régulière */
.kpi { display: flex; flex-direction: column; gap: 4px; justify-content: center; min-height: 96px; }
.kpi-num { font-size: 2.1rem; }

/* États vides : bloc discret au lieu de texte coupé en deux */
.mini-list li.muted {
    display: block; line-height: 1.55; padding: 14px 16px; background: #FBF6EC;
    border: 1px dashed var(--line); border-radius: 10px;
}
.mini-list li.muted a { display: inline; color: var(--primary); font-weight: 600; text-decoration: underline; }
.mini-list li.muted a:hover { color: var(--primary-dark); }

/* Raccourcis : boutons alignés à gauche, pleine largeur */
.panel p[style*="display:grid"] .btn { justify-content: flex-start; }
.progress { height: 8px; }

/* Cartes entreprises : titres sur 2 lignes max, adresses sur 2 lignes, hauteurs égales */
.card-title, .card-address {
    display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.card-title { -webkit-line-clamp: 2; line-clamp: 2; min-height: 2.3em; }
.card-address { -webkit-line-clamp: 2; line-clamp: 2; }

/* Graphique d'activité un peu plus compact */
.chart-card { padding: 20px 22px; }

/* ==================================================================
   Icônes SVG (remplacent emojis et pictogrammes texte)
   ================================================================== */
.i { flex: none; display: inline-block; vertical-align: -0.2em; }
.menu-ico { display: grid; place-items: center; }
.header-search button { display: grid; place-items: center; }
.logo-mark .i { display: block; }
.card-links { display: inline-flex; gap: 8px; align-items: center; }
.contact-list li { align-items: center; }
.contact-list .ico { display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; }
.ai-callout h3 { display: flex; align-items: center; gap: 8px; }
.ai-callout h3 .i { color: var(--accent); }
.btn .i { vertical-align: 0; }

/* Historique : pastille simple à la place des pictogrammes */
.timeline li::before {
    content: ""; width: 14px; height: 14px; left: -28px; top: 4px;
    background: var(--primary); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--primary-soft);
}
.timeline li.t-apply::before, .timeline li.t-cv_generated::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.timeline li.t-login_failed::before { background: var(--err); box-shadow: 0 0 0 2px var(--err-bg); }

/* ==== Icones SVG (remplacent emojis et pictogrammes texte) ==== */
.i { flex: none; display: inline-block; vertical-align: -0.2em; }
.menu-ico { display: grid; place-items: center; }
.header-search button { display: grid; place-items: center; }
.logo-mark .i { display: block; }
.card-links { display: inline-flex; gap: 8px; align-items: center; }
.contact-list li { align-items: center; }
.contact-list .ico { display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; }
.ai-callout h3 { display: flex; align-items: center; gap: 8px; }
.ai-callout h3 .i { color: var(--accent); }
.btn .i { vertical-align: 0; }
.timeline li::before {
    content: ""; width: 14px; height: 14px; left: -28px; top: 4px;
    background: var(--primary); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--primary-soft);
}
.timeline li.t-apply::before, .timeline li.t-cv_generated::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.timeline li.t-login_failed::before { background: var(--err); box-shadow: 0 0 0 2px var(--err-bg); }

/* prose : pages de texte (mentions legales) */
.prose { max-width: 760px; }
.prose h1 { margin-bottom: 4px; }
.prose h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.prose p, .prose li { line-height: 1.7; }
.prose ul { padding-left: 20px; }
.prose a { color: var(--primary); text-decoration: underline; }

/* chatbot */
.chatbot { position: fixed; right: 20px; bottom: 20px; z-index: 60; font-family: var(--font-body); }
.chat-fab { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-pop); }
.chat-fab:hover { background: var(--accent-dark); }
.chat-panel { position: absolute; right: 0; bottom: 62px; width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-pop); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; color: #fff;
    background: linear-gradient(120deg, var(--primary), var(--deep)); }
.chat-head small { display: block; opacity: .8; font-size: .78rem; }
.chat-close { border: 0; background: transparent; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chat-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; line-height: 1.5; font-size: .93rem; overflow-wrap: anywhere; }
.chat-msg-bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg a { color: var(--primary); font-weight: 600; text-decoration: underline; }
.chat-typing { color: var(--muted); font-style: italic; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: var(--bg); }
.chat-suggest[hidden] { display: none; }
.chat-suggest button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 10px;
    font: inherit; font-size: .82rem; cursor: pointer; color: var(--ink); text-align: left; }
.chat-suggest button:hover { border-color: var(--primary); color: var(--primary); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.chat-send { display: grid; place-items: center; width: 42px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; }
.chat-send:disabled { opacity: .55; cursor: default; }
.chat-note { margin: 0; padding: 6px 12px 10px; font-size: .72rem; color: var(--muted); background: var(--surface); }
.chat-note a { color: var(--primary); text-decoration: underline; }
@media (max-width: 520px) {
    .chatbot { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
    .chat-fab span { display: none; }
    .chat-fab { padding: 14px; }
}
@media print { .chatbot { display: none; } }

/* ==================================================================
   WaslJob : logo, fond Marrakech, mot de passe oublié
   ================================================================== */
.logo-svg { width: 38px; height: 38px; display: block; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 1.3rem; letter-spacing: -.02em; }
.logo-text b { color: var(--accent); font-weight: 700; }
.logo-text small {
    font-family: var(--font-body); font-size: .62rem; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); margin-top: 3px;
}

/* Fond illustré de Marrakech (hero de l'accueil + panneau gauche connexion/inscription) */
.hero {
    background-color: var(--deep);
    background-image:
        linear-gradient(90deg, rgba(3,32,28,.80) 0%, rgba(3,32,28,.50) 42%, rgba(3,32,28,0) 78%),
        url("img/marrakech-hero.svg");
    background-size: cover, cover;
    background-position: center, center bottom;
    background-repeat: no-repeat;
    min-height: 560px; display: flex; align-items: center;
}
.hero-inner { width: 100%; padding-bottom: 110px; }
.auth-side {
    background-color: var(--deep);
    background-image: linear-gradient(180deg, rgba(3,32,28,.70) 0%, rgba(3,32,28,.10) 70%), url("img/marrakech-hero.svg");
    background-size: cover; background-position: 62% bottom; background-repeat: no-repeat;
}

/* Mot de passe oublié */
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.link-sm { font-size: .84rem; font-weight: 600; }
.code-input {
    font-family: var(--font-display) !important; font-size: 1.9rem !important; letter-spacing: .45em;
    text-align: center; padding: 12px 8px !important;
}
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
form.auth-alt { margin-top: 18px; }


/* ==================================================================
   Photo de Marrakech (Koutoubia)
   La photo fait 735x980 px : on ne l'etire JAMAIS sur tout l'ecran
   (sinon elle devient floue). On l'affiche a sa taille naturelle.
   ================================================================== */

/* 1) TOUTES les pages : photo paysage plein ecran (fixe) + voile bleu nuit pour un rendu propre.
      Fichier a placer dans static/img/ : marrakech-hero-2x.jpg (format paysage, 1920 px minimum). */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background-color: var(--deep);
    background-image:
        linear-gradient(180deg, rgba(8,14,50,.30) 0%, rgba(8,14,50,.40) 50%, rgba(8,14,50,.62) 100%),
        url("img/marrakech-hero-2x.jpg");
    background-size: auto, cover;
    background-position: 0 0, center 22%;
    background-repeat: no-repeat;
    -webkit-filter: saturate(1.15) contrast(1.05); filter: saturate(1.15) contrast(1.05);
}
body::after { display: none; }
/* Le contenu repose sur un panneau en verre depoli : la photo reste visible derriere, sans cadre ni ombre dure */
main.container {
    background: none; border: 0; box-shadow: none; border-radius: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    margin: 0 auto; color: #fff;
}
/* Connexion / inscription : pas de panneau */
@media print { body::before, body::after { display: none; } main.container { color: var(--ink); } }

/* 2) Accueil : hero bleu nuit, photo nette a droite, SANS voile par-dessus */
.hero {
    position: relative; isolation: isolate;
    background-color: var(--deep); background-image: none;
}
.hero::before {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; z-index: -1;
    width: min(66%, 980px);
    background:
        linear-gradient(180deg, rgba(8,14,50,.10), rgba(8,14,50,.30)),
        url("img/marrakech-hero-2x.jpg") center 60% / cover no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 50%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 50%);
}
.cv-mock { display: none; }  /* la maquette cacherait le minaret */
@media (max-width: 860px) {
    .hero::before { width: 100%; opacity: .30; -webkit-mask-image: none; mask-image: none; }
}

/* 3) Connexion / inscription / mot de passe oublie : ecran partage, sans bordures.
      A GAUCHE la barre blanche du formulaire, a DROITE la photo en grand avec le texte dessus. */
.auth-wrap { background: transparent; border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(8,14,50,.22); }
.auth-side {
    justify-content: flex-end;
    background: linear-gradient(180deg, rgba(8,14,50,.25) 0%, rgba(8,14,50,.55) 55%, rgba(8,14,50,.88) 100%);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.auth-form { background: #fff; }
@media (min-width: 861px) {
    body:has(.auth-wrap) main.container { max-width: none; padding: 0; margin: 0; }
    .auth-wrap {
        grid-template-columns: minmax(420px, 540px) 1fr;
        max-width: none; margin: 0;
        min-height: calc(100vh - var(--header-h));
        border: 0; border-radius: 0; box-shadow: none; background: #fff;
    }
    /* barre du formulaire : a gauche, blanche, contenu centre */
    .auth-form {
        order: -1; align-items: center;
        padding: 56px clamp(32px, 4vw, 64px);
    }
    .auth-form > * { width: 100%; max-width: 400px; }
    /* photo : a droite, en grand, texte en bas a gauche sur un degrade doux */
    .auth-side {
        position: relative; justify-content: flex-end;
        padding: 56px clamp(40px, 5vw, 80px);
        background:
            linear-gradient(180deg, rgba(8,14,50,.10) 0%, rgba(8,14,50,.10) 40%, rgba(8,14,50,.82) 100%),
            url("img/marrakech-hero-2x.jpg") center 30% / cover no-repeat;
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .auth-side h2 { font-size: clamp(1.8rem, 2.6vw, 2.5rem); max-width: 22ch; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
    .auth-side ul { color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.4); }
}

.site-footer { background: var(--deep); }


/* ==================================================================
   4) Connexion / inscription : meme mise en page, mais la barre blanche devient
      un verre fonce translucide (la photo continue derriere). Seuls les champs restent blancs.
   ================================================================== */
.auth-wrap { background: transparent; }
.auth-form {
    background: transparent;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    border-radius: 20px; color: #fff;
}
.auth-form :where(h1, h2, label, p, span, small, div, li) { color: #fff; }
.auth-form a:not(.btn) { color: #FFD27A; }
.auth-form :where(h1, h2, label, p, span, small, div, li, a:not(.btn)) { text-shadow: 0 1px 10px rgba(0,0,0,.65); }
.auth-form input, .auth-form select, .auth-form textarea { text-shadow: none; }
.auth-form input:not([type=checkbox]):not([type=radio]), .auth-form select, .auth-form textarea {
    background: #fff; color: var(--ink); border-color: rgba(255,255,255,.35);
}
.auth-form .auth-alt, .auth-form .hint, .auth-form small { color: rgba(255,255,255,.78); }
@media (min-width: 861px) {
    .auth-wrap {
        background: linear-gradient(90deg, rgba(8,14,50,.62) 0%, rgba(8,14,50,.44) 32%, rgba(8,14,50,.10) 64%, rgba(8,14,50,.10) 100%);
    }
    .auth-form { border-radius: 0; border-right: 0; background: transparent; }
    .auth-side {
        background: linear-gradient(180deg, rgba(8,14,50,0) 0%, rgba(8,14,50,0) 50%, rgba(8,14,50,.72) 100%);
    }
}

/* Pied de page assorti */
.site-footer { background: rgba(8,14,50,.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }


/* ==================================================================
   5) Pages sans panneau : les titres posent directement sur la photo (clairs),
      les cartes / tableaux / panneaux gardent leur fond blanc et leur texte sombre.
      (:where = specificite 0, donc toute couleur deja definie par une carte est conservee)
   ================================================================== */
:where(main.container) :where(
    .step, .sector-tile, .card, .filters, .panel, .kpi, .chart-card, .table-wrap, .detail-header,
    .cv-paper, .cv-sheet, .tabs a, .pagination a, .pagination span, .leaderboard,
    [class*="card"], [class*="panel"], [class*="tile"], [class*="kpi"], [class*="paper"],
    [class*="sheet"], [class*="table"], [class*="chart"], [class*="box"], [class*="step"]
) { color: var(--ink); }

main.container :where(h1, h2) { text-shadow: 0 2px 4px rgba(0,0,0,.35), 0 4px 22px rgba(0,0,0,.55); }
:where(main.container) :where(.panel, .card, .kpi, .chart-card, .step, .table-wrap, .detail-header, .filters, [class*="card"], [class*="panel"], [class*="tile"]) :where(h1, h2, h3) { text-shadow: none; }

main.container .section-head a,
main.container .page-head a:not(.btn),
main.container .result-bar a { color: #FFD27A; }
main.container .page-head .muted, main.container .page-head p,
main.container .section-head .muted, main.container .section-head p,
main.container .result-bar { color: rgba(255,255,255,.82); }


/* ==================================================================
   6) Pages (entreprises, statistiques, historique, fiche CV...) : textes poses
      directement sur la photo => clairs et lisibles ; le contenu des cartes ne change pas.
   ================================================================== */
/* sous-titres / textes d'intro */
main.container > .muted, main.container > p.muted,
main.container > .section-head .muted,
main.container .card-grid > .empty,
main.container .back-link {
    color: rgba(255,255,255,.88); text-shadow: 0 1px 8px rgba(0,0,0,.55);
}
main.container .back-link { color: #FFD27A; }
main.container .result-bar { text-shadow: 0 1px 8px rgba(0,0,0,.55); }

/* historique : la ligne du temps pose sur la photo */
main.container .timeline { border-left-color: rgba(255,255,255,.38); }
main.container .timeline li { color: #fff; }
main.container .timeline .t-title { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
main.container .timeline .t-time  { color: rgba(255,255,255,.72); }
main.container .timeline .muted   { color: rgba(255,255,255,.80); }
main.container .timeline a        { color: #FFD27A; }

/* ecrans mobiles : meme logique, un peu plus de voile pour la lisibilite */
@media (max-width: 700px) {
    body::before {
        background-image:
            linear-gradient(180deg, rgba(8,14,50,.46) 0%, rgba(8,14,50,.70) 100%),
            url("img/marrakech-hero-2x.jpg");
    }
}

/* ==================================================================
   7) Dashboard / accueil : couleurs plus vives (moins sombres) pour la 1re carte KPI et le bandeau final
   ================================================================== */
/* Carte "candidatures envoyees" : bleu vif, chiffre blanc (il etait sombre sur fond sombre) */
.kpi.kpi-primary {
    background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%);
    border-color: rgba(255,255,255,.25);
    box-shadow: 0 8px 22px rgba(47,70,192,.35);
}
.kpi.kpi-primary .kpi-num   { color: #fff; }
.kpi.kpi-primary .kpi-label { color: #E6EAFF; }

/* Bandeau "Content de te revoir" / "Pret a postuler ?" : meme bleu vif que la carte "candidatures envoyees" */
.cta-band {
    background:
        radial-gradient(520px 240px at 100% 0%, rgba(255,255,255,.14), transparent 62%),
        linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 8px 22px rgba(47,70,192,.35);
}
.cta-band h2 { color: #fff; }
.cta-band p  { color: #E6EAFF; }
/* bouton blanc, texte bleu fonce */
.cta-band .btn-accent { background: #fff; color: var(--deep); box-shadow: 0 6px 16px rgba(0,0,0,.20); }
.cta-band .btn-accent:hover { background: #EEF1FF; color: var(--deep); }

/* ==================================================================
   8) Assistant (chatbot) : memes bleus vifs que la carte "candidatures envoyees"
   ================================================================== */
.chat-fab {
    background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%); color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 8px 22px rgba(47,70,192,.40);
}
.chat-fab:hover { background: linear-gradient(135deg, #5873F0 0%, #3A52CC 100%); }
.chat-head { background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%); }
.chat-msg-user { background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%); }
.chat-send { background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%); }
.chat-send:hover:not(:disabled) { background: linear-gradient(135deg, #5873F0 0%, #3A52CC 100%); }
.chat-suggest button { border-color: #C9D2F7; color: #2F46C0; }
.chat-suggest button:hover { background: #EEF1FF; border-color: #4A66E8; color: #2F46C0; }
.chat-msg a, .chat-note a { color: #2F46C0; }
.chat-form input:focus { border-color: #4A66E8; box-shadow: 0 0 0 3px rgba(74,102,232,.18); }

/* ==================================================================
   9) Hero de l'accueil : meme bleu vif que les autres elements (photo fondue dedans)
   ================================================================== */
.hero {
    background-color: #2F46C0;
    background-image: linear-gradient(135deg, #3B57DC 0%, #2C42B8 50%, #22328F 100%);
}
.hero::before {
    background:
        linear-gradient(180deg, rgba(8,14,50,.06), rgba(8,14,50,.22)),
        url("img/marrakech-hero-2x.jpg") center 60% / cover no-repeat;
}
.hero .lead { color: rgba(255,255,255,.94); }
.hero .chip { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.10); color: #fff; }
.hero .chip:hover { background: rgba(255,255,255,.22); }

/* Bouton "Rechercher" du hero : meme bleu que le bouton Assistant */
.hero-search .btn-accent, .hero .btn-accent {
    background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%); color: #fff;
    box-shadow: 0 6px 16px rgba(47,70,192,.35);
}
.hero-search .btn-accent:hover, .hero .btn-accent:hover {
    background: linear-gradient(135deg, #5873F0 0%, #3A52CC 100%); color: #fff;
}

/* ==================================================================
   10) Boutons et elements "actifs" : meme bleu vif partout (Filtrer, Postuler ailleurs, pagination, onglets...)
   ================================================================== */
.btn-primary {
    background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%);
    border-color: #2F46C0; color: #fff;
    box-shadow: 0 6px 16px rgba(47,70,192,.30);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #5873F0 0%, #3A52CC 100%);
    border-color: #3A52CC; color: #fff;
}
.btn-primary:disabled { opacity: .6; box-shadow: none; }
.pagination .current, .tabs a.on {
    background: linear-gradient(135deg, #4A66E8 0%, #2F46C0 100%);
    border-color: #2F46C0; color: #fff;
}
.pagination a:hover, .tabs a:hover:not(.on) { border-color: #4A66E8; color: #2F46C0; }

/* ==================================================================
   11) Espacement entre blocs (graphiques / Top 10 / panneaux) + titres nets dans les cartes
   ================================================================== */
/* espace regulier entre deux blocs successifs, quel que soit leur type */
.chart-grid + .chart-card, .chart-grid + .chart-grid, .chart-grid + .panel,
.chart-card + .chart-card, .chart-card + .chart-grid, .chart-card + .panel,
.panel + .chart-card,      .panel + .chart-grid,      .panel + .panel,
.kpi-row + .panel,         .kpi-row + .chart-card,    .table-wrap + .panel {
    margin-top: 32px;
}
/* ombre douce : les blocs blancs se detachent proprement de la photo et les uns des autres */
.panel, .chart-card, .table-wrap { box-shadow: 0 10px 28px rgba(8,14,50,.22); border-color: rgba(255,255,255,.65); }

/* titres a l'interieur des cartes : AUCUNE ombre (l'ombre ne sert qu'aux textes poses sur la photo) */
main.container :is(.panel, .card, .chart-card, .kpi, .step, .table-wrap, .detail-header, .filters, .cv-paper, .sector-tile)
    :is(h1, h2, h3, h4, p, span, small, div, a, li, label, strong) { text-shadow: none; }

/* ==================================================================
   12) Logo WaslJob : meme bleu vif que l'Assistant, les boutons et le hero
   ================================================================== */
.logo-text b { color: #3A52CC; }
.logo-svg { filter: drop-shadow(0 3px 8px rgba(47,70,192,.35)); }

/* 13) Mobile : le menu des 3 points ne sort plus de l'ecran */
@media (max-width: 860px) {
    .header-search + .header-actions { margin-left: auto; }
    .kebab-menu { min-width: 0; width: 270px; max-width: calc(100vw - 24px); }
}
@media (max-width: 400px) {
    .kebab-menu { width: calc(100vw - 24px); }
}
