/* LearnPath: trainee-facing pages (entry, password, and the path's pages). Same base tokens, buttons and inputs as every other module's trainee
   style.css - copied here (rather than shared) since each module's index.php is fully self-contained. */

:root {
  --blue: #2178ba;
  --blue-dark: #1a5683;
  --teal: #3ec1d5;
  --text: #212529;
  --muted: #6c757d;
  --line: #dee2e6;
  --bg: #f4f7fa;
  --danger: #dc3545;
  --ok: #198754;
  --surface: #fff;
  --surface-alt: #eaf3fa;
  --input-border: #b9c4cf;
  --notice-error-text: #842029;
  --qb-score-neutral: #bcd9ef;
  --qb-score-right: #9fd8b0;
  --qb-score-wrong: #f3b3b9;
  --badge-text: #010030;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.4;
}

a { color: var(--blue); }
h1 { margin: 0 0 0.4em; color: var(--blue-dark); }
h2 { margin: 0 0 0.4em; color: var(--blue-dark); font-size: 1.1rem; }

.btn {
  font: inherit;
  padding: 0.45em 1em;
  border: 1px solid var(--blue);
  background: #fff;
  color: var(--blue);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #eaf3fa; }
.btn:disabled { opacity: 0.6; cursor: default; }
.lp-fs-lock { overflow: hidden; }
.lp-slideshow.lp-fs { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; box-sizing: border-box; width: 100%; height: 100%; padding: 1rem 1.5rem; background: var(--bg); overflow: hidden; }
.lp-slideshow.lp-fs .lp-slides-frame { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.lp-slideshow.lp-fs .lp-slides { flex: 1 1 auto; min-height: 0; max-height: none !important; }
.lp-slideshow.lp-fs .lp-slide { justify-content: safe center; }
.lp-slideshow.lp-fs .lp-slide > .lp-box { flex: 0 1 auto; }
.lp-slideshow.lp-fs:not(.lp-fs-scaled) .lp-slide > * { width: 100%; max-width: 70rem; align-self: center; }
.lp-slideshow.lp-fs .lp-slide { scrollbar-gutter: stable; }
.lp-slideshow.lp-fs.lp-fs-scaled .lp-slide > * { zoom: var(--lp-fs-zoom); }
.lp-slideshow.lp-fs .lp-slide-controls { flex: none; }
.lp-toast { z-index: 2000; position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); max-width: min(90vw, 28rem); padding: 0.7rem 1rem; border-radius: 8px; background: #010030; color: #fff; font-size: 0.95rem; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
.lp-toast[hidden] { display: none; }
.lp-need { outline: 2px solid var(--danger); outline-offset: 4px; border-radius: 6px; }
.lp-unlock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lp-unlock-input { width: 12em; max-width: 100%; margin: 0; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.small { padding: 0.25em 0.7em; font-size: 0.9rem; }
.btn.big { font-size: 1.2rem; padding: 0.6em 1.6em; margin-top: 1rem; }

.hint { color: var(--muted); font-size: 0.9rem; }
.notice { padding: 0.7em 1em; border-radius: 6px; margin: 0 0 1em; }
.notice.error { background: #fdecee; color: #842029; border: 1px solid #f1b0b7; }

input[type=text], input[type=password] {
  font: inherit;
  width: 100%;
  padding: 0.45em 0.6em;
  border: 1px solid #b9c4cf;
  border-radius: 6px;
  background: #fff;
}
input:focus { outline: 2px solid var(--teal); outline-offset: 0; }
label { display: block; font-weight: 600; margin: 0.9em 0 0.3em; text-align: left; }

/* ---------- Entry ---------- */

body.page { padding: 4vh 16px; }
.card-panel {
  margin: 0 auto;
  background: #fff;
  padding: 28px 32px;
  border-radius: 12px;
  border-top: 5px solid var(--blue);
  box-shadow: 0 4px 24px rgba(1, 0, 48, 0.1);
}
.card-panel.narrow { max-width: 420px; }
.brand-h1 { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { height: 1.3em; width: auto; border-radius: 4px; vertical-align: middle; }

.aside-panel {
  max-width: 420px;
  margin: 24px auto 0;
  padding: 20px 32px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.aside-panel p { margin: 0 0 0.8em; color: var(--muted); }

/* ---------- A page of the path ---------- */

body.lp-view { padding: 3vh 16px 6vh; }
.lp-wrap { --lp-width: 820px; width: 100%; max-width: var(--lp-width); margin: 0 auto; }
.lp-wrap.lp-w-wider { --lp-width: 1200px; }
.lp-wrap.lp-w-widest { --lp-width: 1600px; }
.lp-header { margin-bottom: 1.4em; }
.lp-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.lp-header-top h1 { flex: 1 1 auto; min-width: 0; line-height: 1.1; min-height: 1.1em; margin-top: -0.12em; }
.lp-header-btns { flex: 0 0 auto; margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lp-subtitle { font-size: 1.2rem; font-weight: 500; color: var(--text); }
.lp-rich :first-child { margin-top: 0; }
.lp-rich :last-child { margin-bottom: 0; }
.lp-rich ul, .lp-rich ol { margin: 0.5em 0; padding-left: 1.4em; }
.lp-rich table { border-collapse: collapse; }
.lp-rich td, .lp-rich th { border: 1px solid var(--line); padding: 0.3em 0.6em; }

.lp-sections { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; }
.lp-sec { flex: 0 0 100%; max-width: 100%; min-width: 0; }
.lp-sec.lp-half { flex: 0 0 calc(50% - 7px); max-width: calc(50% - 7px); }
.lp-pending { display: none; }
.lp-pending.lp-locked { display: block; position: relative; min-height: 4.5em; }
.lp-locked > .lp-container > .lp-children > .lp-sec.lp-pending:first-child { display: block; }
.lp-locked .lp-tabpanels > .lp-tabpanel:first-child { display: block; }
.lp-locked * { visibility: hidden !important; }
.lp-locked > .lp-lock, .lp-locked > .lp-lock * { visibility: visible !important; }
.lp-lock { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px; }

/* How a section is drawn (its Appearance style, Line colour and Section colour settings: --lp-line and the background are set inline). The box shape is the same whichever style. */
.lp-sec { padding: 14px; border: 1px solid transparent; border-radius: 10px; }
.lp-sec.lp-ap-bordered { border-color: var(--lp-line, var(--line)); }
.lp-sec.lp-ap-separator { position: relative; }
.lp-sec.lp-ap-separator::after { content: ''; position: absolute; left: 0; right: 0; bottom: -8px; border-bottom: 1px solid var(--lp-line, var(--line)); }
.lp-sec.lp-ap-separator.lp-clip { border-bottom-color: var(--lp-line, var(--line)); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }   /* a scrolling or clipping box would cut the line off below it */
.lp-sec.lp-ap-separator.lp-clip::after { display: none; }
@media (max-width: 700px) {
  .lp-sec.lp-half { flex: 0 0 100%; max-width: 100%; }
}

.lp-appear { animation: lp-in 0.9s ease both; }
.lp-unlocking > * { animation: lp-in 0.9s ease both; }
@keyframes lp-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lp-appear, .lp-unlocking > * { animation: none; } }

.lp-sec-title { margin: 0 0 0.4em; font-size: 1.05rem; }

.lp-box { display: flex; align-items: flex-start; gap: 14px; border-radius: 10px; padding: 16px; color: #212529; }
.lp-box a { color: #2178ba; }
.lp-box-img { flex: 0 0 auto; max-width: 33%; height: auto; display: block; border-radius: 6px; }
.lp-box-text { flex: 1 1 auto; min-width: 0; }

.lp-img { display: flex; }
.lp-img.lp-align-centre { justify-content: center; }
.lp-img.lp-align-right { justify-content: flex-end; }
.lp-img img { width: auto; height: auto; display: block; border-radius: 6px; }

.lp-video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.lp-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lp-nav-desc { margin-bottom: 0.7em; }
.lp-nav-btn { font-size: 1.05rem; padding: 0.55em 1.4em; display: inline-block; width: auto; max-width: 100%; }
.lp-nav-row { display: flex; justify-content: flex-start; }
.lp-nav-row.lp-nav-centre { justify-content: center; }
.lp-nav-row.lp-nav-right { justify-content: flex-end; }
.lp-nav-row.lp-nav-full .lp-nav-btn { width: 100%; }

.lp-container { container: lpc / inline-size; }
@container lpc (max-width: 520px) {
  .lp-children > .lp-sec.lp-half { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 701px) {
  .lp-layout-tight #lp-root { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 0; grid-auto-rows: 1px; align-items: start; }
  .lp-layout-tight #lp-root > .lp-sec { grid-column: 1 / -1; align-self: start; max-width: none; }
  .lp-layout-tight #lp-root > .lp-sec.lp-half { grid-column: var(--lp-col, 1); }
}
@container lpc (min-width: 521px) {
  .lp-layout-tight .lp-children { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 0; grid-auto-rows: 1px; align-items: start; }
  .lp-layout-tight .lp-children > .lp-sec { grid-column: 1 / -1; align-self: start; max-width: none; }
  .lp-layout-tight .lp-children > .lp-sec.lp-half { grid-column: var(--lp-col, 1); }
}

.lp-progress { width: min(100%, 240px); height: 2.4em; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.lp-progress-fill { height: 100%; width: 0; background: var(--teal); }

[hidden] { display: none !important; }

.lp-slides { display: grid; grid-template-rows: minmax(0, 1fr); }
.lp-slides-frame { position: relative; }
.lp-slide-start { position: absolute; top: 0; left: 0; z-index: 2; }
.lp-group-slot { margin-top: 10px; }
.lp-group-slot:empty { display: none; }
.lp-slide { grid-area: 1 / 1; align-self: stretch; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; max-width: 100%; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.lp-slide > .lp-box { flex: 1 1 auto; }
.lp-slide.lp-current { opacity: 1; visibility: visible; transition: opacity 0.3s ease 0.3s, visibility 0s linear 0.3s; }
@media (prefers-reduced-motion: reduce) { .lp-slide, .lp-slide.lp-current { transition: none; } }
.lp-slide-controls.lp-has-fs { grid-template-columns: 1fr auto 1fr auto; }
.lp-fs-btn { grid-column: 4; grid-row: 1; justify-self: end; }
.lp-slide-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 12px; min-height: 2.6em; }
.lp-slide-prev { grid-column: 1; grid-row: 1; justify-self: start; }
.lp-slide-pause { grid-column: 2; grid-row: 1; justify-self: center; }
.lp-slide-next { grid-column: 3; grid-row: 1; justify-self: end; display: flex; justify-content: flex-end; width: 100%; }

.lp-sec[data-qb-empty="1"] { display: none !important; }
.lp-quiz { margin: 0; }
.lp-quiz input[type=date], .lp-quiz input[type=number], .lp-quiz textarea { font: inherit; width: 100%; padding: 0.45em 0.6em; border: 1px solid var(--input-border); border-radius: 6px; background: var(--surface); color: var(--text); }
.lp-quiz input[type=text] { border-color: var(--input-border); background: var(--surface); color: var(--text); }
.lp-quiz textarea { min-height: 7em; resize: vertical; }
.lp-quiz select { font: inherit; max-width: 100%; padding: 0.45em 0.6em; border: 1px solid var(--input-border); border-radius: 6px; background: var(--surface); color: var(--text); }
.lp-quiz input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex: none; cursor: pointer; vertical-align: middle; }
.lp-quiz label { margin: 0; }
.lp-quiz label.qb-label { margin: 0 0 0.6rem; }
.lp-quiz textarea:focus, .lp-quiz select:focus { outline: 2px solid var(--teal); outline-offset: 0; }
.lp-review { margin: 1.6em 0 0; text-align: center; }
.lp-review h3 { margin: 0 0 0.6em; font-size: 1rem; }
.lp-review-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.lp-end { margin: 1.6em 0 0; text-align: center; }
.lp-end p { margin: 0 0 0.8em; color: var(--muted); font-style: italic; }

.lp-resume { margin-top: 2.5em; text-align: right; }
.lp-resume-rule { padding-top: 1.2em; border-top: 1px solid var(--line); }
.lp-resume h3 { margin: 0 0 0.5em; font-size: 1rem; }

@media (max-width: 480px) {
  .lp-box { flex-direction: column; }
  .lp-box-img { max-width: 60%; }
  .lp-header-top h1 { font-size: 1.6rem; }
}

.org-logo { display: block; margin: 50px auto 20px; max-width: min(100%, 300px); height: auto; }

/* ---------- Tabbed container ---------- */

/* The tabs are placed by view.js (left / width in pixels): the current one is widest and sits along the bar in proportion to progress,
   the rest are one shared width either side. The current tab's fill runs on into its section, which is why it overlaps the section's top edge. */
.lp-tabbar { display: flex; align-items: flex-start; gap: 6px; }
.lp-tabs { position: relative; flex: 1 1 auto; min-width: 0; height: 2.7em; }
.lp-tab-prev, .lp-tab-next { flex: 0 0 auto; align-self: stretch; margin-bottom: 3px; padding: 0 0.7em; }
.lp-tab {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2em;
  margin: 0;
  padding: 0 0.7em;
  display: flex;
  align-items: center;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--tab-bg, #fff);
  border: 1px solid var(--tab-line, var(--line));
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  transition: left 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}
.lp-tab:hover:not(.lp-tab-current) { filter: brightness(0.95); }
.lp-tab.lp-tab-current { height: 2.7em; bottom: -1px; z-index: 3; font-size: 1rem; font-weight: 600; border-radius: 10px 10px 0 0; cursor: default; }
.lp-tab-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.lp-tab.lp-tab-notext { padding: 0; }
.lp-tab.lp-tab-notext .lp-tab-text { visibility: hidden; }
.lp-tab.lp-tab-off { opacity: 0; pointer-events: none; }
.lp-tab-probe { visibility: hidden; pointer-events: none; width: max-content; transition: none; }
.lp-tabs-instant .lp-tab { transition: none; }
.lp-tab-more { position: absolute; bottom: 0; width: 18px; text-align: center; color: var(--muted); line-height: 2em; pointer-events: none; transition: opacity 0.3s ease; }
.lp-tabs-instant .lp-tab-more { transition: none; }
.lp-tab:focus-visible { outline: 2px solid var(--teal); outline-offset: -3px; }

.lp-tabpanels { position: relative; }
.lp-tabpanel { display: none; max-width: 100%; min-width: 0; max-height: var(--lp-max, none); overflow-y: auto; }
.lp-tabpanel.lp-current { display: block; animation: lp-tab-in 0.3s ease both; }
.lp-tabpanel.lp-tab-animating { overflow: hidden; max-height: none; transition: height 0.3s ease; }
@keyframes lp-tab-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lp-tab, .lp-tab-more, .lp-tabpanel.lp-tab-animating { transition: none; }
  .lp-tabpanel.lp-current { animation: none; }
}

.lp-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); padding: 16px; }
.lp-modal[hidden] { display: none; }
.lp-modal-box { position: relative; display: flex; flex-direction: column; width: 560px; max-width: 100%; max-height: 85vh; background: #fff; border-radius: 10px; padding: 24px 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); }
.lp-modal-box h2 { flex: none; margin: 0 0 0.6em; padding-right: 2em; font-size: 1.25rem; }
.lp-modal-x { position: absolute; top: 6px; right: 10px; border: 0; background: none; color: var(--text); font-size: 28px; line-height: 1; cursor: pointer; }
.lp-modal-foot { flex: none; margin-top: 16px; text-align: right; display: flex; justify-content: flex-end; gap: 8px; }
.lp-modal-box.lp-modal-small { width: 440px; }
.lp-modal-box p { margin: 0; }
.lp-history-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.lp-history-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lp-history-table td { padding: 8px 12px; border: 0; vertical-align: middle; }
.lp-history-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-history-open { width: 6em; text-align: right; }
.lp-history-stuck td { border-bottom: 2px solid #8b0000; }
.lp-history-stuck td:last-child { border-right: 2px solid #8b0000; }

b, strong { font-weight: 600; }
