/* Base común de las tres maquetas: tokens de marca, botones, formularios y elementos de revisión. */
:root {
  /* Colores del manual de identidad (págs. 11-12) */
  --teal: #008B93;
  --ink: #191517;
  --violet: #A51890;
  --yellow: #FFCD00;
  /* Tonos de interfaz derivados (no son colores oficiales): contraste AA en texto pequeño */
  --teal-ui: #00767D;
  --teal-ui-hover: #005E64;
  --teal-light: #6FD3D8;
  --error: #B3261E;

  --bg: #F4F2EE;
  --bg-alt: #ECE9E3;
  --surface: #FFFFFF;
  --line: rgba(25, 21, 23, .16);
  --line-strong: rgba(25, 21, 23, .72);
  --muted: #4B4548;
  --focus: var(--teal-ui);

  --font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: var(--font-body);
  --head-weight: 700;
  --head-track: -.04em;
  --head-stretch: 100%;
  --radius: 4px;
  --wrap: 1240px;
  --gutter: 20px;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  margin: 0; font-family: var(--font-head); font-weight: var(--head-weight);
  font-stretch: var(--head-stretch); letter-spacing: var(--head-track); line-height: 1.05; text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
figure { margin: 0; }
blockquote { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Botones y enlaces de acción */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 50px; padding: .75em 1.25em; border: 2px solid transparent; border-radius: var(--radius);
  font: 700 1.0625rem/1.15 var(--font-body); text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-sm { min-height: 42px; padding: .55em 1em; font-size: .9375rem; }
.btn-primary { background: var(--btn-bg, var(--teal-ui)); color: var(--btn-fg, #fff); }
.btn-primary:hover { background: var(--btn-bg-hover, var(--teal-ui-hover)); }
.btn-primary:disabled { background: #8C8789; cursor: not-allowed; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-outline { background: transparent; border-color: currentColor; color: inherit; }
.btn-outline:hover { background: rgba(127, 127, 127, .12); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #E9F6F6; }
.text-link {
  display: inline-flex; align-items: center; gap: .4em; padding: 0 0 3px; border: 0; border-bottom: 2px solid currentColor;
  background: none; color: var(--link, var(--teal-ui)); font-weight: 700; text-decoration: none; cursor: pointer;
}
.text-link .arrow { transition: transform .15s; }
.text-link:hover .arrow { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }

/* Formularios */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field .label { font-weight: 600; font-size: .9375rem; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 10px 12px; border: 1.5px solid rgba(25, 21, 23, .4);
  border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-size: 1rem;
}
.field textarea { min-height: 112px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field-error { margin: 0; color: var(--error); font-size: .875rem; font-weight: 600; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 6px; font-size: .9375rem; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--teal-ui); }
.form-note { margin: 0 0 16px; font-size: .875rem; color: var(--muted); }
.form-summary, .form-error { margin: 0 0 16px; padding: 10px 14px; border-left: 4px solid var(--error); background: #FCEDEC; color: #6E1712; font-weight: 600; }
.nota-motivo { margin: -6px 0 16px; padding: 10px 14px; border-left: 4px solid var(--teal); background: #E6F4F4; color: var(--ink); font-size: .9375rem; }
.form-done { padding: 24px; border-left: 4px solid var(--teal); background: #fff; color: var(--ink); }
.form-done-title { font: var(--head-weight) 1.5rem/1.2 var(--font-head); letter-spacing: -.02em; }

/* Elementos que solo existen para revisar la maqueta */
.demo-flag { margin: 0 0 14px; padding: 8px 12px; border-radius: var(--radius); background: #FFF4C2; color: #3D3200; font-size: .875rem; line-height: 1.45; }
.demo-bar { position: relative; z-index: 60; background: #2B2B2B; color: #EDEDED; font: 500 .8125rem/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif; }
.demo-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.demo-bar p { margin: 0; }
.demo-bar nav { display: flex; gap: 4px; }
.demo-bar nav a { padding: 4px 9px; border-radius: 3px; color: #fff; text-decoration: none; }
.demo-bar nav a[aria-current="page"] { background: #fff; color: #2B2B2B; font-weight: 700; }
.demo-bar nav a:hover:not([aria-current]) { background: rgba(255, 255, 255, .14); }
.demo-notes { margin-left: auto; }
.demo-notes summary { cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.demo-notes-panel {
  position: absolute; right: var(--gutter); top: 100%; width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: 72vh; overflow: auto; padding: 20px 22px; background: #fff; color: var(--ink);
  border: 1px solid #ccc; border-radius: 0 0 6px 6px; font-size: .875rem; line-height: 1.5;
}
.demo-notes-panel h2 { margin: 14px 0 6px; font: 700 .9375rem/1.3 system-ui, sans-serif; letter-spacing: 0; }
.demo-notes-panel h2:first-child { margin-top: 0; }
.demo-notes-panel ul { padding-left: 18px; list-style: disc; }
.demo-notes-panel li { margin-bottom: 4px; }

.demo-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 6px; background: var(--ink); color: #fff; font-size: .9375rem;
  transform: translate(-50%, 140%); opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none;
}
.demo-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* Diálogos: agenda y acceso a plataforma */
.demo-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 8px; background: #fff; color: var(--ink); }
.demo-dialog::backdrop { background: rgba(25, 21, 23, .6); }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 10px; }
.dlg-head h2 { font-size: 1.625rem; letter-spacing: -.02em; }
.dlg-body { padding: 0 24px 24px; }
.dlg-close { width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; border-radius: 50%; background: none; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.dlg-close:hover { background: #EEE; }
.seg { display: inline-flex; margin-bottom: 16px; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg button { min-height: 40px; padding: 6px 14px; border: 0; background: #fff; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.estado-panel { padding: 16px; border-radius: var(--radius); background: #F2F2F0; }
.estado-panel p { margin-bottom: 12px; }

.agenda-dias { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 12px; margin-bottom: 16px; }
.agenda-fecha { margin: 0 0 8px; font-size: .875rem; line-height: 1.3; }
.agenda-fecha strong { display: block; text-transform: capitalize; }
.agenda-horas { display: grid; gap: 6px; }
.slot { min-height: 42px; border: 1.5px solid rgba(25, 21, 23, .35); border-radius: var(--radius); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; }
.slot:hover:not(:disabled) { border-color: var(--teal-ui); }
.slot[aria-pressed="true"] { background: var(--teal-ui); border-color: var(--teal-ui); color: #fff; }
.slot:disabled { border-style: dashed; color: #8C8789; background: transparent; cursor: not-allowed; text-decoration: line-through; }
.agenda-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.agenda-sel { margin: 0; font-size: .9375rem; }
.agenda-ok { outline: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
