/* ---------- Demo page layout ---------- */
.demo-page { padding: 56px 0 100px; min-height: 70vh; }
.demo-step { max-width: 1100px; margin: 0 auto; }
.demo-step-wide { max-width: 1760px; padding: 0 24px; }
.demo-intro { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.demo-intro h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); margin-bottom: 14px; }
.demo-sub { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Lead form ---------- */
.demo-form {
  max-width: 440px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.form-row input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.form-row input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.demo-legal { font-size: 0.78rem; color: var(--text-muted); text-align: center; }
.demo-legal a { color: var(--red); font-weight: 600; }

/* ---------- Selector de tipo de negocio ---------- */
.vertical-picker {
  display: flex;
  gap: 2px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.vertical-option { flex: 1; }
.vertical-option input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.vertical-option span {
  display: block;
  text-align: center;
  padding: 10px 6px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.vertical-option input:checked + span {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  color: var(--white);
  box-shadow: 0 6px 16px rgba(230, 57, 70, 0.28);
}
.vertical-option input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.vertical-option.is-disabled span { color: #B7BEC9; cursor: not-allowed; }
.vertical-option.is-disabled small {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
  color: #B7BEC9;
}

/* ---------- Call panels ---------- */
.call-panels {
  display: grid;
  grid-template-columns: 0.85fr 1.3fr;
  gap: 24px;
  align-items: stretch;
}
.call-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 720px;
  max-height: 82vh;
  overflow: hidden;
}
.calendar-panel { padding: 0; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  background: var(--bg-light);
}
.panel-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #94A3B8;
  flex-shrink: 0;
}
.panel-dot.live { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,0.15); animation: pulse-dot 1.5s infinite; }
.panel-dot.ended { background: var(--text-muted); }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Controles de la llamada (pausar / reiniciar) */
.call-controls { display: flex; gap: 8px; margin-left: auto; }
.call-control-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.call-control-btn:hover { background: var(--bg-light); }
.call-control-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.call-control-btn .pause-ic { fill: currentColor; }
.call-control-btn .restart-ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.call-control-btn.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* Transcript panel */
.transcript-list {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.transcript-list::-webkit-scrollbar { width: 8px; }
.transcript-list::-webkit-scrollbar-track { background: transparent; }
.transcript-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.transcript-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.transcript-empty {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px;
}
.mic-ic { width: 48px; height: 48px; color: var(--border); fill: none; stroke: currentColor; stroke-width: 1.5; }
.play-ic { width: 16px; height: 16px; fill: currentColor; }
.mic-note { font-size: 0.82rem; color: var(--text-muted); max-width: 260px; }

/* Instrucciones antes de iniciar la llamada */
.demo-instructions {
  text-align: left;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 380px;
  margin: 0 auto;
}
.demo-instructions h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 12px;
}
.demo-instructions ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}
.demo-instructions li {
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.demo-instructions li strong { color: var(--navy); }

.transcript-bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  animation: bubble-in 0.2s ease;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.transcript-bubble.role-agent { background: var(--bg-light); align-self: flex-start; border-bottom-left-radius: 4px; }
.transcript-bubble.role-user { background: linear-gradient(135deg, var(--red-light), var(--red)); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }
.transcript-bubble .role-label { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.65; margin-bottom: 3px; }

.call-ended-banner {
  margin: 12px 20px 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(34,197,94,0.1);
  color: #15803d;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}
.call-error-banner {
  margin: 12px 20px 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(230,57,70,0.08);
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Mock del panel CRM (solo visual, no interactivo) ---------- */
.crm-mock { display: flex; flex: 1; min-height: 0; }
.crm-sidebar {
  width: 140px;
  flex-shrink: 0;
  background: var(--navy);
  color: #94A3B8;
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  pointer-events: none;
  user-select: none;
}
.crm-sidebar-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--white);
  padding: 0 16px 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.crm-nav { display: flex; flex-direction: column; gap: 2px; }
.crm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94A3B8;
  border-left: 3px solid transparent;
}
.crm-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.6; }
.crm-nav-item.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--red);
}
.crm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Grid calendar (estilo panel real de Omari) ---------- */
.grid-cal-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.grid-cal-header strong { font-family: 'Poppins', sans-serif; font-size: 0.95rem; }
.grid-cal-header span { font-size: 0.74rem; color: #94A3B8; }

.grid-cal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.cal-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--navy);
}
.cal-nav-btn:hover { background: var(--bg-light); }
.cal-current-date { font-size: 0.82rem; font-weight: 700; color: var(--navy); flex: 1; text-align: center; }
.cal-today-btn {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}
.cal-toast-area { padding: 0 16px; flex-shrink: 0; }
.other-day-banner {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.1);
  font-size: 0.76rem;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: bubble-in 0.2s ease;
}
.other-day-banner button {
  border: none;
  background: #16a34a;
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.grid-cal-wrap { flex: 1; overflow: auto; padding: 0 8px; }
.grid-cal { position: relative; min-width: 480px; max-width: 700px; margin: 0 auto; }
.grid-cal-loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.grid-cal-columns {
  display: grid;
  grid-template-columns: 52px repeat(var(--n-stylists, 3), 1fr);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.grid-cal-columns > div {
  padding: 12px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  border-left: 1px solid var(--border);
}
.grid-cal-columns > div:first-child { border-left: none; }
.grid-cal-columns small { display: block; font-weight: 500; color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; }

.grid-cal-body {
  display: grid;
  grid-template-columns: 56px repeat(var(--n-stylists, 3), 1fr);
  position: relative;
}
.grid-cal-hour-labels { display: flex; flex-direction: column; }
.grid-cal-hour-label {
  height: var(--hour-h, 76px);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: right;
  padding-right: 8px;
  transform: translateY(-7px);
  border-top: 1px solid var(--border);
}
.grid-cal-col { position: relative; border-left: 1px solid var(--border); }
.grid-cal-col .hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }

.grid-cal-event {
  position: absolute;
  left: 3px; right: 3px;
  border-radius: 9px;
  padding: 5px 8px;
  font-size: 0.76rem;
  line-height: 1.3;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.07);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-left: 4px solid var(--navy);
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.grid-cal-event strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid-cal-event .event-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid-cal-event.event-new {
  background: rgba(34, 197, 94, 0.15);
  border-left-color: #16a34a;
  color: #14532d;
  animation: highlight-fade 2.5s ease;
}
.grid-cal-event .new-badge {
  display: inline-block;
  margin-top: 2px;
  background: #22c55e;
  color: white;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}
@keyframes highlight-fade { 0% { background: rgba(34,197,94,0.35); } 100% { background: rgba(34,197,94,0.15); } }

@media (max-width: 860px) {
  .call-panels { grid-template-columns: 1fr; }
  .call-panel { min-height: 480px; max-height: none; }
}

@media (max-width: 640px) {
  .crm-mock { flex-direction: column; }
  .crm-sidebar { width: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; gap: 4px; }
  .crm-sidebar-logo { display: none; }
  .crm-nav { flex-direction: row; gap: 6px; }
  .crm-nav-item { padding: 6px 10px; white-space: nowrap; border-radius: 999px; border-left: none; }
  .crm-nav-item.active { box-shadow: inset 0 0 0 1px var(--red); }
}
