/* ============================================================
   CVBoost — feuille de style unique du site
   Design system repris des maquettes (docs/maquettes/*.html) :
   mêmes couleurs, polices, rayons, ombres et noms de composants.
   Les composants marqués « hors maquettes » ont été conçus avec
   ces mêmes tokens pour les écrans que les maquettes ne couvrent pas.
   ============================================================ */

/* ---------- Polices hébergées localement (static/fonts) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url('fonts/manrope-latin.woff2') format('woff2');
}

/* ---------- Tokens (identiques aux maquettes) ---------- */
:root {
    --primary: #6D3CE8;
    --primary-dark: #5125B8;
    --coral: #FF6B6B;
    --ink: #252238;
    --muted: #6B6878;
    --white: #FFFFFF;
    --soft: #F7F5FC;
    --lavender: #EDE7FF;
    --border: #D8D2E3;
    --line: #EEEAF4;          /* bordure légère des cartes */
    --success: #237A57;
    --error: #B93838;
    --warning: #946200;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 8px 24px rgba(37, 34, 56, .08);
    --shadow-card: 0 2px 8px rgba(37, 34, 56, .04);
    --font-head: 'Manrope', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font: 400 16px/1.5 var(--font-body);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a.btn, label.btn { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, label.btn:focus-within {
    outline: 3px solid rgba(109, 60, 232, .35);
    outline-offset: 3px;
}
img { max-width: 100%; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; margin: 0 0 14px; letter-spacing: -.035em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 16px; color: var(--muted); }
ul { color: var(--muted); padding-left: 20px; margin: 0 0 16px; }
li { margin-bottom: 6px; }

.container { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.ink { color: var(--ink); }
.text-center { text-align: center; }
.link { color: var(--primary); font-weight: 700; }
.link:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--primary); font-size: .78rem; font-weight: 800;
    letter-spacing: .09em; text-transform: uppercase;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); display: inline-block; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 48px; padding: 0 20px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff;
    font-weight: 700; font-size: .92rem; text-align: center;
    transition: .18s ease;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn.secondary { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn.secondary:hover { background: var(--lavender); }
.btn.ghost { background: transparent; color: var(--primary); padding-inline: 12px; }
.btn.ghost:hover { background: var(--lavender); transform: none; }
.btn.coral { background: var(--coral); color: var(--ink); }
.btn.danger { background: var(--error); }
.btn.danger:hover { background: #962d2d; }
.btn.small-btn { min-height: 38px; padding: 0 14px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: #E8E4EF; color: #777182; border-color: transparent; cursor: not-allowed; transform: none; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Cartes et grilles ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-card); }
.soft-card { background: var(--soft); border: 1px solid #F0ECF7; border-radius: var(--radius); padding: 24px; }
.card.elevated { box-shadow: var(--shadow); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 12px; }
.iconbox {
    width: 46px; height: 46px; border-radius: 14px;
    background: var(--lavender); color: var(--primary);
    display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 18px;
}
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- Badges, barres de progression ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; padding: 5px 10px;
    font-size: .73rem; font-weight: 800;
    background: var(--lavender); color: var(--primary);
}
.badge.success { background: #E7F4ED; color: var(--success); }
.badge.warning { background: #FFF3D6; color: var(--warning); }
.badge.danger { background: #FCE9E9; color: var(--error); }
.badge.neutral { background: #F0EDF5; color: var(--muted); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.progress { height: 9px; border-radius: 99px; background: var(--lavender); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }

/* ---------- Formulaires ---------- */
.label { display: block; font-size: .86rem; font-weight: 700; margin: 0 0 7px; color: var(--ink); }
.field {
    width: 100%; height: 50px;
    border: 1px solid #8A8496; border-radius: var(--radius-sm);
    padding: 0 14px; background: #fff; color: var(--ink);
}
.field::placeholder { color: #8B8795; }
.field:focus { border-color: var(--primary); outline: 3px solid rgba(109, 60, 232, .12); }
.field.error { border: 2px solid var(--error); }
textarea.field { height: auto; min-height: 130px; padding: 14px; resize: vertical; line-height: 1.5; }
select.field { appearance: auto; }
.field-wrap { margin-bottom: 17px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error-text { font-size: .78rem; color: var(--error); margin-top: 6px; }
.status-ok { color: var(--success); }
.status-error { color: var(--error); }

/* ---------- Site public : barre de navigation et pied de page ---------- */
.nav-wrap { background: #fff; border-bottom: 1px solid #F0EDF5; position: sticky; top: 0; z-index: 20; }
.nav { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.3rem var(--font-head); letter-spacing: -.04em; color: var(--ink); }
.brand-mark {
    width: 34px; height: 34px; border-radius: 11px;
    background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 800; font-size: 1rem; letter-spacing: 0;
}
.brand-mark.coral { background: var(--coral); color: var(--ink); }
.navlinks { display: flex; align-items: center; gap: 28px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.navlinks a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.section { padding: 88px 0; }
.section.soft { background: var(--soft); }
.section-head { max-width: 650px; margin: 0 auto 38px; text-align: center; }
.hero { padding-top: 72px; }
.hero-grid { align-items: center; gap: 56px; }
.hero-lead { font-size: 1.08rem; max-width: 520px; }

.footer { background: var(--ink); color: #fff; padding: 48px 0 28px; margin-top: auto; }
.footer p, .footer a { color: #D7D3E1; }
.footer .brand { color: #fff; }
.footer-top { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; font-size: .85rem; }
.footer-links a:hover { color: #fff; }
.footer hr { border: 0; border-top: 1px solid #514D60; margin: 30px 0 20px; }
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Anneau de score (valeur via --val : style="--val: 80") ---------- */
.ring {
    --val: 0; --size: 94px; --inner: 72px;
    width: var(--size); height: var(--size); border-radius: 50%; flex: none;
    background: conic-gradient(var(--primary) calc(var(--val) * 1%), var(--lavender) 0);
    display: grid; place-items: center;
}
.ring > span {
    width: var(--inner); height: var(--inner); border-radius: 50%;
    background: #fff; display: grid; place-items: center;
    font: 800 1.25rem var(--font-head); color: var(--ink);
}
.ring.large { --size: 166px; --inner: 132px; }
.ring.large > span { font-size: 2.4rem; color: var(--primary); background: var(--soft); }

/* ---------- Authentification (maquette 02) ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 20px; background: #FBFAFD; }
.auth-box { width: min(1000px, 100%); }
.auth-card {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #fff; border: 1px solid var(--line); border-radius: 24px;
    overflow: hidden; box-shadow: var(--shadow);
}
.auth-side { background: var(--soft); padding: clamp(28px, 5vw, 58px); display: flex; flex-direction: column; justify-content: center; }
.auth-side h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 18px; }
.auth-illustration { margin-top: 28px; background: var(--lavender); border-radius: 20px; padding: 28px; text-align: center; }
.auth-illustration .big { font-size: 3.6rem; color: var(--primary); line-height: 1.2; }
.auth-form { padding: clamp(28px, 5vw, 58px); }
.auth-form h2 { font-size: 1.8rem; }
.tabs { display: flex; gap: 8px; margin-bottom: 30px; }

/* ---------- Espace connecté : barre du haut + barre latérale (maquettes 03, 04, 06) ---------- */
.page-shell { min-height: 100vh; background: #FBFAFD; }
.app-top {
    height: 70px; background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.app-top-right { display: flex; align-items: center; gap: 14px; }
.app-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.sidebar { background: var(--ink); padding: 26px 16px; color: #fff; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 10px 28px; color: #fff; }
.side-link {
    display: flex; gap: 12px; align-items: center;
    padding: 12px 14px; border-radius: 10px; margin: 4px 0;
    color: #D7D3E1; font-size: .88rem; font-weight: 500;
}
.side-link .ico { width: 18px; text-align: center; }
.side-link.active, .side-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.side-bottom { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); }
.main { padding: 36px; min-width: 0; }
.main-narrow { max-width: 900px; }
.main-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.main-header h2 { margin-top: 8px; }
.mobile-menu { display: none; }

/* avatar : photo de profil ou initiales (job-logo des maquettes) */
.avatar-form { margin: 0; }
.avatar {
    width: 42px; height: 42px; border-radius: 12px; overflow: hidden;
    background: var(--lavender); color: var(--primary);
    display: grid; place-items: center; font-weight: 800; cursor: pointer;
    border: 2px solid transparent; transition: .18s ease;
}
.avatar:hover { border-color: var(--primary); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Dépôt de fichier et statistiques (maquette 03) ---------- */
.upload-zone {
    border: 1.5px dashed var(--primary); border-radius: var(--radius);
    background: #FCFAFF; padding: 42px 20px; text-align: center; transition: background .18s ease;
}
.upload-zone.dragover { background: #F2ECFF; }
.upload-icon {
    width: 58px; height: 58px; border-radius: 18px;
    background: var(--lavender); color: var(--primary);
    display: grid; place-items: center; font-size: 1.7rem; margin: 0 auto 16px;
}
.stat { padding: 20px; border-radius: 14px; background: var(--soft); }
.stat strong { display: block; font: 800 1.8rem var(--font-head); margin-top: 5px; }

/* ---------- Offres (maquette 04) ---------- */
.job { display: flex; align-items: center; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.job-logo {
    width: 42px; height: 42px; border-radius: 12px; flex: none;
    background: var(--lavender); color: var(--primary);
    display: grid; place-items: center; font-weight: 800;
}
.job-info { flex: 1; min-width: 0; }
.job-info p { margin: 3px 0 0; font-size: .82rem; }
.job-info .raison { color: var(--ink); opacity: .85; }
.job-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.score { font: 800 1.05rem var(--font-head); color: var(--primary); white-space: nowrap; }

/* ---------- Tableau en lignes (maquette 06) ---------- */
.table-row {
    /* dernière colonne de largeur fixe : en-tête et lignes restent alignés */
    display: grid; grid-template-columns: 1.6fr 1fr .9fr 170px;
    gap: 12px; align-items: center;
    padding: 17px 14px; border-bottom: 1px solid #F0EDF5; font-size: .88rem;
}
.table-row:last-child { border-bottom: 0; }
.table-head { font-weight: 800; color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
.table-row .doc-name { font-weight: 700; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 14px; justify-content: flex-end; white-space: nowrap; }

/* ---------- Conversation (maquette 05 : chat et entretien) ---------- */
.conversation { display: grid; gap: 14px; align-content: start; }
.conversation.scroll { max-height: 55vh; min-height: 260px; overflow-y: auto; padding: 4px; }
.chat-bubble {
    max-width: 82%; padding: 17px 18px;
    border-radius: 4px 16px 16px 16px;
    background: #fff; border: 1px solid var(--line);
    color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-bubble .who { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); white-space: normal; }
.chat-bubble.user { margin-left: auto; background: var(--lavender); border: 0; border-radius: 16px 4px 16px 16px; }
.chat-bubble.pending { color: var(--muted); font-style: italic; }
.chat-note { justify-self: center; font-size: .8rem; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 6px 12px; }
.persona { display: flex; align-items: center; gap: 12px; }
.persona .job-logo { width: 48px; height: 48px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; }
.back-link { color: var(--primary); font-weight: 700; font-size: .82rem; }

/* ---------- Entretien vocal : orbe animée (hors maquettes) ---------- */
.stage { display: grid; place-items: center; gap: 16px; padding: 24px 0 8px; }
.orb {
    --level: 0;
    width: 180px; height: 180px; border-radius: 50%;
    display: grid; place-items: center;
    background: radial-gradient(circle, rgba(109, 60, 232, .16), transparent 70%);
    transition: transform .08s linear;
    transform: scale(calc(1 + var(--level) * .25));   /* grossit avec le volume de la voix */
}
.orb-core {
    width: 100px; height: 100px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #A98BF5, var(--primary));
    box-shadow: 0 0 50px rgba(109, 60, 232, .35);
}
.orb[data-state="connecting"] .orb-core, .orb[data-state="thinking"] .orb-core { animation: orb-pulse 1.6s ease-in-out infinite; }
.orb[data-state="listening"] .orb-core {
    background: radial-gradient(circle at 35% 30%, #FFB3B3, var(--coral));
    box-shadow: 0 0 50px rgba(255, 107, 107, .35);
}
@keyframes orb-pulse { 50% { transform: scale(.9); opacity: .7; } }
.timer { font: 700 1.1rem var(--font-head); font-variant-numeric: tabular-nums; color: var(--muted); }
.critere { padding: 16px; border-radius: 14px; background: var(--soft); }
.critere strong { display: block; font: 800 1.6rem var(--font-head); margin: 4px 0 10px; }

/* ---------- Audio (maquette 07) ---------- */
.audio-disc {
    width: 150px; height: 150px; border-radius: 50%;
    background: var(--lavender); color: var(--primary);
    display: grid; place-items: center; font-size: 3.5rem;
}
.audio-disc.busy { animation: orb-pulse 1.6s ease-in-out infinite; }
audio { width: 100%; margin-top: 10px; }

/* ---------- Notifications (messages flash, hors maquettes) ---------- */
.toasts { position: fixed; top: 86px; right: 20px; z-index: 50; display: grid; gap: 10px; max-width: min(360px, calc(100% - 40px)); }
.toast {
    background: #fff; color: var(--ink);
    border: 1px solid var(--line); border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm); padding: 14px 18px;
    box-shadow: var(--shadow); font-size: .9rem;
    animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.alert { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px; font-size: .9rem; }
.alert.error { background: #FCE9E9; color: var(--error); }
.alert.success { background: #E7F4ED; color: var(--success); }
.alert.info { background: var(--lavender); color: var(--primary-dark); }

/* ---------- Page d'erreur (hors maquettes) ---------- */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.error-code { font: 800 clamp(4rem, 12vw, 7rem) var(--font-head); color: var(--primary); line-height: 1; margin-bottom: 10px; }

/* ---------- Responsive (mêmes points de rupture que les maquettes) ---------- */
@media (max-width: 900px) {
    .container { width: min(100% - 40px, 680px); }
    .navlinks { display: none; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-layout { grid-template-columns: 1fr; }
    .sidebar {
        display: none; position: fixed; inset: 70px 0 0 0; z-index: 30;
        overflow-y: auto;
    }
    .sidebar.open { display: flex; }
    .sidebar > .brand { display: none; }
    .mobile-menu { display: inline-flex; }
    .main { padding: 26px 20px; }
    .app-top { padding: 0 20px; }
    .auth-card { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}
@media (max-width: 600px) {
    body { font-size: 15px; }
    .container { width: calc(100% - 40px); }
    .section { padding: 58px 0; }
    .hero { padding-top: 40px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .nav { height: 66px; }
    .nav-actions .btn.ghost { display: none; }
    .nav-actions .btn { min-height: 42px; padding: 0 13px; font-size: .8rem; }
    .main { padding: 24px 16px; }
    .main-header { display: block; }
    .main-header .btn { margin-top: 12px; }
    .card, .soft-card { padding: 18px; }
    .upload-zone { padding: 30px 15px; }
    .table-row { grid-template-columns: 1fr auto; }
    .hide-mobile { display: none; }
    .job { flex-wrap: wrap; align-items: flex-start; }
    .job-side { width: 100%; justify-content: space-between; }
    .job .btn { min-height: 38px; padding: 0 10px; font-size: .75rem; }
    .chat-bubble { max-width: 94%; }
    .footer { padding: 38px 0 24px; }
    .ring.large { --size: 140px; --inner: 110px; }
}
