/* Base común de las demos de Panacea Logic AI: tokens, banner, botones, formularios, avisos,
   diálogos. Contraste AA; foco visible; sin dependencias. */
:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #17212b;
  --muted: #4d5965;
  --line: #ddd7cb;
  --line-strong: #c4bdae;
  --brand: #0b6e6e;
  --brand-dark: #084f4f;
  --brand-soft: #e1f1ef;
  --accent: #e8743b;
  --on-accent: #1a1a1a;
  --danger: #a11d1d;
  --danger-soft: #fde4e4;
  --ok: #14602e;
  --ok-soft: #dcf5e3;
  --warn: #7a4f00;
  --warn-soft: #fff1cc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 10px 28px -14px rgba(20, 30, 40, .22);
  --banner-h: 44px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--banner-h) + 70px); }
body { margin: 0; padding-top: var(--banner-h); font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: calc(var(--banner-h) + 8px); }

/* Banner fijo de demostración */
.demo-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 60; min-height: 44px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 16px;
  padding: 6px 16px; background: #0c1a2b; color: #eaf1f8; font-size: 13px; line-height: 1.35; text-align: center;
}
.demo-banner a { color: #9ad9ff; font-weight: 600; }
.demo-banner__cta { color: #0c1a2b !important; background: #ffd666; padding: 3px 10px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.demo-banner__cta:hover { background: #ffe38f; }
.demo-banner :focus-visible { outline-color: #fff; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #faf8f3; border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--accent:hover { filter: brightness(.95); background: var(--accent); }
.btn--ghost { background: transparent; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #7f1414; border-color: #7f1414; }
.btn--sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn--icon { min-width: 44px; padding: 6px; }

/* Formularios */
.field { display: grid; gap: 4px; }
.field > label, .field > .label, legend { font-weight: 600; font-size: 14px; }
.field input[type="text"], .field input[type="tel"], .field input[type="number"], .field input[type="date"], .field input[type="time"], .field select, .field textarea,
.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--danger); background: #fff8f8; }
.field__hint { font-size: 13px; color: var(--muted); }
.field__error { font-size: 13px; color: var(--danger); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Etiquetas de estado (texto + símbolo: no dependen solo del color) */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; }
.badge--pendiente { background: #fff1cc; color: #7a4f00; border-color: #efd48a; }
.badge--confirmada { background: #dcf5e3; color: #14602e; border-color: #a9dcb9; }
.badge--reprogramada { background: #e3ebff; color: #2b4da0; border-color: #b6c6f2; }
.badge--cancelada { background: #fde4e4; color: #8a1c1c; border-color: #efb4b4; }
.badge--no_asistio { background: #ffe4d2; color: #8a3b00; border-color: #f2bf9f; }
.badge--atendida { background: #e5eaf0; color: #34495e; border-color: #c3ccd6; }
.badge--urgente { background: #a11d1d; color: #fff; }
.badge--humano { background: #fff1cc; color: #7a4f00; border-color: #efd48a; }
.badge--info { background: #e5eaf0; color: #34495e; }
.badge--ok { background: #dcf5e3; color: #14602e; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }

/* Avisos */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { background: #17212b; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14.5px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); animation: toast-in .2s ease-out; }
.toast--warn { background: #7a4f00; }
.toast--error { background: #8a1c1c; }
.toast--ok { background: #14602e; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Diálogos */
.dlg { width: min(94vw, 560px); max-height: 92vh; padding: 0; border: 0; border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); overflow: hidden; }
.dlg--wide { width: min(96vw, 760px); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg::backdrop { background: rgba(12, 26, 43, .55); }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg__title { font-size: 19px; }
.dlg__body { padding: 18px; overflow-y: auto; }
.dlg__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
