/* ===== HireB — CSS mobile-first : la base vise l'écran de téléphone, les @media (min-width) enrichissent ===== */
:root {
  --paper: #F4F7F5; --surface: #FFFFFF; --ink: #17261E; --muted: #55655C; --line: #DAE3DD;
  --forest: #0B4F3A; --forest-deep: #073B2B; --sun: #FFC933; --sun-soft: #FFF1C2;
  --ok-soft: #DDF1E6; --danger: #B42318; --danger-soft: #FCE9E7;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 3.75rem;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--font-body); overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 7vw, 3.1rem); font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .75em; }
img { max-width: 100%; height: auto; }
a { color: var(--forest); text-underline-offset: 3px; }
a:hover { color: var(--forest-deep); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; max-width: 60ch; }
.prose { max-width: 70ch; }
.hint { color: var(--muted); font-size: .9rem; margin: .3em 0 0; }
.error { color: var(--danger); font-size: .92rem; margin: .3em 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stack > * + * { margin-top: 1rem; } .stack-lg > * + * { margin-top: 1.75rem; } .stack-sm > * + * { margin-top: .5rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ----- Boutons : cible tactile >= 44px ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; font: 600 .98rem var(--font-body); padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; text-align: center; transition: background-color .15s, border-color .15s; }
.btn:hover { border-color: var(--forest); color: var(--ink); }
.btn-primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-deep); border-color: var(--forest-deep); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--forest); }
.btn-danger { color: var(--danger); }
.btn-lg { min-height: 52px; padding: .75rem 1.4rem; font-size: 1.05rem; }
.btn-sm { min-height: 40px; padding: .3rem .8rem; font-size: .92rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: .5rem 0; min-height: 44px; font: inherit; color: var(--forest); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--danger); }

/* ----- Formulaires (16px mini : pas de zoom auto sur iOS) ----- */
.field label, .field legend { display: block; font-weight: 600; margin-bottom: .3rem; padding: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=datetime-local], select, textarea, input[type=file] {
  width: 100%; min-height: 46px; font: inherit; font-size: 1rem; padding: .6rem .75rem; border: 1px solid #BFCDC5; border-radius: 10px; background: var(--surface); color: var(--ink); }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--sun); outline-offset: 0; border-color: var(--forest); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 500; cursor: pointer; min-height: 44px; padding: .4rem 0; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; accent-color: var(--forest); flex: none; }
.field ul, .field div[id] { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.field ul label, .field div[id] > div > label { font-weight: 500; display: flex; gap: .6rem; align-items: center; min-height: 44px; }
input[type=radio] { accent-color: var(--forest); width: 1.2rem; height: 1.2rem; }
.choice { display: flex; gap: .75rem; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-top: .5rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--forest); background: var(--ok-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-wide { max-width: 760px; }
.inline-form { display: grid; gap: .75rem; margin: 1rem 0 2rem; }
.edit-row { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 1rem; display: grid; gap: .8rem; }
.edit-grid { display: grid; gap: .8rem; }
.edit-foot { display: flex; justify-content: space-between; align-items: center; }
.form-section { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 1rem; }
.form-section > h2 { margin-bottom: .25rem; }
.form-section > .hint, .form-section > .callout { margin-bottom: 1rem; }

/* ----- Contenu ----- */
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 1rem; margin-bottom: 1rem; }
.callout { background: var(--sun-soft); border-left: 4px solid var(--sun); padding: .8rem 1rem; border-radius: 0 10px 10px 0; font-size: .96rem; }
.alert { padding: .7rem 1rem; border-radius: 10px; background: var(--ok-soft); margin: 0 0 1rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.badge { display: inline-block; font-size: .82rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: #E8EEEA; color: var(--ink); white-space: nowrap; }
.badge-ok, .status-selected { background: var(--ok-soft); color: var(--forest-deep); }
.badge-sun, .status-shortlisted { background: var(--sun-soft); color: #5C4300; }
.status-rejected { background: var(--danger-soft); color: var(--danger); }
.count { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.code { display: inline-block; min-width: 2.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--sun); color: #3D2D00; padding: .05rem .5rem; border-radius: 6px; margin-right: .3rem; }
.code-lg { font-size: .7em; vertical-align: .15em; }
.dot { display: inline-block; min-width: 1.35rem; padding: 0 .4rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.stat { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: .9rem 1rem; }
.stat strong { display: block; font: 700 1.9rem/1.1 var(--font-display); color: var(--forest); }
.stat span { color: var(--muted); font-size: .9rem; }

.rows { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.row-link, .row-plain { display: flex; flex-direction: column; gap: .5rem; padding: .95rem .25rem; color: inherit; text-decoration: none; min-height: 44px; }
.row-link:hover { background: var(--surface); }
.row-main { display: grid; gap: .1rem; min-width: 0; }
.row-meta { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 1.25rem 0 1rem; scrollbar-width: none; }
.tabs a { padding: .7rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current=page] { color: var(--forest); border-bottom-color: var(--forest); font-weight: 600; }
.share { margin-bottom: 1rem; } .share label { font-weight: 600; display: block; margin-bottom: .3rem; }
.share-row { display: grid; gap: .5rem; }
.pager { margin-top: 1rem; justify-content: center; }
.empty { border: 2px dashed var(--line); border-radius: 14px; padding: 2rem 1.25rem; text-align: center; }
.viewer { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.viewer iframe { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; }
.viewer img { display: block; margin: 0 auto; pointer-events: none; -webkit-touch-callout: none; user-select: none; }
.viewer pre { margin: 0; padding: 1rem; white-space: pre-wrap; font: .92rem/1.5 ui-monospace, Menlo, Consolas, monospace; max-height: 70vh; overflow: auto; }
.notif { display: grid; gap: .6rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.notif.is-new { border-color: var(--forest); background: #F0F8F3; }
.notif + .notif { margin-top: .6rem; }

/* ----- Coque publique ----- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .75rem 1rem; }
.brand { font: 700 1.3rem var(--font-display); color: var(--forest); text-decoration: none; letter-spacing: -0.02em; }
.page { padding: .5rem 1rem 3rem; max-width: 1180px; margin: 0 auto; }
.narrow { max-width: 600px; margin: 1rem auto; }
.site-foot { border-top: 1px solid var(--line); padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; }

/* ----- Coque application : barre du haut + navigation basse sur mobile ----- */
.app { min-height: 100vh; }
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top)); background: var(--forest); color: #fff; }
.appbar .brand { color: #fff; }
.appnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.appnav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; flex: 1 1 0; min-height: var(--nav-h); min-width: 0; max-width: 100%; padding: .3rem; font-size: clamp(.64rem, 1.6vw, .8rem); font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appnav a[aria-current=page] { color: var(--forest); box-shadow: inset 0 3px 0 var(--forest); }
.appnav svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.appnav .dot { position: absolute; top: .25rem; left: 55%; }
.appnav .nav-brand { display: none; }
.nav-foot { display: none; }
.workspace { padding: 1.25rem 1rem calc(var(--nav-h) + 2.5rem + env(safe-area-inset-bottom)); min-width: 0; width: 100%; }
.page-head { display: grid; gap: .8rem; margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: .3em; font-size: clamp(1.5rem, 6vw, 2.2rem); }
.page-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

/* ----- Landing ----- */
.hero { display: grid; gap: 2rem; padding: 1.5rem 0 2.5rem; }
.hero h1 { max-width: 16ch; }
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .75rem; }
.demo .hint { padding: 0 .5rem; }
.demo-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .4rem; border-bottom: 1px solid var(--line); }
.who { transition: color .2s; }
.who.on { color: var(--forest); font-weight: 600; }
.steps, .features { display: grid; gap: 1.25rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.steps h2, .features h2 { font-size: 1.1rem; }
.section-title { padding-top: 2rem; border-top: 1px solid var(--line); margin-bottom: 0; }
.cta { background: var(--forest); color: #fff; border-radius: 18px; padding: 1.75rem 1.25rem; display: grid; gap: 1rem; justify-items: start; margin-top: 1rem; }
.cta h2 { color: #fff; font-size: 1.5rem; margin: 0; }
.cta .btn-primary { background: var(--sun); border-color: var(--sun); color: #3D2D00; }

/* ===== Tablette (>= 640px) ===== */
@media (min-width: 640px) {
  .topbar { padding: 1rem 2rem; } .page { padding: 1rem 2rem 4rem; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .edit-grid { grid-template-columns: 2fr 1fr; }
  .inline-form { grid-template-columns: 1fr auto; align-items: end; }
  .share-row { grid-template-columns: 1fr auto; }
  .row-link, .row-plain { flex-direction: row; justify-content: space-between; align-items: center; }
  .page-head { grid-template-columns: 1fr auto; align-items: start; }
  .page-actions { display: flex; flex-wrap: wrap; }
  .steps { grid-template-columns: repeat(3, 1fr); } .features { grid-template-columns: repeat(2, 1fr); }
  .form-section, .panel { padding: 1.35rem; }
}
/* ===== Ordinateur (>= 900px) : barre latérale à la place de la navigation basse ===== */
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: center; padding: 3.5rem 0; }
  .features { grid-template-columns: repeat(4, 1fr); }
  .cta { grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; padding: 2.25rem; }
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); width: 100%; max-width: 100vw; }
  .appbar { display: none; }
  .appnav { position: sticky; left: auto; right: auto; bottom: auto; top: 0; width: 100%; height: 100vh; grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: .25rem; padding: 1.25rem 1rem; background: var(--forest); border: 0; display: flex; flex-direction: column; }
  .appnav a { flex-direction: row; justify-content: flex-start; gap: .7rem; flex: 0 0 auto; width: 100%; min-height: 44px; padding: .5rem .75rem; border-radius: 10px; font-size: 1rem; color: #E3F1EA; }
  .appnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
  .appnav a[aria-current=page] { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
  .appnav .dot { position: static; margin-left: auto; }
  .appnav .nav-brand { display: flex; color: #fff; margin: 0 0 1.25rem .5rem; }
  .nav-foot { display: grid; gap: .3rem; margin-top: auto; padding: .75rem; color: #fff; font-size: .92rem; }
  .nav-foot .link-btn { color: var(--sun); text-align: left; }
  .workspace { padding: 2rem 2.5rem 4rem; max-width: none; width: 100%; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
