/* =====================================================================
   TheLab Académie — styles
   ===================================================================== */
/* Charte graphique thelab-coworking.com */
:root {
  --bg: #F6F7FA;          /* mist */
  --surface: #FFFFFF;
  --ink: #171B33;
  --ink-soft: #5B6178;
  --line: #E7E9F0;
  --line-strong: #D7DBE8;
  --accent: #3332FF;      /* indigo */
  --accent-dark: #2825E0; /* indigo-deep */
  --accent-soft: #EEF0FF; /* lavender */
  --navy: #1C244B;
  --ok: #10B981;          /* green */
  --amber: #F5A623;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23,27,51,.05), 0 1px 3px rgba(23,27,51,.08);
  --shadow-lg: 0 12px 40px rgba(23,27,51,.14);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Titres en Fraunces (comme le site) */
h1, .form-head h1, .gate h1, .success h2 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
}

a { color: var(--accent-dark); }

/* ---- Barre du haut ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.2px; }
.brand img.logo { height: 24px; width: auto; display: block; }
.brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.brand small { font-weight: 500; color: var(--ink-soft); }
.topbar .spacer { flex: 1; }

.btn {
  appearance: none; cursor: pointer; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  padding: 9px 14px; border-radius: 9px; font-size: 14px; font-weight: 600;
  transition: .12s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Layout largeur ---- */
.wrap { max-width: 860px; margin: 0 auto; padding: 28px 20px 80px; }

/* =====================================================================
   FORMULAIRE (inscription)
   ===================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.form-head { padding: 26px 28px 8px; }
.form-head h1 { margin: 0 0 4px; font-size: 23px; letter-spacing: -.4px; }
.form-head p { margin: 0; color: var(--ink-soft); }

.section { padding: 18px 28px; border-top: 1px solid var(--line); }
.section > h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-dark); margin: 4px 0 16px; font-weight: 700;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; /* 16px = pas de zoom auto iOS */
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 14px; width: 100%; min-height: 48px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 84px; resize: vertical; }
.req::after { content: " *"; color: var(--accent); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 500;
  user-select: none; background: #fff;
}
.choice input { display: none; }
.choice.checked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.checks { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 500px){ .scale { grid-template-columns: repeat(2,1fr); } }

.form-actions {
  padding: 20px 28px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; justify-content: flex-end;
}
.form-actions .msg { margin-right: auto; color: var(--ink-soft); font-size: 13px; }

.success {
  text-align: center; padding: 60px 28px;
}
.success .badge {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 18px;
  background: #e9f7ee; color: var(--ok); display: grid; place-items: center; font-size: 32px;
}
.banner {
  margin: 14px 20px 0; padding: 12px 16px; border-radius: 10px;
  background: #fff4e6; border: 1px solid #ffd8a8; color: #92400e; font-size: 14px;
}

/* ---- Wizard (formulaire par étapes) ---- */
.wizard { max-width: 720px; margin: 0 auto; padding: 18px 16px 140px; }

.stepper {
  position: sticky; top: 57px; z-index: 20;
  background: var(--bg); padding: 14px 0 12px; margin-bottom: 4px;
}
.stepper .labels {
  display: flex; justify-content: space-between; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px;
}
.stepper .labels .s { flex: 1; text-align: center; transition: color .15s; }
.stepper .labels .s.active { color: var(--accent); }
.stepper .labels .s.done { color: var(--ok); }
.stepper .labels .s .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; margin-right: 5px;
  background: #fff; border: 1.5px solid var(--line-strong); color: var(--ink-soft);
  font-size: 12px; vertical-align: middle;
}
.stepper .labels .s.active .num { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .labels .s.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.stepper .track .fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.stepper .labels .s .txt { }
@media (max-width: 560px){ .stepper .labels .s .txt { display: none; } .stepper .labels .s .num { margin: 0; } }

.step-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.step-panel { display: none; padding: 22px 22px 6px; }
.step-panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none;} }
.step-panel h2 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: 20px; margin: 0 0 2px; letter-spacing: -.3px;
}
.step-panel .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
@media (max-width: 560px){ .step-panel { padding: 18px 16px 4px; } }

/* Blocs stagiaires répétables */
.stagiaire {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px 4px; margin-bottom: 14px; background: var(--mist, #F6F7FA);
}
.stagiaire-head { display: flex; align-items: center; margin-bottom: 8px; }
.stagiaire-head .st-title { font-weight: 800; font-size: 14px; color: var(--accent-dark); }
.stagiaire-head .st-remove {
  margin-left: auto; border: 1px solid var(--line-strong); background: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--ink-soft);
  font-size: 14px; line-height: 1;
}
.stagiaire-head .st-remove:hover { border-color: #e03131; color: #e03131; }
.add-stagiaire { width: 100%; border-style: dashed; border-color: var(--accent); color: var(--accent-dark); font-weight: 700; min-height: 48px; margin-bottom: 6px; }
.add-stagiaire:hover { background: var(--accent-soft); }

/* Pièces / upload */
.st-docs { margin: 4px 0 14px; }
.st-docs-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.docs-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.doc-chip {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.doc-chip .doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-chip .doc-size { color: var(--ink-soft); font-size: 12px; }
.doc-chip .doc-del { border: 0; background: none; cursor: pointer; color: var(--ink-soft); font-size: 15px; }
.doc-chip .doc-del:hover { color: #e03131; }
.doc-chip.uploading { opacity: .7; }
.upload-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 44px; }

/* Mandat & signature */
.info-box {
  background: var(--accent-soft); border: 1px solid #cdd3ff; color: var(--accent-dark);
  border-radius: 10px; padding: 14px 16px; font-size: 14px; margin-top: 6px;
}
.mandat-box {
  white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--ink);
  background: var(--mist, #F6F7FA); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; margin: 16px 0; max-height: 260px; overflow-y: auto;
}
.sign-zone { margin-top: 6px; }
.sign-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.sign-pad {
  width: 100%; height: 180px; background: #fff;
  border: 2px dashed var(--line-strong); border-radius: 12px; touch-action: none; display: block;
}
.sign-pad.signed { border-style: solid; border-color: var(--accent); }

/* Pièces côté CRM */
.docs-view { display: flex; flex-direction: column; gap: 6px; }
.docs-view .doc-empty { color: var(--ink-soft); font-size: 13px; }
.doc-dl {
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 7px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.doc-dl:hover { background: var(--accent); color: #fff; }

.wiz-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.wiz-foot .inner { max-width: 720px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 12px; }
.wiz-foot .btn { min-height: 50px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.wiz-foot .btn.wide { flex: 1; }
.wiz-foot .msg { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 560px){ .wiz-foot .btn { padding: 0 16px; } }

/* =====================================================================
   CRM / KANBAN
   ===================================================================== */
.crm-topbar .search {
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 12px;
  min-width: 240px; font: inherit;
}
.crm-topbar .search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.board {
  display: flex; gap: 14px; padding: 18px 20px 40px;
  overflow-x: auto; align-items: flex-start; min-height: calc(100vh - 62px);
}
.col {
  flex: 0 0 300px; background: #eef0f3; border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: calc(100vh - 100px);
}
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  font-weight: 700; font-size: 14px; position: sticky; top: 0;
}
.col-head .pill {
  margin-left: auto; background: #fff; border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px;
}
.col-head .tag { width: 9px; height: 9px; border-radius: 3px; }
.col-body { padding: 0 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.col-body.drop-hover { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: 10px; }

.ticket {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; box-shadow: var(--shadow); cursor: grab;
}
.ticket:active { cursor: grabbing; }
.ticket.dragging { opacity: .4; }
.ticket h4 { margin: 0 0 4px; font-size: 14.5px; letter-spacing: -.2px; }
.ticket .meta { font-size: 12.5px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 2px; }
.ticket .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark);
}
.chip.gray { background: #eceef1; color: var(--ink-soft); }
.ticket .when { font-size: 11px; color: #98a0ab; margin-top: 8px; }

.empty-hint { color: #98a0ab; font-size: 13px; text-align: center; padding: 18px 6px; }

/* ---- Drawer détail ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.42);
  display: none; z-index: 50;
}
.overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 620px; max-width: 96vw;
  background: var(--surface); z-index: 60; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.drawer-head h3 { margin: 0; font-size: 17px; flex: 1; }
.drawer-body { overflow-y: auto; padding: 8px 20px 24px; flex: 1; }
.drawer-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; background: var(--surface);
}
.drawer-foot .msg { margin-right: auto; font-size: 13px; color: var(--ink-soft); }

.status-select {
  font: inherit; font-weight: 700; border-radius: 9px; padding: 8px 12px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
}

.d-section { border-top: 1px solid var(--line); padding: 16px 0 4px; }
.d-section:first-child { border-top: 0; }
.d-section h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-dark); margin: 0 0 12px;
}
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.d-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px){ .d-grid { grid-template-columns: 1fr; } .drawer { width: 100%; } }
.d-field { display: flex; flex-direction: column; gap: 5px; }
.d-field label { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.d-field input, .d-field select, .d-field textarea {
  font: inherit; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; background: #fff; width: 100%;
}
.d-field textarea { min-height: 70px; resize: vertical; }
.d-field input:focus, .d-field select:focus, .d-field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { font-size: 13px; color: var(--ink-soft); display: flex; gap: 8px; }
.timeline li b { color: var(--ink); }
.timeline .t-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: 0 0 auto; }

/* ---- Login gate ---- */
.gate {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.gate .box { width: 100%; max-width: 380px; }
.gate .box .card { padding: 28px; }
.gate h1 { font-size: 20px; margin: 0 0 4px; }
.gate p { margin: 0 0 20px; color: var(--ink-soft); font-size: 14px; }
.gate .field { margin-bottom: 14px; }
.gate .err { color: #c92a2a; font-size: 13px; margin-top: 4px; min-height: 18px; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Impression fiche OPCO ---- */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; inset: 0; padding: 24px; }
}
#print-area { display: none; }
