/* gedenken.bestattung.de — Testplattform Gedenkseiten neu
   CI: bestattung.de — Violett #210085, Manrope + Playfair Display */

:root {
  --violett: #210085;
  --violett-tief: #15005c;
  --violett-weich: #4d2fc4;
  --akzent: #8f6bff;
  --gold: #c9a86a;
  --tinte: #1d1a2e;
  --grau: #6b6879;
  --hell: #f7f5fb;
  --linie: #e6e1f0;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--tinte);
  background: #fff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--violett); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--violett-tief);
  color: #fff;
}
.hero-back {
  position: absolute; inset: 0;
  background: url('../img/hero-steinfeld.webp') center 30% / cover no-repeat;
  opacity: 0.38;
  transform: scale(1.08);
  animation: heroDrift 24s ease-in-out infinite alternate;
  filter: saturate(0.7) brightness(0.8);
}
@keyframes heroDrift {
  from { transform: scale(1.08) translate(0, 0); }
  to   { transform: scale(1.14) translate(-1.5%, -1.5%); }
}
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(21,0,92,.55) 0%, rgba(33,0,133,.35) 45%, rgba(21,0,92,.92) 100%);
}
.hero-in {
  position: relative;
  max-width: 940px;
  margin: 0 auto;
  padding: 120px 24px 140px;
}
.hero-kicker {
  font-size: .78rem; font-weight: 700; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 26px;
  opacity: 0; animation: rise .9s .1s forwards;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.4vw, 4.3rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin-bottom: 26px;
  opacity: 0; animation: rise .9s .25s forwards;
}
.hero h1 em { font-style: italic; color: #d9ccf7; }
.hero-lead {
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  max-width: 620px;
  color: #e4ddf6;
  margin-bottom: 42px;
  opacity: 0; animation: rise .9s .4s forwards;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; opacity: 0; animation: rise .9s .55s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: none; cursor: pointer; font-family: var(--sans);
  font-weight: 700; font-size: 1rem; border-radius: 999px;
  padding: 16px 34px; transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(120deg, var(--gold), #e0c690);
  color: #2a1c00; box-shadow: 0 12px 34px rgba(201,168,106,.35);
}
.btn-primary:hover { box-shadow: 0 16px 44px rgba(201,168,106,.5); }
.btn-ghost {
  background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255,255,255,.16); }

/* ---------- Sektionen ---------- */
section { padding: 96px 24px; }
.wrap { max-width: 1080px; margin: 0 auto; }
.sec-kicker {
  font-size: .72rem; font-weight: 800; letter-spacing: .26em; text-transform: uppercase;
  color: var(--violett-weich); margin-bottom: 14px;
}
.sec-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.2; color: var(--tinte);
  margin-bottom: 18px;
}
.sec-lead { color: var(--grau); max-width: 640px; margin-bottom: 44px; font-size: 1.05rem; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.on { opacity: 1; transform: none; }

/* ---------- Schritte ---------- */
.steps { background: var(--hell); }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step {
  background: #fff; border-radius: 20px; padding: 36px 30px;
  border: 1px solid var(--linie);
  box-shadow: 0 6px 24px rgba(33,0,133,.05);
  transition: transform .3s ease, box-shadow .3s ease;
}
.step:hover { transform: translateY(-6px); box-shadow: 0 18px 44px rgba(33,0,133,.12); }
.step-nr {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--violett), var(--violett-weich));
  margin-bottom: 20px;
}
.step h3 { font-size: 1.18rem; font-weight: 800; margin-bottom: 10px; color: var(--tinte); }
.step p { color: var(--grau); font-size: .95rem; }

/* ---------- Dialog ---------- */
.dialog { background: linear-gradient(180deg, #fff 0%, var(--hell) 100%); }
.wizard {
  background: #fff; border-radius: 26px;
  border: 1px solid var(--linie);
  box-shadow: 0 24px 70px rgba(33,0,133,.1);
  max-width: 780px; margin: 0 auto; overflow: hidden;
}
.wizard-head {
  background: linear-gradient(120deg, var(--violett-tief), var(--violett) 55%, var(--violett-weich));
  color: #fff; padding: 30px 36px;
}
.wizard-head .w-step {
  font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px;
}
.wizard-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.55rem; line-height: 1.3; }
.wizard-body { padding: 36px; }
.w-pane { display: none; }
.w-pane.active { display: block; animation: paneIn .45s ease; }
@keyframes paneIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.f-group { margin-bottom: 22px; }
.f-group label {
  display: block; font-weight: 700; font-size: .92rem; margin-bottom: 8px; color: var(--tinte);
}
.f-group .hint { font-weight: 500; color: var(--grau); }
.f-group input[type="text"], .f-group textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--tinte);
  padding: 14px 16px; border: 1.5px solid var(--linie); border-radius: 12px;
  background: #fdfcff; transition: border-color .2s ease, box-shadow .2s ease;
}
.f-group input:focus, .f-group textarea:focus {
  outline: none; border-color: var(--violett-weich);
  box-shadow: 0 0 0 4px rgba(143,107,255,.16);
}
.f-group textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.w-progress {
  height: 4px; background: var(--linie); border-radius: 2px; overflow: hidden;
  margin: -6px 36px 30px;
}
.w-progress i {
  display: block; height: 100%; width: 20%;
  background: linear-gradient(90deg, var(--gold), #e8d5ac);
  transition: width .5s ease;
}
.w-nav { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 8px; }
.w-back {
  background: none; border: none; color: var(--grau); font-weight: 700; cursor: pointer;
  font-family: var(--sans); font-size: .95rem; padding: 10px 6px;
}
.w-back:hover { color: var(--tinte); }
.btn-next {
  background: var(--violett); color: #fff; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 800; font-size: .98rem;
  padding: 14px 32px; border-radius: 999px;
  transition: background .2s ease, transform .2s ease;
}
.btn-next:hover { background: var(--violett-tief); transform: translateY(-1px); }
.btn-next:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Spracheingabe */
.sprech-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--hell); border: 1.5px dashed var(--violett-weich);
  color: var(--violett); font-family: var(--sans); font-weight: 700; font-size: .88rem;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; margin-bottom: 12px;
  transition: background .2s ease;
}
.sprech-btn:hover { background: #efe9ff; }
.sprech-btn.rec { background: #ffe9e9; border-color: #d33; color: #b30000; animation: puls 1.2s infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 10px rgba(255,60,60,.12); } }

/* Lade-Zustand */
.ai-wait { text-align: center; padding: 30px 10px; }
.ai-wait .flamme {
  font-size: 0; width: 26px; height: 38px; margin: 0 auto 18px;
  background: radial-gradient(ellipse at 50% 70%, var(--gold), #f3dfae 60%, transparent 75%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  filter: blur(.4px);
  animation: flackern 1.1s ease-in-out infinite alternate;
}
@keyframes flackern {
  from { transform: scaleY(1) translateY(0); opacity: .85; }
  to   { transform: scaleY(1.18) translateY(-3px); opacity: 1; }
}
.ai-wait p { color: var(--grau); font-size: .98rem; }
.ai-wait .phase { font-weight: 800; color: var(--violett); }

/* Fehler */
.w-fehler {
  display: none; margin-top: 16px;
  background: #fff2f2; border: 1px solid #f3c1c1; color: #8a1f1f;
  padding: 13px 18px; border-radius: 12px; font-size: .92rem;
}
.w-fehler.on { display: block; }

/* ---------- Ergebnis / Vorschau ---------- */
.vorschau-tip {
  text-align: center; font-size: .85rem; color: var(--grau); margin-bottom: 22px;
}
.tpl-picker { display: flex; justify-content: center; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.tpl-pill {
  border: 1.5px solid var(--linie); background: #fff; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: .9rem;
  padding: 10px 22px; border-radius: 999px; color: var(--grau);
  transition: all .2s ease;
}
.tpl-pill:hover { border-color: var(--violett-weich); color: var(--violett); }
.tpl-pill.sel { background: var(--violett); border-color: var(--violett); color: #fff; }

/* Gedenkseiten-Render: warm */
.gs { border-radius: 18px; overflow: hidden; border: 1px solid var(--linie); }
.gs-warm { background: linear-gradient(180deg, #fdf8f0, #fff); }
.gs-warm .gs-hero { background: linear-gradient(160deg, #3d2b1f, #6b4f33); color: #fff; padding: 64px 40px; text-align: center; }
.gs-warm .gs-name { font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.gs-warm .gs-daten { color: #e8d9c4; font-size: .95rem; margin-top: 8px; letter-spacing: .06em; }
.gs-warm .gs-epi { font-family: var(--serif); font-style: italic; color: #f3e8d6; margin-top: 20px; font-size: 1.08rem; }
.gs-body { padding: 40px; max-width: 640px; margin: 0 auto; }
.gs-body p { margin-bottom: 16px; color: #4a4238; line-height: 1.75; }
.gs-stationen { margin: 30px 0; }
.gs-station { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px dashed #e0d4bd; }
.gs-station .j { font-family: var(--serif); font-weight: 600; color: #9a7b4f; min-width: 64px; }
.gs-station .t { color: #5a5044; font-size: .95rem; }

/* Gedenkseiten-Render: klar */
.gs-klar { background: #fbfbfd; }
.gs-klar .gs-hero { background: linear-gradient(160deg, #22222c, #43434f); color: #fff; padding: 64px 40px; text-align: center; }
.gs-klar .gs-name { font-family: var(--sans); font-size: 1.9rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.gs-klar .gs-daten { color: #b9b9c6; font-size: .85rem; margin-top: 8px; letter-spacing: .2em; text-transform: uppercase; }
.gs-klar .gs-epi { color: #d7d7e0; margin-top: 18px; font-size: .98rem; font-weight: 500; }
.gs-klar .gs-body p { color: #3a3a46; }
.gs-klar .gs-station { border-bottom: 1px solid #e6e6ee; }
.gs-klar .gs-station .j { font-family: var(--sans); font-weight: 800; color: #22222c; }

/* Gedenkseiten-Render: klassisch */
.gs-klassisch { background: #fff; }
.gs-klassisch .gs-hero { background: linear-gradient(160deg, #1d2f1f, #3c5a3e); color: #fff; padding: 64px 40px; text-align: center; }
.gs-klassisch .gs-name { font-family: var(--serif); font-size: 2.1rem; font-weight: 500; letter-spacing: .02em; }
.gs-klassisch .gs-daten { color: #cfe0cf; font-size: .92rem; margin-top: 8px; font-style: italic; }
.gs-klassisch .gs-epi { font-family: var(--serif); font-style: italic; color: #e6f0e4; margin-top: 18px; }
.gs-klassisch .gs-station .j { color: #3c5a3e; }

/* Kerzen-Modul */
.gs-kerzen { padding: 40px 40px 52px; text-align: center; border-top: 1px solid var(--linie); }
.gs-kerzen h4 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin-bottom: 6px; }
.gs-kerzen .sub { color: var(--grau); font-size: .88rem; margin-bottom: 24px; }
.kerzen-meer { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; min-height: 56px; }
.kerze {
  width: 22px; height: 34px; position: relative;
  background: linear-gradient(180deg, #f7e9c8 30%, #d9c393);
  border-radius: 4px 4px 3px 3px;
}
.kerze::before {
  content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 13px;
  background: radial-gradient(ellipse at 50% 75%, #fff 0%, var(--gold) 45%, #e07b1f 80%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  animation: flackern 1s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 6px rgba(224,150,60,.75));
}
.kerzen-btn {
  background: var(--violett); color: #fff; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 800; font-size: .92rem;
  padding: 13px 28px; border-radius: 999px; transition: background .2s ease, transform .2s ease;
}
.kerzen-btn:hover { background: var(--violett-tief); transform: translateY(-1px); }
.kerzen-btn:disabled { opacity: .5; cursor: default; transform: none; }
.kerzen-n { font-weight: 800; color: var(--violett); }

/* Nächste Schritte nach Vorschau */
.w-ende { text-align: center; padding: 10px 0 4px; }
.w-ende p { color: var(--grau); font-size: .95rem; max-width: 560px; margin: 0 auto 22px; }
.ende-grid { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ende-chip {
  font-size: .82rem; font-weight: 700; color: var(--grau);
  border: 1px dashed var(--linie); border-radius: 999px; padding: 8px 16px; background: #fdfcff;
}

/* ---------- Preise ---------- */
.preise { background: var(--hell); }
.preis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.preis {
  background: #fff; border-radius: 20px; padding: 34px 30px;
  border: 1px solid var(--linie); position: relative;
  display: flex; flex-direction: column;
}
.preis.hervor { border: 2px solid var(--violett); box-shadow: 0 20px 50px rgba(33,0,133,.14); }
.preis-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--violett); color: #fff; font-size: .7rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; padding: 6px 16px; border-radius: 999px;
  white-space: nowrap;
}
.preis h3 { font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.preis .p-betrag { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; color: var(--tinte); margin: 10px 0 4px; }
.preis .p-betrag small { font-family: var(--sans); font-size: .85rem; color: var(--grau); font-weight: 600; }
.preis ul { list-style: none; margin: 18px 0 26px; flex: 1; }
.preis li { padding: 7px 0 7px 26px; position: relative; color: #4c4760; font-size: .92rem; }
.preis li::before {
  content: '✓'; position: absolute; left: 0; top: 7px;
  color: var(--violett-weich); font-weight: 800;
}
.preis .btn { justify-content: center; }
.preis-foot { text-align: center; color: var(--grau); font-size: .85rem; margin-top: 26px; }
.preis-foot strong { color: var(--tinte); }

/* ---------- Footer ---------- */
footer {
  background: var(--violett-tief); color: #cfc4ee;
  padding: 54px 24px; text-align: center; font-size: .88rem;
}
footer .f-marke { font-family: var(--serif); color: #fff; font-size: 1.15rem; margin-bottom: 10px; }
footer a { color: #cfc4ee; text-decoration: underline; text-underline-offset: 3px; }
footer .f-recht { margin-top: 18px; color: #8f84bd; font-size: .8rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .step-grid, .preis-grid { grid-template-columns: 1fr; }
  .f-row { grid-template-columns: 1fr; }
  .hero { min-height: 74vh; }
  .hero-in { padding: 90px 20px 110px; }
  .wizard-head, .wizard-body, .gs-kerzen { padding-left: 22px; padding-right: 22px; }
  .w-progress { margin: -6px 22px 26px; }
  .gs-body, .gs-klar .gs-hero, .gs-klassisch .gs-hero, .gs-warm .gs-hero { padding-left: 22px; padding-right: 22px; }
  section { padding: 64px 18px; }
  .btn { padding: 14px 26px; }
}
/* ---------- Chat-Dialog (geführtes Gespräch) ---------- */
.chat-hinweis {
  background: #f7f4ff; border: 1px solid #e6e1f0; border-radius: 12px;
  padding: 13px 18px; margin-bottom: 18px;
}
.chat-hinweis p { color: var(--grau); font-size: .9rem; line-height: 1.55; margin: 0; }

.chat-box {
  background: #fdfcff; border: 1.5px solid var(--linie); border-radius: 14px;
  padding: 18px; max-height: 380px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth;
}
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.chat-ki-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--violett), var(--violett-weich));
  color: #fff; font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}
.chat-ki-bubble {
  background: #fff; border: 1px solid var(--linie); border-radius: 4px 14px 14px 14px;
  padding: 12px 16px; color: var(--tinte); font-size: .97rem; line-height: 1.6;
  max-width: 78%; box-shadow: 0 1px 3px rgba(33,0,133,.05);
  animation: msgIn .35s ease both;
}
.chat-user-bubble {
  background: var(--violett); color: #fff; border-radius: 14px 4px 14px 14px;
  padding: 12px 16px; font-size: .97rem; line-height: 1.6; max-width: 78%;
  animation: msgIn .35s ease both;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.chat-msg.typing .chat-ki-bubble { display: flex; gap: 5px; align-items: center; padding: 16px 18px; }
.dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--violett-weich);
  display: inline-block; animation: dotPuls 1.1s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dotPuls { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }

.chat-input { display: flex; gap: 10px; margin-top: 16px; align-items: flex-end; }
.chat-input textarea {
  flex: 1; resize: vertical; min-height: 52px; max-height: 180px;
  border: 1.5px solid var(--linie); border-radius: 12px; padding: 12px 14px;
  font-family: var(--sans); font-size: .97rem; color: var(--tinte);
  outline: none; transition: border-color .2s ease;
}
.chat-input textarea:focus { border-color: var(--violett-weich); }
.chat-send {
  width: 48px; height: 48px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--violett), var(--violett-weich));
  color: #fff; font-size: 1.1rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .2s ease;
}
.chat-send:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(33,0,133,.25); }
.chat-send:active { transform: none; }

.chat-actions { margin-top: 14px; text-align: center; }
.chat-aux {
  background: none; border: none; cursor: pointer;
  color: var(--grau); font-family: var(--sans); font-weight: 700; font-size: .88rem;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 8px 12px; transition: color .2s ease;
}
.chat-aux:hover { color: var(--violett); }
.chat-aux.glow {
  color: #fff; background: linear-gradient(135deg, var(--violett), var(--violett-weich));
  border-radius: 999px; padding: 12px 26px; text-decoration: none;
  animation: auxPuls 2.2s infinite ease-in-out;
}
@keyframes auxPuls { 50% { box-shadow: 0 0 0 10px rgba(33,0,133,.10); } }

/* Mobile */
@media (max-width: 640px) {
  .chat-box { max-height: 300px; padding: 14px; }
  .chat-ki-bubble, .chat-user-bubble { max-width: 88%; font-size: .93rem; }
  .chat-ki-avatar { width: 28px; height: 28px; font-size: .85rem; }
  .chat-send { width: 44px; height: 44px; }
}
