/* ===========================================================================
   PromptProfi – Design-System
   Überarbeitet mit ui-ux-pro-max: „Calm Indigo + Success Green“, Poppins/Open Sans.
   Ziel: schülerfreundlich, ruhig, klare Hierarchie (nicht überfordern).
   =========================================================================== */
:root {
  /* Semantische Farb-Tokens (WCAG-geprüfte Palette aus ui-ux-pro-max) */
  --bg: #f5f3ff;
  --surface: #ffffff;
  --surface-2: #faf9ff;
  --ink: #312e81;          /* foreground – Überschriften/Text */
  --ink-soft: #5b57a8;     /* sekundärer Text */
  --muted: #8b88b8;        /* tertiär / Hinweise */
  --line: #e0e7ff;         /* Rahmen */
  --accent: #6366f1;       /* primary */
  --accent-strong: #4f46e5;
  --secondary: #818cf8;
  --accent-soft: #ebeff9;
  --on-accent: #ffffff;
  --good: #059669;         /* accent/CTA & Erfolg */
  --good-soft: #e7f6ef;
  --warn: #b45309;
  --warn-soft: #fdf2e2;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --ring: #6366f1;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 4px 16px -8px rgba(49, 46, 129, .18);
  --shadow: 0 14px 38px -16px rgba(49, 46, 129, .28);
  --stage: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 85% -8%, #e9e6ff 0%, rgba(233,230,255,0) 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Poppins", "Open Sans", system-ui, sans-serif; line-height: 1.2; color: var(--ink); margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: var(--accent-strong); }
.muted { color: var(--muted); }
code { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 46px; cursor: pointer; font-family: "Poppins", sans-serif;
  font-size: 1rem; font-weight: 600; line-height: 1;
  padding: .75rem 1.4rem; border-radius: 12px; border: 1.5px solid transparent;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -12px rgba(99,102,241,.85); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9cdf0; background: var(--surface-2); }
.btn-lg { min-height: 52px; padding: .9rem 2rem; font-size: 1.08rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Sichtbare Fokus-Ringe (Accessibility) */
a:focus-visible, button:focus-visible, summary:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ring) 55%, white);
  outline-offset: 2px;
  border-radius: 10px;
}

/* --- Wizard-Gerüst -------------------------------------------------------- */
.wizard { min-height: 100dvh; display: flex; flex-direction: column; }

.wiz-top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.wiz-top-inner {
  max-width: var(--stage); margin: 0 auto; padding: .75rem 20px;
  display: flex; align-items: center; gap: 1.1rem; justify-content: space-between;
}
.wiz-brand { font-family: "Poppins", sans-serif; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.wiz-progress { display: flex; align-items: center; gap: .7rem; flex: 1; max-width: 440px; }
.wiz-bar { flex: 1; height: 10px; background: #e6e3fb; border-radius: 999px; overflow: hidden; }
.wiz-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--secondary, #818cf8)); border-radius: 999px; transition: width .45s cubic-bezier(.4,0,.2,1); }
.wiz-count { font-size: .82rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }

.wiz-stage { flex: 1; width: 100%; max-width: var(--stage); margin: 0 auto; padding: 1.8rem 20px 2.6rem; }

.slide { display: none; }
.slide.active { display: block; animation: slidein .28s ease; }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Intro ---------------------------------------------------------------- */
.eyebrow {
  display: inline-block; font-family: "Poppins", sans-serif; font-size: .78rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent-strong);
  background: var(--accent-soft); padding: .32rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}
.slide-intro h1 { font-size: clamp(1.7rem, 4.6vw, 2.4rem); }
.grad { background: linear-gradient(100deg, var(--accent), #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 60ch; }
.intro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; margin: 1.5rem 0 .5rem; }
.regel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; box-shadow: var(--shadow-soft); }
.regel-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem; }
.regel-icon { font-size: 1.35rem; }
.regel-head h3 { margin: 0; font-size: 1rem; }
.regel-card p { font-size: .9rem; color: var(--ink-soft); margin: 0; }

/* --- Themen-Chip + Hinweis ----------------------------------------------- */
.theme-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: .82rem; color: #fff;
  background: var(--accent); padding: .34rem .85rem; border-radius: 999px; margin-bottom: 1rem;
}
.theme-chip span { font-size: 1.05rem; }
.callout {
  background: var(--warn-soft); border: 1px solid #f3dcae; color: #8a5a00;
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: 1.1rem; font-size: .94rem;
}

/* --- Schritt-Karte (ruhig, klare Hierarchie) ----------------------------- */
.step-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-soft);
}
.step-card.done { border-color: #bce7d4; box-shadow: 0 0 0 1px #bce7d4 inset, var(--shadow-soft); }
.step-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.step-head h2 { margin: 0; }
.step-status {
  font-size: .74rem; font-weight: 700; color: var(--muted);
  background: var(--accent-soft); padding: .25rem .65rem; border-radius: 999px; white-space: nowrap;
}
.step-card.done .step-status { background: var(--good-soft); color: var(--good); }

/* Lernziel = kompakte, sekundäre Zeile */
.lernziel { font-size: .92rem; color: var(--ink-soft); margin-bottom: 1rem; }
.lernziel span { font-weight: 700; color: var(--ink); }

/* Anti-Beispiel */
.anti-beispiel {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--bad-soft); border: 1px dashed #f3c7c7; border-radius: var(--radius-sm);
  padding: .7rem .9rem; margin-bottom: 1rem;
}
.anti-tag { font-family: "Poppins", sans-serif; font-size: .72rem; font-weight: 700; color: var(--bad); white-space: nowrap; }
.anti-beispiel code { color: #7a1f1f; font-size: .92rem; }

/* Szenario = primärer Fokuspunkt */
.szenario {
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; margin-bottom: 1.1rem;
  font-size: 1.04rem; color: var(--ink);
}

/* Fokus-Bausteine = dezent */
.fokus-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1.1rem; }
.fokus-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-right: .15rem; }
.chip { font-size: .78rem; font-weight: 600; color: var(--ink-soft); background: var(--accent-soft); padding: .24rem .7rem; border-radius: 999px; }

/* Tipp (eingeklappt) */
.tipp { margin-bottom: 1.1rem; }
.tipp summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent-strong); width: max-content; }
.tipp p { margin: .6rem 0 0; font-size: .92rem; color: var(--ink-soft); background: var(--accent-soft); padding: .8rem .95rem; border-radius: var(--radius-sm); }

/* Eingabe */
.prompt-label { display: block; font-family: "Poppins", sans-serif; font-weight: 600; font-size: .92rem; margin-bottom: .45rem; }
.prompt-input {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink); line-height: 1.55;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem;
  resize: vertical; min-height: 120px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.prompt-input::placeholder { color: #a6a3cd; }
.prompt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Aktionen: genau eine Primär-CTA */
.step-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* Muster-Prompt – dezenter Reveal */
.muster { margin-top: 1.1rem; }
.muster > summary {
  cursor: pointer; font-family: "Poppins", sans-serif; font-weight: 600; font-size: .9rem; color: var(--ink-soft);
  list-style: none; display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem .9rem; border: 1px dashed #c9cdf0; border-radius: 10px; background: var(--surface-2);
}
.muster > summary::-webkit-details-marker { display: none; }
.muster > summary:hover { color: var(--accent-strong); border-color: var(--accent); }
.muster[open] > summary { margin-bottom: .6rem; }

/* --- Wizard-Navigation ---------------------------------------------------- */
.wiz-nav { display: flex; justify-content: space-between; gap: .8rem; margin-top: 1.5rem; }
.wiz-nav.center { justify-content: center; }

/* --- Feedback-Bereich ----------------------------------------------------- */
.feedback-area, .test-area { margin-top: 1.3rem; }
.feedback-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface-2), #fff); padding: 1.3rem; box-shadow: var(--shadow-soft); }
.fb-top { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1rem; }
.score-ring {
  --val: 0; --col: var(--accent); width: 86px; height: 86px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--col) calc(var(--val) * 1%), #e6e3fb 0); display: grid; place-items: center;
}
.score-ring::after { content: attr(data-score); width: 64px; height: 64px; background: #fff; border-radius: 50%; display: grid; place-items: center; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.fb-summary { font-size: 1rem; color: var(--ink); margin: 0; }
.fb-section { margin-top: 1.1rem; }
.fb-section h4 { font-family: "Poppins", sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 .55rem; }
.kriterien { display: grid; gap: .5rem; }
.krit { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; padding: .6rem .85rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.krit-icon { font-size: 1rem; line-height: 1.5; }
.krit b { font-size: .92rem; }
.krit p { margin: .12rem 0 0; font-size: .87rem; color: var(--ink-soft); }
.krit.ja { background: var(--good-soft); border-color: #c5e9d7; }
.krit.teilweise { background: var(--warn-soft); border-color: #f3dcae; }
.krit.nein { background: var(--bad-soft); border-color: #f3c7c7; }
.fb-list { margin: 0; padding-left: 1.1rem; }
.fb-list li { font-size: .92rem; color: var(--ink-soft); margin-bottom: .3rem; }

.improved { position: relative; background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; margin-top: .4rem; }
.improved pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: .94rem; color: var(--ink); line-height: 1.55; }
.copy-btn { position: absolute; top: .6rem; right: .6rem; font-size: .76rem; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent-strong); }

.next-step { margin-top: 1rem; font-size: .94rem; background: var(--good-soft); border: 1px solid #c5e9d7; color: #0f5132; border-radius: var(--radius-sm); padding: .75rem .95rem; }

/* Inline „Weiter“-CTA nach erfolgreichem Feedback (Flow) */
.fb-next { margin-top: 1.1rem; width: 100%; background: var(--good); color: #fff; box-shadow: 0 10px 22px -12px rgba(5,150,105,.8); }
.fb-next:hover { background: #047857; }

/* Test-Antwort */
.test-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.1rem 1.25rem; box-shadow: var(--shadow-soft); }
.test-card h4 { margin: 0 0 .5rem; font-family: "Poppins", sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.test-output { white-space: pre-wrap; font-size: .96rem; color: var(--ink); line-height: 1.6; }

/* Status / Fehler / Spinner */
.notice { padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .92rem; margin-top: .8rem; }
.notice.error { background: var(--bad-soft); color: #991b1b; border: 1px solid #f3c7c7; }
.loading { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink-soft); font-size: .94rem; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Abschluss ------------------------------------------------------------ */
.slide-done { text-align: center; padding-top: 1.5rem; }
.done-emoji { font-size: 3.4rem; }
.slide-done .wiz-nav { margin-top: 1.6rem; }

/* --- Footer --------------------------------------------------------------- */
.wiz-foot { text-align: center; padding: 1.2rem; border-top: 1px solid var(--line); }
.wiz-foot .muted { font-size: .82rem; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 560px) {
  .wiz-top-inner { flex-wrap: wrap; }
  .wiz-progress { max-width: none; width: 100%; }
  .wiz-nav .btn { flex: 1; }
  .step-card { padding: 1.2rem; }
}

/* --- Reduced Motion (Accessibility) -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .slide.active { animation: none; }
}
