/* Finestra dimostrativa di Forma, con i ritagli del widget originale. */
@font-face {
  font-family: Geist;
  src: url(../assets/fonts/Geist-Variable.woff2) format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

.forma-demo {
  /* La cornice segue la sezione lead. I suoi contenuti restano centrati su 1142px. */
  --forma-side-space: max(0px, calc((100% - 1142px) / 2));
  overflow: hidden;
  border: 9px solid #000;
  border-radius: 16px;
  background: #fff;
  color: #111;
}
.forma-demo__controls {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 12px calc(22px + var(--forma-side-space));
}
.forma-demo[data-enhanced] .forma-demo__controls { display: flex; }
.forma-demo__steps {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.forma-demo__steps .lead-flow__step { height: 100%; align-items: center; flex-direction: row; gap: 8px; padding-bottom: 8px; font-size: 13px; }
.forma-demo__steps .lead-flow__number { width: 28px; height: 28px; flex-basis: 28px; font-size: 12px; }
.forma-demo__play {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #aaa;
  border-radius: 50%;
  cursor: pointer;
}
.forma-demo__play:hover { background: #eee; }
.forma-demo__play:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.forma-demo__play-icon, .forma-demo[data-manual] .forma-demo__pause-icon { display: none; }
.forma-demo[data-manual] .forma-demo__play-icon { display: block; }
.forma-window {
  padding: clamp(16px, 2vw, 24px) calc(clamp(16px, 2.5vw, 32px) + var(--forma-side-space)) 0;
  background: #191919;
  color: #fff;
  font: 400 14px/1.4 Geist, 'Geist Fallback', system-ui, sans-serif;
}
.forma-window__brand, .forma-window__footer { display: flex; align-items: center; gap: 14px; }
.forma-window__brand { margin-bottom: 16px; font-weight: 600; }
.forma-window__cogitas { width: clamp(100px, 11vw, 134px); filter: brightness(0) invert(1); }
.forma-window__wordmark { box-sizing: content-box; width: 58px; padding-left: 14px; border-left: 1px solid #888; }
.forma-window__close { margin-left: auto; font-size: 26px; font-weight: 400; line-height: 1; }
.forma-window__body { display: grid; align-items: stretch; grid-template-columns: minmax(0, 1.18fr) minmax(0, .88fr); gap: clamp(18px, 3vw, 40px); }
.forma-window__setup { align-self: center; min-width: 0; }
.forma-window__setup, .forma-window__progress-titles, .forma-preview__greetings,
.forma-demo[data-enhanced] .forma-demo__notes { display: grid; }
.forma-window__setup > *, .forma-window__progress-titles > *, .forma-preview__greetings > *,
.forma-demo[data-enhanced] [data-forma-note] { grid-area: 1 / 1; align-self: center; }
.forma-window__heading {
  max-width: 24em;
  margin: 0;
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.16;
  letter-spacing: -.025em;
}
.forma-window__mode { display: inline-block; margin-bottom: 10px; padding: 5px 14px; border-radius: 8px; background: #fff; color: #171717; font-size: 19px; }
.forma-window__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.forma-window__choice { display: grid; align-content: space-between; gap: 18px; padding: 14px; border: 1px solid #ccc; border-radius: 12px; line-height: 1.4; }
.forma-window__choice--ai { background: #fff; color: #151515; border-color: #fff; }
.forma-window__choice p { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: clamp(18px, 1.6vw, 22px); }
.forma-window__choice small { border-radius: 6px; padding: 3px 7px; background: #141414; color: #fff; font-size: 11px; font-weight: 600; }
.forma-window__choice p span, .forma-window__skip, .forma-window__deploy { margin-left: auto; }
.forma-window__form { padding: 10px; margin-top: 14px; border-radius: 10px; color: #151515; background: #fff; }
.forma-window__url, .forma-window__rights { display: flex; align-items: center; gap: 10px; }
.forma-window__url { justify-content: space-between; border: 2px solid #505050; border-radius: 9px; padding: 4px 6px 4px 10px; font-size: clamp(14px, 1.35vw, 17px); }
.forma-window__url b { border-radius: 6px; padding: 2px 7px; background: #151515; color: #fff; font-size: 18px; }
.forma-window__rights { align-items: baseline; margin-top: 9px; font-size: 12px; }
.forma-window__rights span { flex: none; padding: 0 3px; border: 1px solid #333; border-radius: 3px; color: #fff; background: #151515; font-size: 11px; }
.forma-window__progress { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 16px; }
.forma-window__log { display: flex; flex-direction: column-reverse; align-items: flex-start; min-height: 84px; gap: 4px; padding: 0; margin: 0; list-style: none; }
.forma-window__log li { padding: 3px 7px; border: 1px solid #aaa; border-radius: 7px; font-size: 14px; line-height: 1.3; }
.forma-window__meter { flex: none; display: grid; justify-items: center; gap: 5px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1; font-variant-numeric: tabular-nums; }
.forma-window__meter svg { box-sizing: content-box; width: 22px; height: 22px; padding: 8px; border: 1px solid #888; border-radius: 8px; }
.forma-window__footer { margin-top: 12px; min-height: 36px; border-top: 1px solid #666; font-size: 12px; }
.forma-preview { min-width: 0; padding: 10px; border-radius: 13px; background: #f7f7f7; color: #141414; }
/* Spend available desktop height on the chat preview. The controls and caption keep their readable sizes. */
.forma-preview__widget { display: flex; flex-direction: column; min-height: clamp(216px, calc(100dvh - 420px), 332px); height: 100%; border: 1px solid #131313; border-radius: 10px; overflow: hidden; background: #fff; }
.forma-preview__head { position: relative; display: flex; align-items: center; padding: 9px 12px; background: #000; color: #fff; }
.forma-preview__head img { position: absolute; right: 0; width: auto; height: 26px; max-width: none; clip-path: inset(0 0 0 80%); }
.forma-preview__head strong { font-size: 14px; }
.forma-preview__messages { flex: 1; padding: 9px; font-size: 13px; line-height: 1.45; }
.forma-preview__greeting { margin: 0; padding: 8px 10px; background: #f3f3f4; border-radius: 10px 10px 10px 3px; }
.forma-preview__suggestions { display: flex; flex-wrap: wrap; align-content: start; gap: 5px; margin-top: 7px; }
.forma-preview__suggestions span { padding: 4px 7px; border: 1px solid #333; border-radius: 7px; font-size: .92em; }
.forma-preview__footer { border-top: 1px solid #ddd; padding: 6px 8px 4px; background: #fff; }
.forma-preview__composer { position: relative; container-type: inline-size; }
.forma-preview__composer img { display: block; width: 100%; height: auto; }
.forma-preview__hint { position: absolute; inset: 12% 12% 12% 2%; display: flex; align-items: center; padding-left: 1%; background: #fff; color: #646464; font-size: clamp(10px, 3cqi, 13px); line-height: 1.1; }
.forma-preview__footer > img { display: block; width: 106px; margin: 6px auto 0; }
.forma-demo__notes { border-top: 1px solid #ddd; padding: 12px calc(22px + var(--forma-side-space)); font-size: 14px; line-height: 1.5; }
.forma-demo__notes p { margin: 0; }
.forma-demo__notes p + p { margin-top: 8px; }
.forma-demo[data-enhanced] .forma-demo__notes p { margin: 0; }
.forma-demo__notes strong { font-family: 'JetBrains Mono', monospace; }
.forma-demo [data-forma-scene], .forma-demo[data-enhanced] [data-forma-note] { visibility: hidden; }
.forma-after-profile, .forma-after-ready, .forma-window__deploy { display: none; }
.forma-demo[data-stage="0"] [data-forma-scene="0"], .forma-demo[data-stage="1"] [data-forma-scene="1"],
.forma-demo:is([data-stage="2"],[data-stage="3"]) [data-forma-scene="progress"],
.forma-demo[data-stage="2"] [data-forma-scene="2"], .forma-demo[data-stage="3"] [data-forma-scene="3"],
.forma-demo[data-stage="0"] [data-forma-note="0"], .forma-demo[data-stage="1"] [data-forma-note="1"],
.forma-demo[data-stage="2"] [data-forma-note="2"], .forma-demo[data-stage="3"] [data-forma-note="3"] { visibility: visible; }
.forma-demo[data-profile] .forma-after-profile, .forma-demo[data-chat-ready] .forma-after-ready,
.forma-demo:is([data-stage="2"],[data-stage="3"]) .forma-window__deploy { display: inline; }
.forma-demo[data-profile] .forma-before-profile, .forma-demo[data-chat-ready] .forma-before-ready,
.forma-demo:is([data-stage="2"],[data-stage="3"]) :is(.forma-window__first-use,.forma-window__skip),
.forma-demo:not([data-profile]) .forma-preview__head img { display: none; }
.forma-demo .forma-preview__greeting { display: block; align-self: start; }
.forma-demo[data-profile] .forma-preview__greeting.forma-before-profile { display: block; visibility: hidden; }
.forma-demo:not([data-profile]) .forma-preview__greeting.forma-after-profile,
.forma-demo:not([data-questions]) .forma-preview__suggestions { visibility: hidden; }
.forma-demo[data-stage="2"] .forma-window__deploy { opacity: .5; }
@media (prefers-reduced-motion: no-preference) {
  .forma-demo[data-enhanced][data-stage="0"]:not([data-selected]) .forma-window__choice--ai p span { animation: forma-choose .65s 2.7s ease-in-out 2; }
  .forma-demo[data-enhanced][data-stage="1"]:not([data-selected]) .forma-window__url-value { animation: forma-type 1.7s steps(22,end) .3s both; }
  .forma-demo[data-enhanced][data-stage="1"]:not([data-selected]) .forma-window__rights span { animation: forma-check .2s 2.2s both; }
  .forma-demo[data-stage="2"] .forma-window__meter svg path { transform-origin: center; animation: forma-turn 2.4s linear infinite; }
  .forma-demo[data-stopped] * { animation-play-state: paused !important; }
}
@keyframes forma-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes forma-check { from { background: #fff; } to { background: #151515; } }
@keyframes forma-choose { 50% { transform: translateX(4px); } }
@keyframes forma-turn { to { transform: rotate(360deg); } }
@media (min-width: 851px) and (max-height: 650px) {
  .forma-window { padding-top: 16px; }
  .forma-window__brand { margin-bottom: 12px; }
  .forma-window__footer { margin-top: 8px; }
}
@media (max-width: 850px) {
  .forma-demo__controls { gap: 14px; padding: 15px; }
  .forma-demo__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
  .forma-demo__steps .lead-flow__step { gap: 8px; font-size: 13px; }
  .forma-window__body { grid-template-columns: 1fr; gap: 14px; }
  .forma-preview__widget { min-height: 220px; }
}
@media (max-width: 520px) {
  .forma-demo { border-width: 6px; }
  .forma-demo__controls { align-items: flex-start; gap: 9px; padding: 12px 10px; }
  .forma-demo__steps { gap: 8px; }
  .forma-demo__steps .lead-flow__step { font-size: 11px; gap: 5px; }
  .forma-demo__steps .lead-flow__number { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; }
  .forma-demo__play { width: 32px; height: 32px; }
  .forma-window { padding: 16px 12px 0; }
  .forma-window__brand { flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }
  .forma-window__brand > span { order: 1; flex-basis: 100%; font-size: 11px; }
  .forma-window__choices { gap: 8px; }
  .forma-window__choice { font-size: 12px; padding: 10px; }
  .forma-window__choice p { gap: 4px; }
  .forma-window__choice p span { display: none; }
  .forma-window__choice small { font-size: 9px; padding: 2px 4px; }
  .forma-window__footer { font-size: 10px; }
  .forma-window__skip { flex-shrink: 0; }
  .forma-demo__notes { padding: 12px; font-size: 13px; }
}
