:root {
  --primary: #562C80;   /* Violet NEOMA */
  --secondary: #562C80;
  --accent: #E73968;    /* Rose NEOMA (secondaire) */
  --grey: #ABA09A;      /* Gris NEOMA */
  --ok: #00A683;        /* Vert NEOMA (secondaire) : étapes terminées */
  --dark: #3A1D56;
  --ink: #231A2D;
  --muted: #7A726F;
  --bg-tint: #F6F3F8;
  --border: #E2DAEA;
  --light: #FFFFFF;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Calibri, Arial, sans-serif;
  color: var(--ink);
  background: var(--light);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--dark); color: white;
}
.brand { font-weight: 700; font-size: 18px; }
.brand span { font-weight: 400; color: #D9C8EA; font-size: 14px; margin-left: 8px; }
.badge { background: #E73968; padding: 4px 10px; border-radius: 12px; font-size: 12px; }

#app { max-width: 1000px; margin: 0 auto; padding: 28px; }

h1 { font-size: 24px; margin: 0 0 4px; }
.subtitle { color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 24px; padding: 10px 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--secondary); color: white; }
.btn-primary:hover { background: var(--primary); }
.btn-outline { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.back-link { color: var(--primary); font-size: 13px; text-decoration: none; display: inline-block; margin-bottom: 10px; }

.card {
  background: var(--bg-tint); border-radius: 12px; padding: 20px; margin-bottom: 14px;
}
.card-title { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.card-meta { color: var(--muted); font-size: 12px; margin: 0 0 10px; }

.stage-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stage-label { color: var(--secondary); font-weight: 600; font-size: 13px; margin-bottom: 8px; }

.stepper { display: flex; align-items: center; }
.stepper .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
.stepper .dot.done { background: var(--ok); }
.stepper .dot.current { background: var(--secondary); width: 16px; height: 16px; }
.stepper .line { width: 34px; height: 2px; background: var(--border); }

.dropzone {
  border: 2px dashed var(--secondary); border-radius: 12px; background: var(--bg-tint);
  padding: 40px; text-align: center; cursor: pointer; margin-bottom: 20px;
}
.dropzone.dragover { background: #EEE6F5; }
.dropzone .icon { width: 44px; height: 44px; border-radius: 8px; background: var(--secondary);
  color: white; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 20px; }
.dropzone strong { display: block; margin-bottom: 4px; }
.dropzone small { color: var(--muted); }
.filename-chip { display: inline-block; margin-top: 10px; padding: 4px 12px; background: white;
  border: 1px solid var(--border); border-radius: 14px; font-size: 12px; }

fieldset { border: none; padding: 0; margin: 0 0 18px; }
legend { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chip-choice { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 18px; border: 1.5px solid var(--border); margin: 0 8px 8px 0; cursor: pointer; font-size: 13px; }
.chip-choice input { accent-color: var(--secondary); }
.chip-choice.checked { border-color: var(--secondary); background: #EEE6F5; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; padding: 6px 10px; }
td { padding: 10px; background: var(--bg-tint); font-size: 13px; }
tr + tr td { border-top: 6px solid white; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.status-done { background: var(--ok); }
.status-progress { background: var(--secondary); }
.status-wait { background: var(--border); }

.word-card { display: flex; gap: 24px; align-items: flex-start; background: var(--bg-tint);
  border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.word-icon { width: 70px; height: 90px; background: #2B5797; color: white; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; flex-shrink: 0; }

.livrable-block { margin-bottom: 16px; padding: 14px; background: white; border: 1px solid var(--border); border-radius: 8px; }
.livrable-block h4 { margin: 0 0 6px; font-size: 13px; color: var(--primary); }
.livrable-block p { white-space: pre-wrap; font-size: 13px; margin: 0; }

.note-box { background: #EEE6F5; border: 1px solid var(--secondary); border-radius: 8px;
  padding: 14px; font-size: 12.5px; color: var(--primary); font-style: italic; margin-top: 10px; }

.error-box { background: #FDECEC; border: 1px solid #E38B8B; color: #7A1F1F; border-radius: 8px;
  padding: 14px; font-size: 13px; white-space: pre-wrap; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border);
  border-top-color: var(--secondary); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn { background: transparent; border: none; color: #D9C8EA; font-size: 18px; cursor: pointer; padding: 4px 8px; }
.icon-btn:hover { color: white; }

.field-group { margin-bottom: 16px; }
.field-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field-group input[type="text"], .field-group input[type="url"], .field-group textarea, .field-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: inherit; color: var(--ink); background: white; box-sizing: border-box;
}
.field-group textarea { resize: vertical; min-height: 70px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(58,29,86,.45); display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: white; border-radius: 12px; padding: 28px; max-width: 440px; width: 90%; }
.modal-box h2 { margin: 0 0 8px; font-size: 18px; }
.modal-box p { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }

.link-plain { color: var(--primary); font-size: 12.5px; text-decoration: none; }
.link-plain:hover { text-decoration: underline; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--dark);
  color: white; padding: 10px 20px; border-radius: 20px; font-size: 13px; z-index: 60; opacity: 0;
  transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ------------------------------------------------- écran de relecture des posts */
.posts-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 720px) { .posts-columns { grid-template-columns: 1fr; } }
.posts-column-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800;
  color: var(--dark); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--secondary); }
.posts-column-title .icon { width: 30px; height: 30px; border-radius: 8px; background: var(--secondary);
  color: white; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.livrable-block .livrable-lang { display: flex; align-items: center; gap: 6px; font-size: 13px;
  font-weight: 700; color: var(--primary); margin: 0 0 8px; }

.card-home { display: flex; gap: 20px; align-items: stretch; border-left: 4px solid var(--accent); }
.authors-col { flex: 0 0 170px; display: flex; flex-direction: column; gap: 4px; padding-right: 20px;
  border-right: 1px solid var(--border); justify-content: center; }
.authors-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.author-name { font-size: 13px; font-weight: 600; color: var(--dark); }
.author-name.muted { color: var(--muted); font-weight: 400; }
@media (max-width: 720px) { .card-home { flex-direction: column; } .authors-col { flex-basis: auto; border-right: 0; padding-right: 0; } }

/* ---- Barres de progression ---- */
.progress-wrap { margin: 8px 0 2px; }
.progress { height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: var(--secondary); transition: width .8s ease; }
.progress.ok .progress-fill { background: var(--ok); }
.progress.err .progress-fill { background: #b42318; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--muted); }
.progress-pct { font-variant-numeric: tabular-nums; font-weight: 600; }
.progress-hint { display: none; margin-top: 4px; font-size: 12px; color: var(--accent); }
.progress-wrap.slow .progress-hint { display: block; }

/* ---- Choix de l'angle ---- */
.angle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.angle-card { display: flex; flex-direction: column; gap: 6px; background: white; border: 2px solid var(--border);
  border-radius: 12px; padding: 14px; cursor: pointer; font-size: 13px; position: relative; transition: border-color .15s, box-shadow .15s; }
.angle-card:hover { border-color: var(--grey); }
.angle-card.selected { border-color: var(--secondary); box-shadow: 0 0 0 3px #EEE6F5; }
.angle-card input { position: absolute; top: 12px; right: 12px; accent-color: var(--secondary); }
.angle-num { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.angle-title { font-size: 15px; color: var(--primary); padding-right: 22px; }
.angle-hook { color: var(--muted); }
.angle-public { font-size: 12px; color: var(--muted); }
.angle-points { margin: 2px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink); }
.angle-chosen { margin: 0; white-space: pre-line; font-size: 13px; background: white; border-left: 4px solid var(--ok); border-radius: 6px; padding: 10px 12px; }
#angle-text { min-height: 130px; }

/* ---- Bouton de langue FR / EN ---- */
.lang-toggle { background: transparent; border: 1px solid rgba(255,255,255,.55); color: #fff; border-radius: 16px;
  padding: 5px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.lang-toggle:hover { background: rgba(255,255,255,.15); }
