/* ═══════════════════════════════════════════════════════════
   AI Guide Academy — Replication Report
   Single shared stylesheet for the one-page report.
   (Replaces the per-page inline CSS that used to be duplicated
    across Index/pipeline/step1–6.)
═══════════════════════════════════════════════════════════ */

:root {
  --tum-blue:        #0065BD;
  --tum-blue-dark:   #004f96;
  --tum-blue-light:  #e8f1fb;
  --tum-blue-mid:    #cce0f5;
  --accent:          #64a8e0;
  --text:            #1a2638;
  --muted:           #5a6a7a;
  --white:           #ffffff;
  --border:          #d0dde9;
  --warn-bg:         #fffbeb;
  --warn-border:     #f59e0b;
  --warn-text:       #b45309;
  --radius:          12px;
  --radius-sm:       8px;
  --shadow:          0 2px 12px rgba(0, 101, 189, 0.10);
  --shadow-hover:    0 6px 24px rgba(0, 101, 189, 0.18);
  --transition:      0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #dcf8e5 0%, #b8d2fa 100%) fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Bilingual visibility toggle (encapsulated in i18n.js) ───── */
html[data-lang="de"] .lng-en { display: none !important; }
html[data-lang="en"] .lng-de { display: none !important; }

/* ── Corner branding (absolute → scrolls away with the page,
      so it never fights the sticky phase-nav) ───────────────── */
.master-tum-logo {
  position: absolute; top: 20px; left: 30px;
  height: 50px; width: auto; z-index: 1000; pointer-events: none;
}
.master-institution {
  position: absolute; top: 20px; right: 30px;
  text-align: right; line-height: 1.5; z-index: 1000; pointer-events: none;
}
.master-institution .inst-primary {
  display: block; font-size: 0.95rem; font-weight: 700; color: #1a2638;
}
.master-institution .inst-secondary {
  display: block; font-size: 0.85rem; font-weight: 400; color: #3a4a5c;
}
.master-bottom-left, .master-bottom-right {
  position: fixed; bottom: 0; z-index: 0; pointer-events: none; display: block;
}
.master-bottom-left  { left: 0; }
.master-bottom-right { right: 0; }

/* ── Language toggle (floating, bottom-right on all sizes) ──── */
.lang-toggle {
  position: fixed; bottom: 18px; right: 22px; z-index: 1001;
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.92); padding: 4px; border-radius: 99px;
  box-shadow: var(--shadow-hover); backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  /* gentle attention pulse on load, then stops */
  animation: langPulse 1.7s ease-in-out 0.9s 3;
}
@keyframes langPulse {
  0%, 100% { transform: scale(1);    box-shadow: var(--shadow-hover); }
  50%      { transform: scale(1.07); box-shadow: 0 0 0 6px rgba(0,101,189,0.16), var(--shadow-hover); }
}
@media (prefers-reduced-motion: reduce) { .lang-toggle { animation: none; } }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.78rem; font-weight: 700;
  color: var(--muted); padding: 5px 11px; border-radius: 99px;
  transition: background var(--transition), color var(--transition);
}
.lang-btn:hover { color: var(--tum-blue-dark); }
.lang-btn.active { background: var(--tum-blue); color: #fff; }
.lang-btn .flag { width: 18px; height: auto; border-radius: 2px; display: block; }

/* ── Content frame ──────────────────────────────────────────── */
.master-content {
  position: relative; z-index: 9;
  max-width: 880px; margin: 0 auto;
  padding: 132px 1.5rem 120px;
}
@media (max-width: 768px) {
  .master-tum-logo { height: 36px; left: 16px; top: 14px; }
  .master-institution { right: 16px; top: 14px; }
  .master-institution .inst-primary  { font-size: 0.78rem; }
  .master-institution .inst-secondary { font-size: 0.7rem; }
  .master-bottom-left, .master-bottom-right { display: none; }
  .lang-toggle { top: auto; bottom: 14px; right: 14px; }
  .master-content { padding: 92px 1.1rem 90px; }
}

/* ── Phase nav (sticky in-page jump bar) ────────────────────── */
.phase-nav {
  position: sticky; top: 12px; z-index: 50;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 99px;
  padding: 7px; margin-bottom: 2.5rem; box-shadow: var(--shadow);
}
.phase-nav a {
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  color: var(--muted); padding: 7px 15px; border-radius: 99px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.phase-nav a:hover { background: var(--tum-blue-light); color: var(--tum-blue-dark); }
.phase-nav a .pn-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-right: 5px; border-radius: 50%;
  background: var(--tum-blue); color: #fff; font-size: 0.68rem;
}
@media (max-width: 560px) {
  .phase-nav { gap: 3px; padding: 5px; }
  .phase-nav a { padding: 6px 9px; font-size: 0.74rem; }
  .phase-nav a .pn-num { margin-right: 0; }
  .phase-nav a .pn-txt { display: none; }
}

/* ── Hero (single column) ───────────────────────────────────── */
.hero { text-align: center; margin-bottom: 3rem; }
.hero-logo {
  width: 200px; height: auto; margin: 0 auto 1.5rem;
  display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.22));
}
.hero .eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--tum-blue); margin-bottom: 0.7rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.1;
  color: #3070B3; letter-spacing: -0.5px; margin-bottom: 1rem;
}
.hero .lead {
  font-size: 1.12rem; color: var(--text); max-width: 640px;
  margin: 0 auto; line-height: 1.6;
}

/* ── Phase section + heading ────────────────────────────────── */
.phase { margin-bottom: 3.5rem; scroll-margin-top: 80px; }
.phase-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.4rem; }
.phase-badge {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  background: var(--tum-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; box-shadow: var(--shadow);
}
.phase-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700;
  color: #1a2638; line-height: 1.15; letter-spacing: -0.3px;
}
.phase-head .phase-sub {
  font-size: 0.85rem; color: var(--muted); font-weight: 500; margin-top: 2px;
}
.phase > p.phase-intro {
  font-size: 1rem; color: var(--muted); line-height: 1.65; margin-bottom: 1.4rem;
}

/* ── Generic card ───────────────────────────────────────────── */
.card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem; margin-bottom: 1.1rem;
}
.card h3 { font-size: 1.05rem; font-weight: 700; color: var(--tum-blue-dark); margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; color: var(--text); line-height: 1.65; }
.card p + p { margin-top: 0.7rem; }

/* ── Impact (problem → solution) ────────────────────────────── */
.impact-context {
  display: flex; align-items: stretch; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--tum-blue-mid); margin-bottom: 1.2rem;
}
.impact-block { flex: 1; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 6px; }
.impact-problem  { background: #fff8f0; border-right: 1px solid var(--tum-blue-mid); }
.impact-solution { background: #f0f6ff; }
.impact-label {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--tum-blue);
}
.impact-block p { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.impact-arrow {
  display: flex; align-items: center; justify-content: center; padding: 0 0.7rem;
  background: #e8f0fb; font-size: 1.4rem; color: var(--tum-blue); flex-shrink: 0;
}

/* ── Pillar / stat grids ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 600px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.pillar {
  background: #f5f8ff; border: 1px solid var(--tum-blue-mid);
  border-top: 3px solid var(--tum-blue); border-radius: 10px;
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 6px;
}
.pillar .pillar-icon { font-size: 1.4rem; line-height: 1; }
.pillar h4 { font-size: 0.92rem; font-weight: 700; color: var(--tum-blue-dark); line-height: 1.3; }
.pillar p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; }

.stat-card {
  background: var(--tum-blue-light); border: 1px solid var(--tum-blue-mid);
  border-radius: 10px; padding: 1.1rem; text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 800; color: var(--tum-blue); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; }

/* ── Decision card (Phase 2) ────────────────────────────────── */
.decision {
  background: var(--white); border: 1.5px solid var(--border);
  border-left: 5px solid var(--tum-blue); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.3rem 1.4rem; margin-bottom: 1.1rem;
}
.decision.is-conditional { border-left-color: var(--warn-border); }
.decision-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.decision-key {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  background: var(--tum-blue); color: #fff; font-weight: 800; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
}
.decision.is-conditional .decision-key { background: var(--warn-border); }
.decision-head h3 { font-size: 1.08rem; font-weight: 700; color: #1a2638; margin: 0; }
.cond-badge {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border);
  padding: 2px 8px; border-radius: 99px;
}
.decision p { font-size: 0.92rem; color: var(--text); line-height: 1.6; }
.decision .opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 0.9rem 0 0.3rem; }
@media (max-width: 560px) { .decision .opt-row { grid-template-columns: 1fr; } }
.opt {
  background: var(--tum-blue-light); border: 1px solid var(--tum-blue-mid);
  border-radius: var(--radius-sm); padding: 0.8rem 0.9rem;
}
.opt .opt-label { font-size: 0.8rem; font-weight: 700; color: var(--tum-blue-dark); margin-bottom: 0.3rem; }
.opt p { font-size: 0.84rem; color: var(--muted); margin: 0; }
.dep-note {
  font-size: 0.82rem; color: var(--warn-text); background: var(--warn-bg);
  border: 1px dashed var(--warn-border); border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem; margin-top: 0.9rem;
}

/* ── Alternatives chips ─────────────────────────────────────── */
.alt-list { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.6rem; }
.alt-row {
  background: var(--tum-blue-light); border: 1px solid var(--tum-blue-mid);
  border-radius: var(--radius-sm); padding: 0.7rem 0.85rem;
}
.alt-row .alt-name { font-size: 0.86rem; font-weight: 700; color: var(--tum-blue-dark); }
.alt-row .alt-why { font-size: 0.82rem; color: var(--muted); margin: 0.2rem 0 0.45rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-size: 0.76rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 99px;
  background: var(--white); border: 1px solid var(--tum-blue-mid); color: var(--tum-blue-dark);
}
.chip.is-used { background: var(--tum-blue); color: #fff; border-color: var(--tum-blue); }

/* ── Document cards (Phase 3) ───────────────────────────────── */
.doc-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem; margin-bottom: 1.1rem;
}
.doc-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1.2; }
.doc-body { flex: 1; min-width: 0; }
.doc-body h3 { font-size: 1.02rem; font-weight: 700; color: #1a2638; margin-bottom: 0.3rem; }
.doc-body p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.7rem; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-doc {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  padding: 0.45rem 0.9rem; border-radius: 99px;
  background: var(--tum-blue); color: #fff; transition: background var(--transition), transform var(--transition);
}
.btn-doc.secondary { background: var(--tum-blue-light); color: var(--tum-blue-dark); border: 1px solid var(--tum-blue-mid); }
.btn-doc:hover { background: var(--tum-blue-dark); transform: translateY(-1px); }
.btn-doc.secondary:hover { background: var(--tum-blue-mid); }

/* ── Learning-goals table ───────────────────────────────────── */
.lg-module { margin-top: 1rem; }
.lg-module > summary {
  cursor: pointer; list-style: none; font-weight: 700; color: var(--tum-blue-dark);
  font-size: 0.95rem; padding: 0.75rem 0.9rem; background: var(--tum-blue-light);
  border: 1px solid var(--tum-blue-mid); border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 0.5rem;
}
.lg-module > summary::-webkit-details-marker { display: none; }
.lg-module > summary::before { content: '▸'; color: var(--tum-blue); transition: transform var(--transition); }
.lg-module[open] > summary::before { transform: rotate(90deg); }
.lg-module > summary .lg-count { margin-left: auto; font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.table-wrap { overflow-x: auto; margin-top: 0.6rem; }
table.lg {
  width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 520px;
}
table.lg th {
  text-align: left; background: var(--tum-blue); color: #fff; font-weight: 600;
  padding: 0.5rem 0.7rem; white-space: nowrap;
}
table.lg td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.lg tr:nth-child(even) td { background: #f7faff; }
table.lg .code { font-family: ui-monospace, monospace; font-weight: 700; color: var(--tum-blue-dark); white-space: nowrap; }
.level-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 1px 7px;
  border-radius: 99px; background: var(--tum-blue-light); color: var(--tum-blue-dark);
  border: 1px solid var(--tum-blue-mid); white-space: nowrap;
}

/* ── Questionnaire (Phase 4) ────────────────────────────────── */
.quiz {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem; margin-bottom: 1.5rem;
}
.quiz-q { margin-bottom: 1.3rem; }
.quiz-q:last-of-type { margin-bottom: 1rem; }
.quiz-q > .q-label { font-size: 0.95rem; font-weight: 700; color: #1a2638; margin-bottom: 0.6rem; display: block; }
.q-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.q-options label {
  cursor: pointer; font-size: 0.85rem; padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--tum-blue-mid); border-radius: 99px;
  background: var(--white); color: var(--tum-blue-dark); transition: all var(--transition);
  user-select: none;
}
.q-options input { position: absolute; opacity: 0; pointer-events: none; }
.q-options input:checked + span,
.q-options label:has(input:checked) { background: var(--tum-blue); color: #fff; border-color: var(--tum-blue); }
.q-options label:hover { border-color: var(--tum-blue); }
.btn-build {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 700; border: none;
  padding: 0.8rem 1.8rem; border-radius: 99px; background: var(--tum-blue); color: #fff;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-build:hover { background: var(--tum-blue-dark); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ── Generated plan ─────────────────────────────────────────── */
.plan-out {
  background: var(--tum-blue-light); border: 1.5px solid var(--tum-blue);
  border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.5rem;
}
.plan-out[hidden] { display: none; }
.plan-out h3 { font-size: 1.15rem; color: var(--tum-blue-dark); margin-bottom: 0.4rem; }
.plan-out .plan-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.plan-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.plan-list li {
  background: var(--white); border: 1px solid var(--tum-blue-mid); border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem; font-size: 0.88rem; color: var(--text);
  display: flex; gap: 0.6rem; align-items: flex-start; line-height: 1.5;
}
.plan-list li::before { content: '✓'; color: var(--tum-blue); font-weight: 800; flex-shrink: 0; }
.plan-list li.is-skip { opacity: 0.6; }
.plan-list li.is-skip::before { content: '—'; color: var(--muted); }
.plan-list li strong { color: var(--tum-blue-dark); }

/* ── Roadmap (expandable steps) ─────────────────────────────── */
.roadmap { display: flex; flex-direction: column; gap: 0.7rem; }
details.step {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
details.step > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.8rem;
  padding: 1rem 1.2rem; user-select: none;
}
details.step > summary::-webkit-details-marker { display: none; }
.step-num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--tum-blue); color: #fff; font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.step-title { display: block; font-size: 1rem; font-weight: 700; color: #1a2638; }
.step-when { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 1px; }
details.step > summary .step-chevron { margin-left: auto; color: var(--tum-blue); transition: transform var(--transition); }
details.step[open] > summary .step-chevron { transform: rotate(90deg); }
.step-content { padding: 0 1.2rem 1.2rem; border-top: 1px solid var(--tum-blue-light); }
.step-content h4 {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--tum-blue-dark); margin: 1rem 0 0.5rem;
}
.step-content p { font-size: 0.88rem; color: var(--text); line-height: 1.6; }
.step-content ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.4rem; }
.step-content ul li {
  font-size: 0.85rem; color: var(--text); background: var(--tum-blue-light);
  border: 1px solid var(--tum-blue-mid); border-radius: 6px; padding: 0.45rem 0.7rem;
  display: flex; gap: 0.5rem;
}
.step-content ul li::before { content: '•'; color: var(--tum-blue); flex-shrink: 0; }
.email-draft {
  background: #f7faff; border: 1px solid var(--border); border-left: 3px solid var(--tum-blue);
  border-radius: 0 6px 6px 0; padding: 0.8rem 1rem; margin-top: 0.5rem;
  font-size: 0.82rem; color: var(--text); line-height: 1.7; white-space: pre-line;
}
.ph { background: #fff3cd; padding: 0 4px; border-radius: 3px; font-weight: 600; }

/* ── Footer / back link ─────────────────────────────────────── */
.report-footer { text-align: center; margin-top: 3rem; font-size: 0.82rem; color: var(--muted); }
.report-footer a { color: var(--tum-blue-dark); font-weight: 600; }
.btn-back-site {
  display: inline-flex; align-items: center; gap: 0.45rem; margin-bottom: 1rem;
  padding: 0.65rem 1.5rem; background: var(--tum-blue); color: #fff;
  font-size: 0.88rem; font-weight: 600; text-decoration: none; border-radius: 99px;
  transition: background var(--transition), transform var(--transition);
}
.btn-back-site:hover { background: var(--tum-blue-dark); transform: translateY(-2px); }
