/* =========================================================
   Kundivo Demo-Studio
   ========================================================= */
:root {
  --bg: #030712;
  --bg-2: #0b1020;
  --panel: #0a0f1d;
  --card: rgba(255, 255, 255, .04);
  --card-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #f8fafc;
  --ink-2: rgba(248, 250, 252, .72);
  --muted: rgba(248, 250, 252, .48);
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --green: #10b981;
  --red: #f87171;
  --g1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; line-height: 1.55; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Topbar ---------- */
.topbar { height: 64px; display: flex; align-items: center; gap: 18px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(3, 7, 18, .9); backdrop-filter: blur(14px); position: relative; z-index: 30; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--g1); display: grid; place-items: center; box-shadow: 0 8px 22px -8px rgba(139, 92, 246, .8); }
.tb-title { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 18px; border-left: 1px solid var(--line); }
.tb-title strong { color: var(--ink); }
.tb-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.tb-link { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; }
.tb-link:hover { background: var(--card-2); color: var(--ink); }

/* ---------- Layout ---------- */
.studio { display: grid; grid-template-columns: 460px 1fr; height: calc(100% - 64px); }
.panel { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.steps-nav { display: flex; gap: 6px; padding: 18px 26px 0; }
.sn { flex: 1; height: 4px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; border: 0; padding: 0; }
.sn::after { content: ""; position: absolute; inset: 0; background: var(--g1); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.sn.done::after, .sn.cur::after { transform: scaleX(1); }
.sn.cur::after { opacity: .9; }
.step-meta { display: flex; justify-content: space-between; padding: 12px 26px 0; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.panel-body { flex: 1; overflow-y: auto; padding: 22px 26px 26px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.step { animation: stepIn .45s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } }
.step h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.025em; font-weight: 800; margin-bottom: 8px; }
.step h1 .gt { background: var(--g1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step > p.sub { color: var(--ink-2); font-size: 15px; margin-bottom: 22px; }
.panel-foot { display: flex; gap: 10px; padding: 16px 26px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 12px; font-weight: 700; font-size: 15px; border: 1px solid transparent; transition: transform .2s, box-shadow .2s, background .2s, opacity .2s; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-p { background: var(--g1); color: #fff; box-shadow: 0 12px 30px -12px rgba(139, 92, 246, .8); flex: 1; }
.btn-g { background: var(--card-2); border-color: var(--line); color: var(--ink); }
.btn-g:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

/* ---------- Branchen ---------- */
.branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.br { border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 16px 8px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; line-height: 1.25; transition: all .2s; min-height: 98px; justify-content: center; }
.br .e { font-size: 26px; line-height: 1; }
.br:hover { border-color: var(--line-2); background: var(--card-2); }
.br[aria-checked="true"] { border-color: var(--violet); background: rgba(139, 92, 246, .14); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }

/* ---------- Felder ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field > span small { font-weight: 500; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; background: rgba(255, 255, 255, .05); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='m1 1.5 5 5 5-5' stroke='%23a5b4fc' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field select option { background: #0b1020; }
.field textarea { resize: vertical; min-height: 84px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(248, 250, 252, .3); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.field .err { display: none; color: var(--red); font-size: 12.5px; margin-top: 5px; }
.field.invalid .err { display: block; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: -6px; margin-bottom: 14px; }

/* ---------- Leistungen ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; transition: all .2s; }
.chip:hover { border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: rgba(139, 92, 246, .18); border-color: var(--violet); }
.chip[aria-pressed="true"]::before { content: "✓"; font-size: 12px; color: #c4b5fd; }
.chip .x { margin-left: 2px; opacity: .6; font-size: 16px; line-height: 1; }
.add-row { display: flex; gap: 8px; margin-top: 14px; }
.add-row input { flex: 1; min-width: 0; background: rgba(255, 255, 255, .05); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; font-size: 16px; }
.add-row input:focus { border-color: var(--violet); }
.counter { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* ---------- Design ---------- */
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sty { border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px; text-align: left; transition: all .2s; }
.sty[aria-checked="true"] { border-color: var(--violet); background: rgba(139, 92, 246, .12); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.sty-prev { height: 62px; border-radius: 9px; margin-bottom: 9px; position: relative; overflow: hidden; }
.sty-prev i { position: absolute; display: block; border-radius: 3px; }
.sty strong { display: block; font-size: 13.5px; }
.sty small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.sp-modern { background: linear-gradient(180deg, #eef2ff, #fff); }
.sp-modern i:nth-child(1) { left: 8px; top: 12px; width: 46%; height: 9px; background: #1f2937; border-radius: 4px; }
.sp-modern i:nth-child(2) { left: 8px; top: 27px; width: 34%; height: 5px; background: #9ca3af; }
.sp-modern i:nth-child(3) { left: 8px; top: 40px; width: 22%; height: 10px; background: var(--sc, #6366f1); border-radius: 6px; }
.sp-modern i:nth-child(4) { right: 8px; top: 9px; width: 34%; height: 44px; background: #cbd5e1; border-radius: 8px; }
.sp-elegant { background: linear-gradient(100deg, #1c1712 30%, #6b5a48); }
.sp-elegant i:nth-child(1) { left: 9px; top: 14px; width: 52%; height: 9px; background: #f5efe6; }
.sp-elegant i:nth-child(2) { left: 9px; top: 28px; width: 36%; height: 9px; background: var(--sc, #c084fc); opacity: .9; }
.sp-elegant i:nth-child(3) { left: 9px; top: 44px; width: 26%; height: 8px; background: var(--sc, #c084fc); border-radius: 1px; }
.sp-elegant i:nth-child(4) { display: none; }
.sp-bold { background: #0b0b0c; }
.sp-bold i:nth-child(1) { left: 8px; top: 10px; width: 50%; height: 12px; background: #fff; border-radius: 0; }
.sp-bold i:nth-child(2) { left: 8px; top: 26px; width: 40%; height: 12px; background: var(--sc, #f97316); border-radius: 0; }
.sp-bold i:nth-child(3) { left: 8px; top: 45px; width: 24%; height: 8px; background: var(--sc, #f97316); border-radius: 0; }
.sp-bold i:nth-child(4) { right: 0; top: 0; width: 34%; height: 100%; background: #3f3f46; clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%); border-radius: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--panel); background: var(--c); box-shadow: 0 0 0 1.5px var(--line-2); transition: transform .15s; }
.sw:hover { transform: scale(1.08); }
.sw[aria-checked="true"] { box-shadow: 0 0 0 2.5px #fff; }
.sw-custom { position: relative; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); box-shadow: 0 0 0 1.5px var(--line-2); }
.sw-custom input { position: absolute; inset: -6px; width: 48px; height: 48px; opacity: 0; cursor: pointer; }
.toggles { display: grid; gap: 10px; }
.tg { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 13px 14px; cursor: pointer; }
.tg .ti { width: 38px; height: 38px; border-radius: 11px; background: rgba(139, 92, 246, .16); display: grid; place-items: center; font-size: 18px; flex: none; }
.tg div { flex: 1; line-height: 1.3; }
.tg strong { display: block; font-size: 14.5px; }
.tg small { color: var(--muted); font-size: 12.5px; }
.sw-t { position: relative; width: 44px; height: 26px; flex: none; }
.sw-t input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.sw-t span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); transition: background .2s; pointer-events: none; }
.sw-t span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.sw-t input:checked + span { background: var(--violet); }
.sw-t input:checked + span::after { transform: translateX(18px); }
.sw-t input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---------- Zusammenfassung / Erfolg ---------- */
.summary { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 16px; display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; margin-bottom: 18px; }
.sum-badge { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--g1); }
.summary strong { display: block; font-size: 16px; }
.summary span { font-size: 13px; color: var(--muted); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin: 6px 0 4px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--violet); }
.consent a { text-decoration: underline; }
.consent.invalid { color: var(--red); }
.form-msg { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; background: rgba(248, 113, 113, .12); color: #fecaca; border: 1px solid rgba(248, 113, 113, .3); }
.success { text-align: center; padding: 18px 4px; }
.success-ic { width: 76px; height: 76px; margin: 6px auto 18px; border-radius: 50%; background: var(--g1); display: grid; place-items: center; font-size: 34px; box-shadow: 0 20px 40px -16px rgba(139, 92, 246, .8); animation: popIn .6s var(--ease); }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } }
.success h1 { margin-bottom: 10px; }
.success p { color: var(--ink-2); margin-bottom: 10px; }
.share { display: flex; gap: 8px; margin: 18px 0 6px; }
.share input { flex: 1; min-width: 0; background: rgba(255, 255, 255, .05); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 13px; color: var(--ink-2); }
.next-list { text-align: left; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-top: 18px; display: grid; gap: 12px; }
.next-list div { display: flex; gap: 12px; font-size: 14px; color: var(--ink-2); }
.next-list b { flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(139, 92, 246, .2); color: #c4b5fd; font-size: 12px; display: grid; place-items: center; }
.privacy-note { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.5; }

/* ---------- Bühne / Vorschau ---------- */
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: radial-gradient(1200px 600px at 70% -10%, rgba(99, 102, 241, .18), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(236, 72, 153, .1), transparent 60%), var(--bg); }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 14px 22px; }
.devices { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.dev { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.dev[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--ink); }
.stage-bar .sp { flex: 1; }
.live-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.live-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.frame-wrap { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-start; padding: 0 22px 22px; overflow: auto; }
.frame { width: 100%; height: 100%; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08); display: flex; flex-direction: column; transition: width .45s var(--ease), max-width .45s var(--ease); max-width: 100%; }
.frame-top { height: 34px; flex: none; background: #f1f2f4; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid #e3e5e8; }
.frame-top i { width: 10px; height: 10px; border-radius: 50%; background: #d4d6da; }
.frame-top i:nth-child(1) { background: #fb7185; } .frame-top i:nth-child(2) { background: #fbbf24; } .frame-top i:nth-child(3) { background: #34d399; }
.frame-url { flex: 1; margin-left: 10px; height: 22px; border-radius: 7px; background: #fff; border: 1px solid #e3e5e8; font-size: 11.5px; color: #6b7280; display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.frame iframe { flex: 1; width: 100%; border: 0; display: block; background: #fff; }
.frame[data-dev="tablet"] { max-width: 820px; }
.frame[data-dev="mobile"] { max-width: 400px; border-radius: 34px; border: 10px solid #111; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .12); }
.frame[data-dev="mobile"] .frame-top { display: none; }
.empty { position: absolute; inset: 60px 22px 22px; display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 18px; padding: 30px; }
.empty-ill { width: 220px; margin: 0 auto 20px; }
.empty h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 14.5px; max-width: 40ch; margin: 0 auto; }
.gen { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(3, 7, 18, .82); backdrop-filter: blur(10px); }
.gen-box { width: min(380px, 90%); }
.gen-orb { width: 82px; height: 82px; margin: 0 auto 22px; border-radius: 50%; background: var(--g1); animation: orb 1.6s ease-in-out infinite; box-shadow: 0 0 60px rgba(139, 92, 246, .6); }
@keyframes orb { 50% { transform: scale(1.08) rotate(180deg); border-radius: 42%; } }
.gen h3 { text-align: center; font-size: 19px; margin-bottom: 18px; }
.gen ul { list-style: none; display: grid; gap: 10px; }
.gen li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--muted); transition: color .3s; }
.gen li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; transition: all .3s; }
.gen li.on { color: var(--ink); }
.gen li.on::before { border-color: var(--violet); border-top-color: transparent; animation: spin .8s linear infinite; }
.gen li.ok { color: var(--ink-2); }
.gen li.ok::before { border: 0; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 10.5 2.5 2.5L14 7.5' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/100%; animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.mob-preview { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: #fff; color: #111; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .6); animation: stepIn .3s var(--ease); max-width: calc(100% - 32px); text-align: center; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .studio { grid-template-columns: 400px 1fr; }
  .dev span { display: none; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  html, body { height: auto; }
  .tb-title { display: none; }
  .studio { display: block; height: auto; }
  .panel { border-right: 0; min-height: calc(100dvh - 64px); }
  .panel-body { overflow: visible; padding-bottom: 120px; }
  .panel-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; box-shadow: 0 -20px 30px -20px rgba(0, 0, 0, .7); }
  .stage { position: fixed; inset: 0; z-index: 50; transform: translateY(100%); transition: transform .45s var(--ease); visibility: hidden; }
  .stage.open { transform: none; visibility: visible; }
  .stage-bar { padding: 12px 14px; gap: 8px; }
  .stage-bar .live-tag, .stage-bar [data-full], .stage-bar .lbl { display: none !important; }
  .stage-bar .devices { flex: none; }
  .frame-wrap { padding: 0 10px 10px; }
  .frame[data-dev="mobile"] { border-width: 6px; border-radius: 26px; }
  .mob-close { display: inline-flex !important; }
  .mob-preview { display: inline-flex; }
  .empty { inset: 64px 12px 12px; }
}
@media (max-width: 520px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .tb-link.hide-xs { display: none; }
  .steps-nav, .step-meta { padding-left: 18px; padding-right: 18px; }
  .panel-body { padding: 18px 18px 120px; }
  .panel-foot { padding-left: 14px; padding-right: 14px; }
  .step h1 { font-size: 23px; }
  .branches { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .br { min-height: 88px; font-size: 12px; padding: 12px 4px; }
  .styles { gap: 8px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .devices .dev[data-dev="tablet"] { display: none; }
  .stage-bar { gap: 8px; }
  .stage-bar .live-tag, .stage-bar [data-full], .stage-bar .lbl { display: none !important; }
}
.mob-close { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
