:root {
  --violet: #7b2ff7;
  --bleu: #2f80ed;
  --jaune: #f7c948;
  --vert: #27ae60;
  --encre: #1a1a2e;
}
* { box-sizing: border-box; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--encre);
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background: #fff;
}
.hero-banner {
  display: block;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(123, 47, 247, 0.3), 0 0 0 3px rgba(123, 47, 247, 0.15);
  margin-bottom: 24px;
}
header {
  border: 3px solid var(--violet);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
header h1 {
  font-size: 1.25em;
  margin: 0;
  color: var(--violet);
  font-family: 'Trebuchet MS', sans-serif;
}
.badge {
  background: var(--jaune);
  border-radius: 20px;
  padding: 4px 14px;
  font-family: 'Trebuchet MS', sans-serif;
  font-weight: bold;
  font-size: 0.85em;
  white-space: nowrap;
}
h2 {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 1.05em;
  color: #fff;
  background: var(--bleu);
  display: inline-block;
  padding: 5px 16px;
  border-radius: 8px;
  margin: 26px 0 10px 0;
}
h2.mission2 { background: var(--violet); }
h2.vert { background: var(--vert); }
.consigne {
  font-style: italic;
  color: #444;
  margin: 4px 0 12px 0;
  font-size: 0.95em;
}
.texte-copie {
  border: 2px dashed var(--bleu);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 1.05em;
  line-height: 1.7;
  background: #f5f9ff;
}
.texte-copie p { margin: 0; }
.texte-copie p + p { margin-top: 10px; }
.texte-copie mark {
  background: #fff3a0;
  padding: 1px 3px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.lignes {
  margin-top: 14px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 27px,
    #b8c4d8 27px,
    #b8c4d8 28px
  );
  border-radius: 4px;
}
.aide {
  border: 2px solid var(--vert);
  border-radius: 10px;
  padding: 10px 16px;
  margin: 12px 0;
  background: #f2fbf5;
  font-size: 0.92em;
  font-family: 'Trebuchet MS', sans-serif;
}
.visuel { margin: 14px 0 4px 0; }
.visuel svg { width: 100%; height: auto; display: block; }
.photo { margin: 12px 0; text-align: center; }
.photo img { max-width: 100%; max-height: 340px; border-radius: 10px; border: 2px solid #b8c4d8; }
.photo .legende-photo { font-size: 0.85em; color: #666; font-family: 'Trebuchet MS', sans-serif; margin-top: 5px; }
.photo-placeholder {
  display: none;
  border: 2px dashed #b8c4d8;
  border-radius: 10px;
  padding: 20px 24px;
  color: #555;
  font-size: 0.92em;
  font-family: 'Trebuchet MS', sans-serif;
  background: #fafbfd;
  text-align: left;
}
.checklist {
  border: 2px solid var(--jaune);
  border-radius: 10px;
  padding: 12px 18px;
  margin-top: 18px;
  background: #fffdf2;
  font-size: 0.95em;
}
.checklist strong, .aide strong { font-family: 'Trebuchet MS', sans-serif; }
.checklist ul { margin: 8px 0 2px 0; padding-left: 4px; list-style: none; }
.checklist li { margin: 6px 0; }
.checklist li::before { content: "☐ "; font-size: 1.1em; }
footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.85em;
  color: #777;
  font-family: 'Trebuchet MS', sans-serif;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9em;
  font-family: 'Trebuchet MS', sans-serif;
  margin: 14px 0;
}
th, td { border: 1px solid #ccc; padding: 7px 10px; text-align: left; }
th { background: var(--violet); color: #fff; }
tr:nth-child(even) td { background: #f7f4fd; }
.cover p, .cover li { line-height: 1.6; }

/* ---------- Navigation du site ---------- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-family: 'Trebuchet MS', sans-serif;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.navbar a {
  color: var(--violet);
  text-decoration: none;
  font-weight: bold;
  background: #f3ecfe;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.92em;
}
.navbar a:hover { background: var(--violet); color: #fff; }
.navbar .position { color: #777; font-size: 0.9em; font-weight: bold; }
.navbar.bas { margin-top: 26px; margin-bottom: 0; }

/* ---------- Vignettes de l'accueil ---------- */
.vignettes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.carte-semaine {
  display: block;
  text-decoration: none;
  color: var(--encre);
  border: 2px solid #e6e2f5;
  border-radius: 14px;
  padding: 18px 16px 14px 16px;
  background: #fff;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  font-family: 'Trebuchet MS', sans-serif;
}
.carte-semaine:hover {
  transform: translateY(-4px);
  border-color: var(--violet);
  box-shadow: 0 8px 18px rgba(123, 47, 247, 0.15);
}
.carte-semaine .emoji { font-size: 2.3em; display: block; margin-bottom: 6px; }
.carte-semaine .numero { font-size: 0.8em; color: #999; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.carte-semaine h3 { margin: 4px 0 10px 0; font-size: 1.05em; color: var(--violet); }
.carte-semaine .grade {
  display: inline-block;
  background: var(--jaune);
  border-radius: 14px;
  padding: 2px 10px;
  font-size: 0.78em;
  font-weight: bold;
  margin-bottom: 8px;
}
.carte-semaine .prod { font-size: 0.83em; color: #666; margin: 0; line-height: 1.45; }

@media print {
  body { padding: 10px; }
  .navbar { display: none; }
  header, .texte-copie, .checklist, .aide { break-inside: avoid; }
}

/* ---------- Widget upload / correction Mistral ---------- */
.mission-widget {
  background: linear-gradient(135deg, #f6f2ff 0%, #eef4ff 100%);
  border: 2px dashed var(--violet);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 22px 0 30px 0;
}
.mission-widget h3 {
  font-family: 'Trebuchet MS', sans-serif;
  color: var(--violet);
  font-size: 1em;
  margin: 0 0 6px 0;
}
.mission-hint {
  font-size: 0.88em;
  color: #555;
  margin: 0 0 14px 0;
}
.mission-upload-btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--violet);
  color: #fff;
  border-radius: 10px;
  font-family: 'Trebuchet MS', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s, transform .15s;
  font-size: 0.95em;
}
.mission-upload-btn:hover { background: #6a1de0; transform: translateY(-1px); }
.mission-upload-btn input { display: none; }
.mission-error {
  color: #c0392b;
  margin-top: 10px;
  font-size: 0.88em;
  min-height: 1em;
  font-family: 'Trebuchet MS', sans-serif;
}
.mission-history {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mission-submission {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #e4e4ef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: 'Trebuchet MS', sans-serif;
}
.mission-submission.processing {
  border-color: var(--bleu);
  background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
}
.mission-submission.error {
  border-color: #c0392b;
  background: #fff5f5;
}

.mission-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.mission-photos img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ddd;
  max-height: 340px;
  object-fit: contain;
  background: #f9f9fc;
  cursor: zoom-in;
}

.mission-submission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9em;
  color: #555;
  flex-wrap: wrap;
}
.mission-status { font-weight: bold; }
.mission-status.err { color: #c0392b; }

.mission-criteria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.crit-card {
  background: #fafafd;
  border: 1px solid #e4e4ef;
  border-radius: 8px;
  padding: 10px 12px;
}
.crit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.crit-name {
  font-weight: bold;
  color: var(--violet);
  font-size: 0.9em;
}
.crit-stars {
  color: var(--jaune);
  letter-spacing: 1px;
  font-size: 1em;
}
.crit-stars .off { color: #ddd; }
.crit-comment {
  font-size: 0.85em;
  color: #555;
  line-height: 1.4;
}

.mission-global {
  background: #fdf9f0;
  border-left: 4px solid var(--jaune);
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 12px;
}
.mission-global h4 {
  color: #8a6d00;
  margin: 0 0 8px 0;
  font-size: 0.95em;
}
.mission-global p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.5;
}
.mission-suggestions, .mission-reussi {
  margin-top: 12px;
  font-size: 0.85em;
}
.mission-suggestions ul, .mission-reussi ul {
  margin: 6px 0 0 0;
  padding-left: 20px;
}
.mission-suggestions li, .mission-reussi li {
  margin: 3px 0;
  line-height: 1.4;
}
.mission-reussi { color: #1e8449; }

/* ---------- Bloc orthographe (prompt C) ---------- */
.mission-ortho {
  background: #fef7f6;
  border-left: 4px solid #e05656;
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 12px;
}
.mission-ortho h4 {
  color: #a1362f;
  margin: 0 0 6px 0;
  font-size: 0.95em;
}
.ortho-comment {
  margin: 0 0 12px 0;
  font-size: 0.88em;
  color: #555;
  font-style: italic;
}
.ortho-empty {
  color: #1e8449;
  font-weight: bold;
  margin: 0;
  font-size: 0.9em;
}
.ortho-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ortho-item {
  background: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  border: 1px solid #f0d0cc;
}
.ortho-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.ortho-badge {
  display: inline-block;
  background: #f0d0cc;
  color: #a1362f;
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 0.7em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ortho-orthographe { background: #f0d0cc; color: #a1362f; }
.ortho-grammaire   { background: #ffe4b0; color: #8a5a00; }
.ortho-conjugaison { background: #d8e5fa; color: #204b7e; }
.ortho-accord      { background: #e0d0f0; color: #5b2ea0; }
.ortho-ponctuation { background: #d5edd5; color: #1e6b3a; }

.ortho-diff {
  font-family: Georgia, serif;
  font-size: 0.9em;
  line-height: 1.5;
}
.ortho-extrait {
  color: #c0392b;
  font-style: italic;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.ortho-arrow {
  color: #999;
  margin: 0 6px;
  font-family: 'Trebuchet MS', sans-serif;
}
.ortho-correction {
  color: #1e8449;
  font-weight: bold;
}
.ortho-regle {
  font-size: 0.82em;
  color: #666;
  margin-top: 4px;
  padding-left: 4px;
}
