/* ==========================================================================
   Kideon Connect: Live-Demo „Probier es aus“ (/connect/#live) und Passwort-Test.
   Vier Schritte: Starten, Fragen, Rechte, Beenden. Zustand über data-step auf
   .live-stage, Inhalte des Chats setzt js/connect-live.js. Ohne JS bleibt Schritt 2
   stehen, und alle vier Schritte sind als Liste lesbar.
   ========================================================================== */

/* Kennzahlen */
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0 0 clamp(40px, 5vw, 64px); }
.live-stat { border-top: 1px solid var(--border-strong); padding-top: 18px; }
.live-stat b { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -.02em; color: var(--navy); }
.live-stat span { display: block; margin-top: 10px; font-size: 15px; color: var(--text-secondary); text-wrap: balance; }

/* Aufbau: Schritte links, Bildschirm rechts */
.live { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.live-steps { list-style: none; padding: 0; margin: 0; counter-reset: live; }
.live-steps li { border-top: 1px solid var(--border); }
.live-steps li:last-child { border-bottom: 1px solid var(--border); }
.live-step { display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; width: 100%; text-align: left; padding: 18px 4px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.live-step .n { grid-row: span 2; font-family: var(--font-mono); font-size: 12px; color: var(--accent-deep); padding-top: 6px; }
.live-step .t { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; }
.live-step .c { font-size: 15px; color: var(--text-secondary); line-height: 1.55; }
.live-step[aria-selected="true"] .t { color: var(--accent-deep); }
.js-live .live-step:not([aria-selected="true"]) .c { display: none; }
.js-live .live-step:not([aria-selected="true"]) .t { color: var(--text-secondary); }
.live-step:hover .t { color: var(--navy); }
.live-replay { margin-top: 18px; display: none; font-size: 14px; color: var(--navy); background: none; border: 0; padding: 0; border-bottom: 1px solid rgba(196,154,108,.5); cursor: pointer; }
.js-live .live-replay { display: inline-block; }

/* Bildschirm */
.live-stage { position: relative; border-radius: 18px; border: 1px solid var(--border-strong); background: linear-gradient(160deg, #e9eef3 0%, #dfe6ee 100%); box-shadow: var(--shadow-md); overflow: hidden; aspect-ratio: 16 / 11; min-height: 380px; display: grid; grid-template-rows: 1fr 40px; }
.live-desk { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 20px; min-height: 0; }

/* Datei auf dem Desktop */
.live-file { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; font-size: 12px; color: var(--navy); text-align: center; }
.live-file i { width: 52px; height: 52px; border-radius: 12px; background: var(--navy); color: #fff; display: grid; place-items: center; font-style: normal; font-family: var(--font-display); font-size: 28px; box-shadow: 0 6px 16px rgba(15,33,55,.25); transition: transform .25s var(--ease); }
.live-stage[data-step="0"].go .live-file i { animation: live-dbl .5s var(--ease) 2; }
@keyframes live-dbl { 50% { transform: scale(.88); } }

/* Hinweisfenster von Kideon Connect */
.live-toast { position: absolute; right: 20px; bottom: 14px; width: min(300px, 70%); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); padding: 14px 16px; font-size: 13px; line-height: 1.5; color: var(--navy); opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease), transform .5s var(--ease); pointer-events: none; z-index: 2; }
.live-toast strong { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; }
.live-toast strong::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--status-green, #4a7a4d); }
.live-toast small { display: block; color: var(--text-secondary); font-size: 12px; }
.live-stage[data-step="0"].toast .live-toast { opacity: 1; transform: none; }
.live-stage[data-step="3"].toast .live-toast { opacity: 1; transform: none; }
.live-stage[data-step="3"] .live-toast strong::before { background: #9aa5b1; }

/* Chatfenster */
.live-chat { background: #fff; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; box-shadow: var(--shadow-sm); }
.live-chat-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }
.live-chat-bar { flex-wrap: wrap; }
.live-chat-bar b { font-weight: 600; color: var(--navy); white-space: nowrap; }
.live-who { font-family: var(--font-mono); font-size: 11px; }
.live-msgs { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 16px; min-height: 0; }
.live-msgs p { margin: 0; max-width: 88%; padding: 11px 14px; font-size: 14px; line-height: 1.5; border-radius: 14px; opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease), transform .45s var(--ease); }
.live-msgs p.in { opacity: 1; transform: none; }
.live-msgs .q { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.live-msgs .a { align-self: flex-start; background: var(--bg-alt); color: var(--navy); border-bottom-left-radius: 4px; }
.live-msgs .a small { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); }
.live-msgs .a.off { background: #fbf3ea; }
.live-msgs .dots { align-self: flex-start; background: var(--bg-alt); padding: 12px 14px; border-radius: 14px; display: flex; gap: 4px; }
.live-msgs .dots span { width: 6px; height: 6px; border-radius: 50%; background: #9aa5b1; animation: live-dot 1s infinite; }
.live-msgs .dots span:nth-child(2) { animation-delay: .15s; }
.live-msgs .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes live-dot { 50% { opacity: .3; } }
.live-empty { margin: 8% auto auto; text-align: center; font-size: 13px; color: var(--text-secondary); max-width: 260px; }

/* Taskleiste */
.live-bar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 14px; background: rgba(255,255,255,.72); border-top: 1px solid rgba(15,33,55,.08); font-family: var(--font-mono); font-size: 11px; color: var(--navy); }
.live-tray { display: flex; align-items: center; gap: 7px; }
.live-tray i { width: 20px; height: 20px; border-radius: 6px; background: #9aa5b1; color: #fff; display: grid; place-items: center; font-style: normal; font-family: var(--font-display); font-size: 13px; transition: background .4s var(--ease), box-shadow .4s var(--ease); }
.live-tray em { font-style: normal; color: var(--text-secondary); }
.live-stage.on .live-tray i { background: var(--navy); box-shadow: 0 0 0 3px rgba(74,122,77,.35); }

/* Passwort-Test */
.ptest { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ptest th, .ptest td { text-align: left; vertical-align: top; padding: 18px 22px; border-top: 1px solid var(--border); font-size: 15.5px; line-height: 1.5; }
.ptest thead th { border-top: 0; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--bg-alt); }
.ptest thead th.kd { color: var(--accent-deep); }
.ptest tbody th { font-weight: 500; color: var(--navy); width: 26%; }
.ptest td { color: var(--text-secondary); width: 37%; }
.ptest td.kd { color: var(--navy); background: rgba(196,154,108,.07); font-weight: 500; }
.ptest-note { margin-top: 18px; font-size: 14px; color: var(--text-secondary); max-width: 820px; }

@media (max-width: 960px) {
  .live { grid-template-columns: 1fr; }
  .live-stage { order: -1; }
}
@media (max-width: 700px) {
  .live-stats { grid-template-columns: 1fr; gap: 12px; }
  .live-stat { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 14px; }
  .live-stat span { margin: 0; }
  .live-stage { aspect-ratio: auto; min-height: 460px; }
  .live-desk { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 14px; gap: 12px; }
  .live-file { flex-direction: row; padding: 0; }
  .live-file i { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
  .live-toast { left: 14px; right: 14px; width: auto; }
  .ptest thead { display: none; }
  .ptest, .ptest tbody, .ptest tr, .ptest th, .ptest td { display: block; width: auto; }
  .ptest tbody th, .ptest td { width: auto; }
  .ptest tbody th { padding-bottom: 6px; background: var(--bg-alt); }
  .ptest td { border-top: 0; padding-top: 6px; }
  .ptest td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
  .ptest td.kd::before { color: var(--accent-deep); }
}
@media (prefers-reduced-motion: reduce) {
  .live-msgs p, .live-toast, .live-tray i { transition: none; }
  .live-stage .live-file i, .live-msgs .dots span { animation: none !important; }
}
