/* Meu Portal · 12 — construtor com prévia
   Palco do construtor, painel da prévia ao vivo, moldura do celular e o formulário de prévia (.pv-*). */

/* ── Builder stage com preview ao vivo ─────────────────── */
body.aw-builder-open { overflow: hidden; }
.aw-stage { display: flex; gap: 1.5rem; align-items: flex-start; width: 100%; max-width: 1180px; margin: 0 auto; justify-content: center; transition: max-width .25s ease; }
.aw-stage.preview-floating { max-width: 760px; }

/* ── Preview dock ─────────────────────────────────────── */
.preview-dock {
  position: sticky; top: 0; width: 380px; flex-shrink: 0; align-self: flex-start;
  background: #fff; border-radius: 18px; box-shadow: 0 24px 64px rgba(0,0,0,.18);
  overflow: hidden; display: flex; flex-direction: column;
}
.preview-dock.floating {
  position: fixed; right: 24px; bottom: 24px; top: auto; left: auto;
  width: 340px; z-index: 250; box-shadow: 0 40px 90px rgba(0,0,0,.35);
}
.preview-dock.dragging { transition: none; user-select: none; }
.preview-head {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem;
  background: linear-gradient(150deg, var(--brand,#0f766e), var(--brand-dark,#0b5f58)); color: #fff;
}
.preview-dock.floating .preview-head { cursor: grab; }
.preview-dock.floating .preview-head:active { cursor: grabbing; }
.preview-head-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: .86rem; display: flex; align-items: center; gap: .45rem; }
.preview-pulse { width: 8px; height: 8px; border-radius: 50%; background: #bbf7d0; box-shadow: 0 0 0 0 rgba(187,247,208,.8); }
.preview-pulse.pulsing { animation: pvpulse .7s ease-out; }
@keyframes pvpulse { 0% { box-shadow: 0 0 0 0 rgba(187,247,208,.85); } 100% { box-shadow: 0 0 0 9px rgba(187,247,208,0); } }
.preview-count { font-size: .72rem; opacity: .85; margin-left: .1rem; }
.preview-head-actions { margin-left: auto; display: flex; gap: .35rem; }
.preview-head-actions button {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); color: #fff;
  border-radius: 7px; font: inherit; font-size: .72rem; font-weight: 600; padding: .28rem .5rem; cursor: pointer; white-space: nowrap;
}
.preview-head-actions button:hover { background: rgba(255,255,255,.28); }
.preview-toolbar { display: flex; align-items: center; gap: .5rem; padding: .55rem .85rem; background: #f3f6f5; border-bottom: 1px solid #e6ece9; }
.device-seg { display: inline-flex; background: #e2e8e5; border-radius: 8px; padding: 2px; }
.device-seg button { border: none; background: none; font: inherit; font-size: .74rem; font-weight: 600; color: #4b5563; padding: .25rem .6rem; border-radius: 6px; cursor: pointer; }
.device-seg button.active { background: #fff; color: var(--brand-dark,#0b5f58); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.preview-toolbar-hint { font-size: .72rem; color: #6b7280; margin-left: auto; }
.preview-body { padding: 1.1rem; background: #eef2f0; display: flex; flex-direction: column; align-items: center; }
.preview-dock.collapsed .preview-body, .preview-dock.collapsed .preview-toolbar { display: none; }

/* Phone frame */
.aw-phone { background: #14171a; border-radius: 40px; padding: 9px; box-shadow: 0 22px 48px rgba(0,0,0,.3); width: 320px; position: relative; transition: width .2s ease, border-radius .2s ease, padding .2s ease; }
.aw-phone::before { content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 92px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.22); }
.preview-screen { background: var(--bg,#f7f8f2); border-radius: 32px; height: 552px; overflow-y: auto; overflow-x: hidden; padding: 26px 0 18px; }
.device-desktop .aw-phone { width: 100%; border-radius: 16px; padding: 0; }
.device-desktop .aw-phone::before { display: none; }
.device-desktop .preview-screen { border-radius: 14px; height: 520px; padding: 18px 0; }
.preview-screen::-webkit-scrollbar { width: 6px; }
.preview-screen::-webkit-scrollbar-thumb { background: #cbd5d1; border-radius: 99px; }

/* Preview form (espelha form.html) */
.pv-card { width: 100%; max-width: 300px; margin: 0 auto; background: #fff; border: 1px solid #d7ddd9; border-radius: 18px; padding: 24px 18px 22px; box-shadow: 0 8px 28px rgba(17,34,38,.07); }
.device-desktop .pv-card { max-width: 420px; }
.pv-title { font-family: "Space Grotesk", sans-serif; font-size: .96rem; font-weight: 700; color: #132022; margin: 0 0 6px; text-align: center; line-height: 1.28; }
.device-desktop .pv-title { font-size: 1.08rem; }
.pv-title-ghost { color: #aeb6b3; font-weight: 600; }
.pv-business { color: var(--brand-dark,#0b5f58); font-size: .72rem; font-weight: 700; text-align: center; margin: 0 0 10px; }
.pv-desc { font-size: .8rem; color: #5e6c70; text-align: center; margin: 0 0 18px; line-height: 1.5; }
.pv-desc-bottom { margin: 10px 0 14px; }
.pv-divider { border: none; border-top: 1px solid #e3e8e4; margin: 0 0 18px; }
.pv-fields { display: flex; flex-direction: column; gap: 15px; }
.pv-field { display: flex; flex-direction: column; }
.pv-field-hidden { display: none; }
.pv-label { font-size: .8rem; font-weight: 600; color: #132022; margin-bottom: 6px; }
.pv-req { color: #c53030; margin-left: 2px; }
.pv-input { width: 100%; padding: 10px 12px; font-family: inherit; font-size: .86rem; color: #132022; background: #fff; border: 1px solid #d7ddd9; border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
.pv-input:focus { border-color: var(--brand,#0f766e); box-shadow: 0 0 0 3px rgba(15,118,110,.14); }
select.pv-input { appearance: none; -webkit-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 d='M1 1l5 5 5-5' stroke='%235e6c70' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
select.pv-input[multiple] { background-image: none; padding-right: 12px; }
.pv-textarea { resize: none; min-height: 64px; }
.pv-help { font-size: .68rem; color: #6b7280; margin: 5px 0 0; }
.pv-noFields { color: #9ca3af; font-size: .82rem; text-align: center; padding: .5rem 0; }
.pv-submit { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; margin-top: 18px; background: var(--brand,#0f766e); color: #fff; font-family: inherit; font-size: .92rem; font-weight: 700; border: none; border-radius: 12px; cursor: not-allowed; opacity: .8; }
.pv-footer { margin-top: 16px; text-align: center; font-size: .72rem; color: #5e6c70; }
.pv-footer span { color: var(--brand,#0f766e); font-weight: 600; }
.pv-empty { text-align: center; padding: 60px 26px; color: #6b7280; }
.pv-empty-glyph { font-size: 2.4rem; margin-bottom: .6rem; opacity: .7; }
.pv-empty-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: .96rem; color: #475569; margin: 0 0 .4rem; }
.pv-empty-sub { font-size: .8rem; line-height: 1.5; margin: 0 auto; max-width: 30ch; }

@media (max-width: 1080px) {
  .aw-stage { flex-direction: column; align-items: center; }
  .preview-dock { position: sticky; top: 0; width: 100%; max-width: 720px; order: -1; }
  .preview-body { background: #eef2f0; }
  .aw-phone { width: 300px; }
}

/* ── Bot-linked AgendaAi preview (sempre fixo no lado direito) ─────── */
.bot-preview-dock {
  position: fixed; right: 24px; top: 80px;
  width: 360px; z-index: 200;
  display: none;
}
.bot-preview-dock.bot-preview-visible { display: flex; }
@media (max-width: 1100px) {
  .bot-preview-dock { display: none !important; }
}
