/* =========================================================
   Simulador de URA — usa os tokens de style.css
   ========================================================= */
.ura-demo {
  display: grid;
  grid-template-columns: minmax(290px, 360px) 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  max-width: 1040px;
  margin-inline: auto;
}
.ura-side, .ura-panel { display: grid; gap: var(--space-5); min-width: 0; }

/* Cenários */
.ura-scenarios { border: 0; display: grid; gap: var(--space-2); }
.ura-scenarios legend,
.ura-trace h3,
.ura-speaker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ura-scenarios legend { margin-bottom: var(--space-2); }
.ura-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ura-chips input { position: absolute; opacity: 0; pointer-events: none; }
.ura-chips label {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.ura-chips label:hover { border-color: var(--brand-300); background: var(--brand-tint); }
.ura-chips input:checked + label { background: var(--ink-900); border-color: var(--ink-900); color: var(--white); }
.ura-chips input:focus-visible + label { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.ura-scenarios:disabled label { cursor: not-allowed; opacity: 0.5; }
.ura-scenarios:disabled input:checked + label { opacity: 1; }

/* Aparelho */
.ura-phone {
  width: 100%;
  max-width: 360px;
  background: var(--ink-900);
  color: var(--white);
  border-radius: 36px;
  padding: 24px 20px 26px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, var(--shadow-xl);
  display: grid;
  gap: 18px;
}
.ura-screen { display: grid; gap: 4px; text-align: center; padding: 8px 4px 2px; }
.ura-who { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em; line-height: 1.2; }
.ura-status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-on-dark);
  display: flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 20px;
  font-variant-numeric: tabular-nums;
}
.ura-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-400); }
.ura-phone[data-state="live"] .ura-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ura-phone[data-state="ringing"] .ura-dot { background: var(--brand-500); animation: ura-pulse 1s infinite; }
@keyframes ura-pulse { 50% { opacity: 0.3; } }
.ura-digits {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  line-height: 1.2;
  min-height: 38px;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.ura-digits.is-hint { font-family: var(--font-body); font-size: var(--text-sm); letter-spacing: 0; color: var(--text-on-dark); padding-top: 8px; }

.ura-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; justify-items: center; }
.ura-key {
  width: 68px; max-width: 100%; aspect-ratio: 1;
  border-radius: 50%; border: 0;
  background: var(--ink-700); color: var(--white);
  display: grid; place-content: center;
  cursor: pointer;
  font-family: var(--font-body); font-size: 1.6rem; font-weight: 500; line-height: 1;
  transition: background-color 0.12s, transform 0.08s;
}
.ura-key small { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-300); margin-top: 3px; min-height: 10px; }
.ura-key:hover { background: var(--ink-600); }
.ura-key:active, .ura-key.is-pressed { background: var(--brand-500); transform: scale(0.96); }
.ura-key.is-pressed small { color: var(--white); }
.ura-key:focus-visible, .ura-callbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ura-phone[data-state="idle"] .ura-key { opacity: 0.45; }
.ura-freq { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); text-align: center; min-height: 14px; }
.ura-callrow { display: flex; justify-content: center; }
.ura-callbtn {
  width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: #1E9E5A; color: var(--white);
  transition: background-color var(--t-fast);
}
.ura-callbtn:hover { background: #178A4D; }
.ura-callbtn svg { width: 30px; height: 30px; transition: transform var(--t-fast); }
.ura-callbtn.is-hangup { background: var(--danger); }
.ura-callbtn.is-hangup svg { transform: rotate(135deg); }

/* Painel */
.ura-speech {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 2.4vw, 26px);
  display: grid;
  gap: var(--space-3);
}
.ura-speaker { display: flex; align-items: center; gap: 10px; }
.ura-bars { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.ura-bars i { width: 3px; height: 4px; border-radius: 2px; background: var(--border); }
.ura-speech.is-talking .ura-bars i { background: var(--brand-500); animation: ura-bar 0.9s ease-in-out infinite; }
.ura-speech.is-talking .ura-bars i:nth-child(2) { animation-delay: 0.15s; }
.ura-speech.is-talking .ura-bars i:nth-child(3) { animation-delay: 0.3s; }
.ura-speech.is-talking .ura-bars i:nth-child(4) { animation-delay: 0.45s; }
@keyframes ura-bar { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.ura-caption {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  min-height: 3.2em;
}
.ura-caption.is-quiet { color: var(--text-muted); }
.ura-options { display: flex; flex-wrap: wrap; gap: 6px; }
.ura-options:empty { display: none; }
.ura-opt {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-tint); color: var(--text);
  border: 1px solid var(--brand-tint-border); border-radius: var(--radius-sm);
  padding: 5px 11px 5px 5px;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.ura-opt b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--brand-700); color: var(--white); font-family: var(--font-mono); font-size: 13px; }
.ura-opt:hover { background: var(--brand-tint-border); border-color: var(--brand-200); }
.ura-opt:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

.ura-trace h3 { margin-bottom: var(--space-3); }
.ura-log { list-style: none; display: grid; border-top: 1px solid var(--border); }
.ura-log li {
  display: grid; grid-template-columns: 50px 70px 1fr; gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: var(--text-sm); line-height: 1.45;
}
.ura-log time { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ura-tag {
  justify-self: start;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-soft);
}
.ura-tag.is-erp { background: #E4EEFB; color: #24558F; }
.ura-tag.is-menu { background: var(--brand-tint); color: var(--brand-text); }
.ura-tag.is-tecla { background: var(--ink-900); color: var(--white); }
.ura-tag.is-fila { background: #E8F3DC; color: var(--success); }
.ura-log li.is-now { font-weight: 600; }
.ura-log li.is-empty { grid-template-columns: 1fr; color: var(--text-muted); }
.ura-log .ura-detail { color: var(--text-muted); font-weight: 400; }
.ura-note { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.6; }

@media (max-width: 860px) {
  .ura-demo { grid-template-columns: 1fr; }
  .ura-side { justify-items: center; }
  .ura-chips { justify-content: center; }
  .ura-scenarios legend { text-align: center; width: 100%; }
}
@media (max-width: 480px) {
  .ura-log li { grid-template-columns: 44px 1fr; }
  .ura-log .ura-tag { display: none; }
  .ura-key { width: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .ura-demo *, .ura-demo *::before { animation: none !important; transition: none !important; }
}
