/* Pages des travaux pratiques (TP). Chargé après accueil.css. La couleur du module vient de --m. */
.tp-1 { --m: 24 48 190; --m2: #5a2ad6; }
.tp-2 { --m: 80 30 180; --m2: #8a3ffc; }
.tp-3 { --m: 168 52 10; --m2: #ff6242; }
.tp-4 { --m: 12 26 68; --m2: #2446ee; }
.tp-5 { --m: 0 84 150; --m2: #2446ee; }

/* En-tête */
.tp-head { position: relative; overflow: hidden; color: #fff; background: radial-gradient(50rem 34rem at 92% 100%, var(--m2), transparent 70%), linear-gradient(120deg, #2446ee, rgb(var(--m))); }
.tp-head .circuit { position: absolute; inset: 0; width: 100%; height: 100%; }
.circuit path, .circuit circle { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.c-fine { stroke: rgb(255 255 255 / .13); stroke-width: 2.5; }
.c-main { stroke: rgb(255 255 255 / .2); stroke-width: 4; }
.c-pulse { stroke: var(--yellow); stroke-width: 5; filter: drop-shadow(0 0 7px var(--yellow)); }
.c-pulse path { stroke-dasharray: 9 191; animation: c-run 4.4s linear var(--d) infinite; }
@keyframes c-run { from { stroke-dashoffset: 9; } to { stroke-dashoffset: -110; } }
.c-node { display: none; }
.tp-head .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(2.5rem, 4.5vw, 4rem); }
.tp-title { display: grid; gap: 1.2rem; justify-items: start; }
.tp-title a { font-weight: 600; }
.tp-title h1 { font-size: clamp(2.4rem, 4.8vw, 4.2rem); }
.tp-title p { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.45; }
.tp-facts { display: flex; flex-wrap: wrap; gap: .6rem; }
.tp-facts li { padding: .4rem 1rem; border-radius: 99px; background: rgb(255 255 255 / .16); font-weight: 600; }
.tp-chip { --pin: 13px; position: relative; isolation: isolate; border-radius: 1.6rem; box-shadow: 0 2rem 4.5rem rgb(8 10 70 / .45); }
.tp-chip::before, .tp-chip::after { content: ""; position: absolute; z-index: -1; }
.tp-chip::before { inset: 2rem calc(var(--pin) * -1); background: repeating-linear-gradient(#f3c544 0 9px, transparent 9px 21px); }
.tp-chip::after { inset: calc(var(--pin) * -1) 2rem; background: repeating-linear-gradient(90deg, #f3c544 0 9px, transparent 9px 21px); }
.tp-chip img { width: 100%; aspect-ratio: 4 / 3; border: .6rem solid #fff; border-radius: inherit; object-fit: cover; }

/* Étapes */
.tp { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem); }
.tp-nav { position: sticky; top: 6.5rem; align-self: start; }
.tp-nav p { font-weight: 600; }
.tp-bar { display: block; height: .7rem; margin: .6rem 0 1.4rem; overflow: hidden; border-radius: 99px; background: #e3eafa; }
.tp-bar i { display: block; width: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgb(var(--m)), var(--m2)); transition: width .4s; }
.tp-nav ol { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; counter-reset: n; }
.tp-nav li { counter-increment: n; }
.tp-nav a { display: flex; align-items: center; gap: .8rem; padding: .5rem .7rem; border-radius: .9rem; line-height: 1.25; text-decoration: none; }
.tp-nav a::before { content: counter(n); flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .7rem; background: #e8edfb; font-weight: 800; }
.tp-nav a:hover { background: #f1f4fd; }
.tp-nav a[aria-current] { background: rgb(var(--m)); color: #fff; font-weight: 600; }
.tp-nav a[aria-current]::before { background: #fff; color: rgb(var(--m)); }
.tp-nav .is-done::before { content: "✓"; background: var(--yellow) !important; color: var(--ink) !important; }
.tp-step { scroll-margin-top: 6.5rem; }
.tp-step + .tp-step { margin-top: 4rem; }
.js .tp-step + .tp-step { margin-top: 0; }
.tp-step > h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); }
.tp-step > p { max-width: 46rem; margin-top: 1rem; }
.tp-step > .big { font-size: clamp(1.2rem, 1.7vw, 1.4rem); line-height: 1.45; }
.tp-step ol.do { display: grid; gap: .9rem; max-width: 46rem; margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: d; }
.do li { counter-increment: d; position: relative; padding-left: 3.1rem; min-height: 2.2rem; }
.do li::before { content: counter(d); position: absolute; left: 0; top: -.1rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: rgb(var(--m)); color: #fff; font-weight: 800; }
kbd, code { padding: .12em .45em; border-radius: .4rem; background: #e8edfb; font: 600 .95em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; }
code { overflow-wrap: anywhere; }
.alert { max-width: 46rem; margin-top: 1.5rem !important; padding: 1rem 1.25rem; border-radius: 1rem; background: #fff3cd; }
.alert b { color: #7a3d00; }
.tp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1.1rem; margin-top: 1.75rem; }
.tp-cards li { min-width: 0; padding: 1.5rem; border-radius: 1.4rem; background: #f1f4fd; line-height: 1.45; }
.tp-cards li > b:first-child { display: block; margin-bottom: .5rem; font-size: 1.4rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tp-cards .btn { display: table; margin-top: 1rem; }
.tp-photo { margin: 1.75rem 0 0; max-width: 46rem; }
.tp-photo img { width: 100%; border-radius: 1.4rem; }
.tp-photo figcaption { margin-top: .5rem; color: var(--ink-2); font-size: 1rem; }
.tp-go { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }
.tp-go .btn { background: rgb(var(--m)); }
.tp-go .btn:hover { background: var(--ink); }
.tp-go .btn--line { background: transparent; color: var(--ink); }
.tp-go .btn--line:hover { color: #fff; }

/* Simulateurs */
.sim { margin-top: 1.75rem; padding: clamp(1.2rem, 2.6vw, 2.2rem); border-radius: 1.75rem; background: linear-gradient(140deg, #eaf0ff, #f3edff); }
.sim h3 { font-size: 1.5rem; }
.sim h3 + p { margin-top: .4rem; color: var(--ink-2); }
.sim-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.1rem; }
.sim-row > span { flex: 0 0 8rem; font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: .5rem; }
.seg button { min-height: 2.9rem; padding: .4rem 1.1rem; border: 2px solid #c9d4f3; border-radius: .9rem; background: #fff; color: var(--ink); line-height: 1.2; cursor: pointer; }
.seg button:hover { border-color: rgb(var(--m)); }
.seg button[aria-pressed="true"] { border-color: rgb(var(--m)); background: rgb(var(--m)); color: #fff; font-weight: 600; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.slide { display: grid; grid-template-columns: 8rem minmax(0, 1fr) 6.5rem; align-items: center; gap: .9rem; margin-top: 1.2rem; }
.slide label { font-weight: 600; line-height: 1.2; }
.slide input { width: 100%; min-height: 2.2rem; accent-color: rgb(var(--m)); cursor: pointer; }
.slide output { font-size: 1.35rem; font-weight: 800; text-align: right; white-space: nowrap; }
.share { display: flex; gap: 4px; height: 4rem; margin-top: 1.5rem; overflow: hidden; border-radius: 1rem; background: #fff; }
.share div { display: grid; place-items: center; overflow: hidden; background: var(--ink); color: #fff; font-weight: 600; line-height: 1.15; text-align: center; white-space: nowrap; transition: width .3s; }
.share .vm { background: var(--yellow); color: var(--ink); }
.say { display: block; margin-top: 1.3rem; padding: .95rem 1.25rem; border-radius: 1rem; background: #fff; line-height: 1.45; }
.say.ok { background: #d8f5e3; color: #0a4a28; font-weight: 600; }
.say.no { background: #ffe1d8; color: #7a1f05; font-weight: 600; }
.screen { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; align-content: center; gap: 1rem; min-height: 15rem; margin-top: 1.4rem; padding: 1.5rem; border: .8rem solid #1b2340; border-radius: 1.4rem; background: #070d22; color: #fff; text-align: center; transition: background-color .3s; }
.screen strong { font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.2; }
.screen.good { background: linear-gradient(135deg, #14803f, #0b5a5e); }
.screen.bad { background: #123a9c; }
.screen .seg { justify-content: center; }
.boot { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; flex: 1 1 18rem; max-width: 26rem; }
.boot li { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem .45rem 1rem; border-radius: .9rem; background: #fff; line-height: 1.2; }
.boot li span { flex: 1; font-weight: 600; }
.boot.off { opacity: .5; }
.boot button { width: 2.6rem; height: 2.6rem; border: 0; border-radius: .7rem; background: #e8edfb; color: var(--ink); font-weight: 800; cursor: pointer; }
.boot button:hover:not(:disabled) { background: var(--yellow); }
.boot button:disabled { opacity: .35; cursor: default; }
.switch { display: inline-flex; align-items: center; gap: .8rem; min-height: 2.9rem; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; position: relative; width: 3.6rem; height: 2rem; margin: 0; border-radius: 99px; background: #aeb9d6; cursor: pointer; transition: background-color .2s; }
.switch input::after { content: ""; position: absolute; left: .2rem; top: .2rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; transition: translate .2s; }
.switch input:checked { background: rgb(var(--m)); }
.switch input:checked::after { translate: 1.6rem 0; }
.switch input:disabled { opacity: .45; cursor: not-allowed; }
.host { display: grid; gap: 1rem; margin-top: 1.75rem; padding: 1.4rem; border-radius: 1.75rem; background: var(--ink); color: #fff; }
.host > b { font-size: 1.3rem; }
.host ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.host li { display: grid; place-items: center; gap: .2rem; min-height: 7rem; padding: 1rem .5rem; border-radius: 1.1rem; background: linear-gradient(140deg, #2446ee, #8a3ffc); line-height: 1.25; text-align: center; }
.host li b { font-size: 1.25rem; }
.task { max-width: 34rem; margin-top: 1.75rem; overflow: hidden; border: 2px solid #d5ddf0; border-radius: 1.2rem; }
.task p { padding: .8rem 1.2rem; background: #eef2fc; font-weight: 600; }
.task dl { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; margin: 0; padding: 1rem 1.2rem; }
.task dt, .task dd { margin: 0; padding: .3rem .6rem; }
.task dd { font-weight: 600; }
.task .on { background: var(--yellow); font-weight: 800; }
.task dt.on { border-radius: .6rem 0 0 .6rem; margin-right: -1rem; }
.task dd.on { border-radius: 0 .6rem .6rem 0; }

.screen strong, .screen p { max-width: 100%; overflow-wrap: anywhere; }
.term-win { margin-top: 1.4rem; padding: 1.2rem; border-radius: 1.2rem; background: #0a1024; color: #d8f5e3; font: 500 1.05rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; cursor: text; }
.term-log { max-height: 20rem; margin: 0; overflow: auto; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.term { display: flex; gap: .6rem; align-items: center; }
.term label { color: var(--yellow); white-space: nowrap; }
.term input { flex: 1; min-width: 0; min-height: 2.6rem; padding: 0; border: 0; background: none; color: #fff; font: inherit; }
.term input:focus { outline: 0; }
.term-win:focus-within { outline: 3px solid var(--yellow); outline-offset: 2px; }
.tri-card { display: grid; place-items: center; min-height: 8.5rem; margin: 1.3rem 0 1rem; padding: 1.2rem; border-radius: 1.3rem; background: var(--ink); color: #fff; font-size: clamp(1.3rem, 2.2vw, 1.8rem); line-height: 1.25; text-align: center; }
.done-list { display: grid; gap: .5rem; margin: 1.2rem 0 0; padding: 0; list-style: none; counter-reset: o; }
.done-list li { counter-increment: o; padding: .6rem 1.1rem; border-radius: .9rem; background: #d8f5e3; color: #0a4a28; font-weight: 600; }
.done-list li::before { content: counter(o) ". "; }
.parts-name { margin-top: 1.3rem !important; font-weight: 600; }
.parts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.part { display: grid; align-content: center; min-height: 4.6rem; padding: .5rem .8rem; border: 3px solid transparent; border-radius: .9rem; background: #2446ee; color: #fff; line-height: 1.25; text-align: left; cursor: pointer; flex-basis: 7.5rem; }
.part.free { background: repeating-linear-gradient(45deg, #fff 0 10px, #e8edfb 10px 20px); color: var(--ink); }
.part.sel { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--ink); }
.share .efi { background: #5a2ad6; }
.proc { display: grid; gap: .5rem; margin-top: 1.3rem; }
.proc-row { display: grid; grid-template-columns: 1fr auto auto; gap: .4rem 1.4rem; padding: .8rem 1.1rem; border: 3px solid transparent; border-radius: .9rem; background: #fff; color: var(--ink); line-height: 1.25; text-align: left; cursor: pointer; }
.proc-row.sel { border-color: rgb(var(--m)); }
.proc-row .hot { color: #b3260a; font-weight: 800; }
.net { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: .8rem; margin-top: 1.4rem; }
.net li { display: grid; gap: .3rem; align-content: start; padding: 1.2rem; border-radius: 1.2rem; line-height: 1.3; transition: background-color .3s; }
.net b { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.net .yes { background: #d8f5e3; color: #0a4a28; }
.net .nope { background: #ffe1d8; color: #7a1f05; }
.field { display: grid; gap: .4rem; margin-top: 1.2rem; }
.field label { font-weight: 600; }
.field input, .field textarea { width: 100%; padding: .8rem 1rem; border: 2px solid #c9d4f3; border-radius: .9rem; background: #fff; color: var(--ink); font: inherit; line-height: 1.4; resize: vertical; }
.field ::placeholder { color: #5d6a88; }

/* Étapes en images : captures d'écran, endroit à cliquer entouré (position en % de l'image) */
.steps { display: grid; gap: clamp(2.25rem, 4vw, 3.25rem); max-width: 56rem; margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: d; }
.steps > li { counter-increment: d; min-width: 0; }
.steps p { position: relative; display: flex; align-items: center; min-height: 2.6rem; padding-left: 3.6rem; font-size: 1.15rem; line-height: 1.4; }
.steps p > span { min-width: 0; }
.steps p::before { content: counter(d); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .85rem; background: rgb(var(--m)); color: #fff; font-weight: 800; }
.cap { position: relative; display: block; width: 100%; margin-top: 1rem; padding: 0; overflow: hidden; border: 0; border-radius: 1.3rem; background: #dfe7fa; box-shadow: 0 1rem 2.8rem rgb(15 29 69 / .18); font: inherit; cursor: zoom-in; }
.cap img { display: block; width: 100%; height: auto; }
.cap i { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: calc(var(--w) * 1%); height: calc(var(--h) * 1%); border-radius: .4rem; box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px var(--ink); pointer-events: none; }
.steps--duo, .steps--pair { grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)); max-width: none; align-items: end; }
.steps--pair { align-items: start; }
.steps--pair > li:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: 56rem; }
.steps--duo > li:first-child { grid-column: 1 / -1; max-width: 56rem; }
.steps .small { width: min(100%, var(--max, 34rem)); }
.zoom { width: 100%; height: 100%; max-width: none; max-height: none; padding: 0; border: 0; background: rgb(8 14 40 / .93); }
.zoom::backdrop { background: transparent; }
.zoom > div { display: grid; place-items: center; min-width: 100%; min-height: 100%; width: max-content; padding: 1rem; }
.zoom .cap { width: max-content; max-width: none; margin: 0; cursor: zoom-out; box-shadow: none; }
.zoom .cap img { width: min(94vw, 82rem, var(--big, 82rem)); }
.zoom > button { position: fixed; right: 1rem; top: 1rem; z-index: 1; background: var(--yellow); color: var(--ink); }
@media (max-width: 36rem) { .zoom .cap img { width: min(44rem, var(--big, 44rem)); } .steps .cap i { box-shadow: 0 0 0 2px var(--yellow), 0 0 0 3px var(--ink); } }

/* Exercice noté */
.quiz { display: grid; gap: 2rem; margin-top: 1.75rem; }
.quiz fieldset { min-width: 0; padding: 0; border: 0; }
.quiz legend { padding: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.quiz label { display: flex; align-items: center; gap: .9rem; min-height: 3.2rem; margin-top: .6rem; padding: .6rem 1.1rem; border: 2px solid #d5ddf0; border-radius: 1rem; line-height: 1.3; cursor: pointer; }
.quiz label:hover { border-color: rgb(var(--m)); }
.quiz label:has(:checked) { border-color: rgb(var(--m)); background: #eef2fc; }
.quiz input { flex: none; width: 1.3rem; height: 1.3rem; margin: 0; accent-color: rgb(var(--m)); }
.quiz label.good { border-color: #14803f; background: #d8f5e3; }
.quiz label.wrong { border-color: #c03a12; background: #ffe1d8; }
.note { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 1.75rem; padding: 1.5rem; border-radius: 1.5rem; background: #f1f4fd; }
.note strong { font-size: 3.2rem; line-height: 1; }
.note.good { background: #d8f5e3; }

@media (max-width: 62rem) {
  .tp-head .wrap { grid-template-columns: 1fr; }
  .tp-chip { display: none; }
  .tp { grid-template-columns: minmax(0, 1fr); }
  .tp-nav { position: static; min-width: 0; }
  .tp-nav ol { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; }
  .tp-nav li { flex: none; }
  .tp-nav a { padding: .3rem; }
  .tp-nav a span { display: none; }
  .tp-nav a[aria-current] span { display: inline; padding-right: .6rem; }
  .tp-bar { margin-bottom: 1rem; }
}
@media (max-width: 36rem) {
  .proc-row { grid-template-columns: 1fr; }
  .seg button { flex: 0 1 auto; text-align: left; }
  .slide { grid-template-columns: 1fr auto; gap: .3rem 1rem; }
  .slide input { grid-column: 1 / -1; grid-row: 2; }
  .sim-row > span { flex-basis: 100%; }
  .host ul { grid-template-columns: 1fr; }
  .host li { min-height: 4.5rem; }
  .tp-go .btn { flex: 1 1 100%; text-align: center; }
  .share div { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .c-pulse { display: none; } }
.tp-step > h3 { margin-top: 2.5rem; font-size: 1.5rem; }

/* Schémas des câbles réseau */
.net-svg { display: flex; flex-wrap: wrap; gap: 1rem 2rem; max-width: 46rem; margin-top: 1.5rem; padding: 1rem; border-radius: 1rem; background: #fff; box-shadow: 0 0 0 2px #e4e9f5; }
.net-svg svg { display: block; flex: 1 1 15rem; min-width: 0; height: auto; max-width: 22rem; margin: auto; }
.net-svg p { flex: 1 1 100%; margin: 0; text-align: center; color: var(--ink-2); }
.net-svg text { fill: #0f1d45; font-family: inherit; }
.net-svg .n-t { font-size: 30px; font-weight: 800; text-anchor: middle; }
.net-svg .n-p { font-size: 15px; font-weight: 800; text-anchor: middle; }
.net-svg .n-l { font-size: 24px; }
.net-svg .n-s { font-size: 19px; text-anchor: middle; }
