/* ============================================================
   Theme Naruto RP - sombre + orange chakra
   ============================================================ */
:root {
  --bg: #15110d;
  --bg-2: #1f1812;
  --panel: #261d15;
  --panel-2: #2f241a;
  --line: #4a3826;
  --orange: #ff7b25;
  --orange-2: #ffa256;
  --gold: #e8b04b;
  --leaf: #4caf50;
  --red: #c0392b;
  --text: #f3e9dc;
  --muted: #b8a890;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(255, 123, 37, 0.12), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(232, 176, 75, 0.08), transparent 35%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--orange-2); text-decoration: none; }
a:hover { color: var(--orange); }

h1, h2, h3, .brand-text { font-family: "Shojumaru", "Noto Sans", cursive; font-weight: 400; }
h1 { font-size: 2rem; margin: 0 0 .4em; }
h2 { font-size: 1.4rem; margin: 1.6em 0 .6em; color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, #2a2017, #1c150f);
  border-bottom: 2px solid var(--orange);
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
  flex-wrap: wrap; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  font-size: 1.6rem; width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--orange); color: #1c150f; border-radius: 50%;
  box-shadow: 0 0 0 3px #1c150f, 0 0 0 5px var(--orange);
  font-weight: bold;
}
.brand-text { font-size: 1.15rem; letter-spacing: .5px; }
nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--muted); font-weight: 600; }
nav a:hover { color: var(--orange-2); }
.inline { display: inline; margin: 0; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-weight: 600; }
.link-btn:hover { color: var(--orange-2); }

/* ---------- Layout ---------- */
.container { max-width: 920px; margin: 0 auto; padding: 32px 22px 60px; }
.site-footer { text-align: center; padding: 26px; color: var(--muted); border-top: 1px solid var(--line); font-size: .9rem; }
.shuriken { color: var(--orange); margin-right: 6px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-weight: 600; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 18px 0 30px; }
.hero h1 { font-size: 2.4rem; color: var(--orange); text-shadow: 0 2px 0 #7a3b10; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }
.empty { color: var(--muted); font-style: italic; text-align: center; padding: 40px; }

/* ---------- Cartes examens ---------- */
.grade-title { border-left: 4px solid var(--orange); padding-left: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.exam-card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; color: var(--text);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s;
}
.exam-card:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: 0 8px 24px rgba(0,0,0,.45); color: var(--text); }
.exam-card h3 { margin: 0 0 8px; color: var(--gold); font-size: 1.1rem; }
.exam-card p { color: var(--muted); font-size: .92rem; margin: 8px 0; }
.exam-meta { color: var(--orange-2); font-weight: 600; font-size: .85rem; }

.badge {
  display: inline-block; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--gold); padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.grade-pill {
  display: inline-block; background: var(--orange); color: #1c150f;
  padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem;
}

/* ---------- Formulaire examen ---------- */
.exam-head { margin-bottom: 24px; }
.exam-head h1 { margin-top: 10px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 0 0 22px; }
legend { color: var(--gold); padding: 0 8px; font-weight: 700; }

label { display: block; margin: 14px 0; font-weight: 600; color: var(--text); }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; margin-top: 6px; padding: 11px 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); font: inherit;
}
input.short { width: auto; min-width: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,123,37,.18); }
textarea { resize: vertical; }

.question { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 10px; padding: 16px 18px; margin: 16px 0; }
.q-text { font-weight: 700; margin: 0 0 12px; }
.q-num { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--orange); color: #1c150f; border-radius: 50%; font-size: .85rem; margin-right: 8px; }
.radio { display: flex; align-items: center; gap: 10px; font-weight: 400; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin: 7px 0; cursor: pointer; }
.radio:hover { border-color: var(--orange); }
.radio input { width: auto; margin: 0; }

/* ---------- Boutons ---------- */
.btn-primary, .btn-secondary, .btn-small, .btn-danger {
  display: inline-block; border: none; border-radius: 9px; cursor: pointer;
  font: inherit; font-weight: 700; padding: 12px 22px; transition: filter .12s, transform .12s;
}
.btn-primary { background: linear-gradient(180deg, var(--orange-2), var(--orange)); color: #1c150f; }
.btn-primary:hover { filter: brightness(1.08); color: #1c150f; }
.btn-secondary { background: var(--panel-2); color: var(--gold); border: 1px solid var(--line); padding: 10px 18px; }
.btn-secondary:hover { border-color: var(--orange); }
.btn-small { background: var(--panel-2); color: var(--orange-2); border: 1px solid var(--line); padding: 6px 12px; font-size: .85rem; }
.btn-small:hover { border-color: var(--orange); }
.btn-small.danger, .btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-danger { margin-top: 26px; }
.btn-small.danger:hover, .btn-danger:hover { background: var(--red); color: #fff; }

/* ---------- Merci / Login ---------- */
.merci, .login-box { text-align: center; max-width: 480px; margin: 30px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 36px; }
.login-box { text-align: left; }
.login-box label { text-align: left; }
.seal { width: 78px; height: 78px; margin: 0 auto 16px; border: 4px solid var(--leaf); color: var(--leaf); border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; }

/* ---------- Alertes ---------- */
.alert { padding: 12px 16px; border-radius: 9px; margin: 16px 0; font-weight: 600; }
.alert.error { background: rgba(192,57,43,.15); border: 1px solid var(--red); color: #ff9d8f; }
.alert.ok { background: rgba(76,175,80,.15); border: 1px solid var(--leaf); color: #9be39e; }

/* ---------- Tableaux MJ ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 22px; }
.filter { padding: 7px 15px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.filter.active, .filter:hover { background: var(--orange); color: #1c150f; border-color: var(--orange); }

table.data { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--panel-2); color: var(--gold); font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }
table.data tr:hover td { background: var(--bg-2); }
table.data small { color: var(--muted); }
.actions { white-space: nowrap; display: flex; gap: 6px; }

.status { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.status-en_attente { background: rgba(232,176,75,.18); color: var(--gold); }
.status-reussi { background: rgba(76,175,80,.2); color: #9be39e; }
.status-echoue { background: rgba(192,57,43,.2); color: #ff9d8f; }
.status-a_repasser { background: rgba(255,123,37,.2); color: var(--orange-2); }

/* ---------- Correction ---------- */
.answer-block { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 14px 0; }
.qcm-review { list-style: none; padding: 0; margin: 0; }
.qcm-review li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; background: var(--bg-2); }
.qcm-review li.correct { border-color: var(--leaf); }
.qcm-review li.chosen { background: rgba(255,123,37,.12); }
.tag { display: inline-block; margin-left: 8px; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--leaf); color: #10210f; font-weight: 700; }
.tag-c { background: var(--orange); color: #1c150f; }
.verdict { font-weight: 700; margin: 6px 0 0; }
.verdict.ok { color: #9be39e; } .verdict.ko { color: #ff9d8f; }
.text-answer { white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; color: var(--text); }

.correction-form, .exam-builder { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-top: 12px; }
.row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; }
.row > label { flex: 1; min-width: 180px; }
.grow { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: auto; margin: 0; }
.meta-line { color: var(--muted); font-size: .85rem; }
.hint { color: var(--muted); font-size: .9rem; }

/* ---------- Builder ---------- */
.q-builder { background: var(--bg-2); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 16px 18px; margin: 14px 0; }

/* ---------- Planning ---------- */
.timeline { border-left: 2px solid var(--line); margin: 14px 0 14px 8px; padding-left: 20px; }
.timeline.past { opacity: .7; }
.timeline-item { position: relative; margin: 0 0 18px; }
.timeline-item::before { content: ""; position: absolute; left: -27px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px var(--bg); }
.t-date { color: var(--gold); font-weight: 700; text-transform: capitalize; font-size: .92rem; }
.t-body { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Echelle des grades ---------- */
.grade-ladder { list-style: none; counter-reset: g; padding: 0; margin: 8px 0; }
.grade-ladder li { counter-increment: g; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 8px; padding: 9px 14px; margin: 6px 0; font-weight: 600; }
.grade-ladder li::before { content: counter(g) ". "; color: var(--gold); }

@media (max-width: 600px) {
  .brand-text { display: none; }
  .container { padding: 22px 14px 50px; }
  table.data { font-size: .88rem; }
}
