/* Founder-OS x Dibicon Voice-Demo - Design-System
   Dibicon-Palette, mobile-first, State-Machine setup -> call -> payoff */

:root {
  --navy-900: #000A3A;
  --navy-800: #0D1644;
  --navy-700: #131e5c;
  --blue-600: #1A52E8;
  --blue-700: #003DD4;
  --green: #22C55E;
  --green-700: #16a34a;
  --red: #EF4444;
  --grey-200: #E2E8F0;
  --grey-400: #94A3B8;
  --grey-600: #475569;
  --white: #FFFFFF;
  --wa-bg: #ECE5DD;
  --wa-bubble: #FFFFFF;
  --wa-header: #075E54;
  --wa-out: #DCF8C6;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(0, 10, 58, 0.08);
  --shadow: 0 8px 30px rgba(0, 10, 58, 0.12);
  --shadow-lg: 0 24px 60px rgba(0, 10, 58, 0.22);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--navy-800);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(26, 82, 232, 0.18), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-800) 55%, #050d33);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ---------- App-Shell ---------- */
.app {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 18px 36px;
  display: flex;
  flex-direction: column;
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 0 22px;
  color: var(--white);
}
.brandbar .logo {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brandbar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
.brandbar .x { color: var(--grey-400); font-weight: 500; }

/* ---------- Steps / State-Machine ---------- */
.step { display: none; animation: stepIn 0.5s var(--ease) both; }
.step.active { display: block; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 18px;
}
.progress span {
  width: 34px; height: 4px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.4s var(--ease);
}
.progress span.on { background: var(--blue-600); }
.progress span.done { background: var(--green); }

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 22px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 10px;
}
h1 {
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.lead {
  color: var(--grey-600);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 22px;
}

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 7px;
}
.field .hint {
  font-weight: 400;
  color: var(--grey-400);
  font-size: 12px;
}
input[type="text"], textarea, select {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--navy-800);
  background: #F8FAFC;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 13px 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue-600);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(26, 82, 232, 0.12);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  border: none;
  border-radius: var(--radius);
  padding: 15px 18px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(26, 82, 232, 0.34);
  transition: transform 0.12s var(--ease), box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(26, 82, 232, 0.42); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: transparent;
  color: var(--grey-600);
  box-shadow: none;
  font-weight: 600;
  font-size: 14px;
}
.btn-ghost:hover { transform: none; box-shadow: none; color: var(--navy-800); }
.btn-danger {
  background: linear-gradient(180deg, #f15a5a, var(--red));
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.34);
}

.tester-tip {
  margin-top: 16px;
  font-size: 13px;
  color: var(--grey-600);
  background: #F1F5F9;
  border-radius: var(--radius);
  padding: 12px 14px;
  line-height: 1.5;
}
.tester-tip b { color: var(--navy-800); }

/* ---------- Akt 2: Call-Screen ---------- */
.callscreen {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--white);
  padding: 34px 22px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 540px;
  display: flex;
  flex-direction: column;
}
.callscreen .bt-name {
  font-size: 13px;
  color: var(--grey-400);
  margin-bottom: 4px;
}
.callscreen .status {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-600);
  letter-spacing: 0.01em;
  margin-bottom: 30px;
  min-height: 20px;
}
.callscreen .status.live { color: var(--green); }
.callscreen .status.err { color: var(--red); }

.avatar-wrap {
  position: relative;
  width: 132px; height: 132px;
  margin: 6px auto 18px;
}
.avatar {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--blue-600), #6f8dff);
  display: flex; align-items: center; justify-content: center;
  font-size: 50px; font-weight: 800; color: var(--white);
  box-shadow: 0 14px 40px rgba(26, 82, 232, 0.5);
  z-index: 2;
}
.ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(26, 82, 232, 0.5);
  animation: ringPulse 1.8s ease-out infinite;
}
.ring:nth-child(2) { animation-delay: 0.6s; }
.ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes ringPulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}
.avatar-wrap.connecting .ring { border-color: rgba(148, 163, 184, 0.45); }
.avatar-wrap.speaking .ring { border-color: rgba(34, 197, 94, 0.6); animation-duration: 1.1s; }
.avatar-wrap.idle .ring { animation-play-state: paused; opacity: 0; }

.ela-name { font-size: 21px; font-weight: 700; margin-bottom: 2px; }
.ela-role { font-size: 13px; color: var(--grey-400); margin-bottom: 26px; }

/* Wellenform */
.wave {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; height: 46px; margin-bottom: 28px;
}
.wave span {
  width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--blue-600), #6f8dff);
  height: 8px;
  transition: height 0.12s ease;
}
.wave.active span { animation: waveBar 0.9s ease-in-out infinite; }
.wave.active span:nth-child(1) { animation-delay: 0s; }
.wave.active span:nth-child(2) { animation-delay: 0.12s; }
.wave.active span:nth-child(3) { animation-delay: 0.24s; }
.wave.active span:nth-child(4) { animation-delay: 0.36s; }
.wave.active span:nth-child(5) { animation-delay: 0.18s; }
.wave.active span:nth-child(6) { animation-delay: 0.30s; }
.wave.active span:nth-child(7) { animation-delay: 0.06s; }
@keyframes waveBar {
  0%, 100% { height: 8px; }
  50% { height: 38px; }
}

.who-talks {
  font-size: 13px;
  color: var(--grey-400);
  margin-bottom: 8px;
  min-height: 18px;
}
.who-talks b { color: var(--white); }

.transcript {
  flex: 1;
  text-align: left;
  margin: 6px 0 18px;
  max-height: 150px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  display: none;
}
.transcript.on { display: block; }
.transcript .line { margin-bottom: 6px; color: var(--grey-200); }
.transcript .line.ela { color: #aebfff; }

.call-actions { margin-top: auto; }
.timer {
  font-size: 13px;
  color: var(--grey-400);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.mic-warn {
  display: none;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
  text-align: left;
}
.mic-warn.on { display: block; }

/* ---------- Akt 3: WhatsApp-Payoff ---------- */
.wa-frame {
  background: var(--wa-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 560px;
}
.wa-head {
  background: var(--wa-header);
  color: var(--white);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.wa-head .gico {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.wa-head .gmeta { line-height: 1.3; min-width: 0; }
.wa-head .gname { font-weight: 700; font-size: 15px; }
.wa-head .gsub {
  font-size: 12px; color: rgba(255, 255, 255, 0.75);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.wa-body {
  flex: 1;
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background-image:
    radial-gradient(rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 18px 18px;
}
.wa-sys {
  align-self: center;
  background: #FFF4C8;
  color: #5b5326;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  max-width: 90%;
}
.wa-msg {
  align-self: flex-start;
  background: var(--wa-bubble);
  border-radius: 10px;
  border-top-left-radius: 2px;
  padding: 9px 12px 7px;
  box-shadow: var(--shadow-sm);
  max-width: 86%;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
  position: relative;
}
.wa-msg .sender {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-600);
  margin-bottom: 2px;
}
.wa-msg .time {
  font-size: 10px;
  color: var(--grey-400);
  text-align: right;
  margin-top: 3px;
}
.wa-msg.summary { white-space: pre-line; }
.wa-msg .badge-ok {
  display: inline-block;
  background: rgba(34, 197, 94, 0.16);
  color: var(--green-700);
  font-weight: 700;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.wa-enter { animation: waPop 0.32s var(--ease) both; }
@keyframes waPop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tipp-Indikator */
.typing {
  align-self: flex-start;
  background: var(--wa-bubble);
  border-radius: 10px;
  border-top-left-radius: 2px;
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 4px;
}
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grey-400);
  animation: typeDot 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typeDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.payoff-badge {
  align-self: center;
  background: var(--navy-800);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-top: 4px;
}
.payoff-badge b { color: var(--green); }

.wa-footer {
  background: var(--white);
  padding: 16px;
  text-align: center;
  border-top: 1px solid var(--grey-200);
}
.wa-footer .cta-line {
  font-size: 14px;
  color: var(--navy-800);
  font-weight: 600;
  margin-bottom: 12px;
}

.restart {
  text-align: center;
  margin-top: 18px;
}

/* Footer global */
.foot-note {
  text-align: center;
  color: var(--grey-400);
  font-size: 12px;
  margin-top: 20px;
  line-height: 1.5;
}
.foot-note a { color: var(--grey-200); }

@media (min-width: 540px) {
  h1 { font-size: 29px; }
}
