:root {
  --aet-bg: #f3f6f5;
  --aet-ink: #14221f;
  --aet-muted: #4b5c57;
  --aet-accent: #0f766e;
  --aet-accent-dark: #115e59;
  --aet-card: #ffffff;
  --aet-line: #d7e0dc;
  --aet-warn: #9a3412;
  --aet-warn-bg: #ffedd5;
  --aet-ok: #166534;
  --aet-shadow: 0 8px 24px rgba(20, 34, 31, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--aet-bg);
  color: var(--aet-ink);
  line-height: 1.5;
  font-size: 18px;
}

:focus-visible {
  outline: 3px solid var(--aet-accent);
  outline-offset: 2px;
}

.aet-brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--aet-accent);
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
}
.aet-brand a { color: inherit; text-decoration: none; }

h1 { font-size: 1.85rem; font-weight: 750; margin: 0 0 0.75rem; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 0.7rem; }

.aet-hero { padding: 1.25rem 0 2rem; }
.aet-hero p { color: var(--aet-muted); margin: 0 0 1.25rem; }

.aet-demo-banner {
  background: var(--aet-warn-bg);
  color: var(--aet-warn);
  padding: 0.85rem 1rem;
  font-weight: 750;
  text-align: center;
  border-bottom: 2px solid #fdba74;
}
main .aet-demo-banner {
  border: 1px solid #fdba74;
  border-radius: 14px;
  margin-bottom: 1rem;
  border-bottom-width: 2px;
}

.aet-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--aet-card);
  border-bottom: 1px solid var(--aet-line);
  box-shadow: var(--aet-shadow);
}
.aet-top a {
  color: var(--aet-accent-dark);
  text-decoration: none;
  font-weight: 700;
  padding: 0.55rem 0.2rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.aet-nav { display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; }

main.aet-main { max-width: 40rem; margin: 0 auto; padding: 1.15rem 1rem 2.5rem; }

.aet-btn, .aet-btn-sec, .aet-btn-warn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.85rem 1.2rem;
  border: 0;
  border-radius: 14px;
  background: var(--aet-accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}
.aet-btn:hover { background: var(--aet-accent-dark); }
.aet-btn-sec { background: #3f4a47; }
.aet-btn-sec:hover { background: #2a322f; }
.aet-btn-warn { background: #c2410c; }
.aet-btn-warn:hover { background: #9a3412; }

.aet-field { margin: 0 0 1.1rem; }
.aet-field label { display: block; font-weight: 750; margin-bottom: 0.4rem; }
.aet-field input[type="checkbox"] { width: auto; min-height: 1.25rem; min-width: 1.25rem; }
.aet-field input, .aet-field select, .aet-field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 0.85rem;
  font-size: 1.05rem;
  border: 1px solid #8b9a95;
  border-radius: 12px;
  background: #fff;
}
.aet-error, .aet-ok, .aet-warnbox {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 700;
}
.aet-error { background: #fee2e2; color: #991b1b; }
.aet-ok { background: #dcfce7; color: var(--aet-ok); }
.aet-warnbox { background: var(--aet-warn-bg); color: var(--aet-warn); }

.aet-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1rem 0; }
.aet-kpi {
  background: var(--aet-card);
  border: 1px solid var(--aet-line);
  border-radius: 16px;
  padding: 0.95rem;
  box-shadow: var(--aet-shadow);
}
.aet-kpi b { display: block; font-size: 1.7rem; }
.aet-kpi span { color: var(--aet-muted); font-size: 0.92rem; }

.aet-card {
  background: var(--aet-card);
  border: 1px solid var(--aet-line);
  border-radius: 16px;
  padding: 1rem 1.05rem;
  margin: 0 0 0.8rem;
  box-shadow: var(--aet-shadow);
}
.aet-card h2 { font-size: 1.08rem; margin: 0 0 0.35rem; }
.aet-meta { color: var(--aet-muted); font-size: 0.95rem; }

.aet-estado {
  display: inline-block;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: #e7e5e4;
  margin-top: 0.4rem;
}
.aet-estado-confirmado, .aet-estado-presente, .aet-estado-atendido { background: #dcfce7; color: #166534; }
.aet-estado-reservado, .aet-estado-pendiente { background: #dbeafe; color: #1e40af; }
.aet-estado-cancelado_paciente, .aet-estado-cancelado_centro { background: #fee2e2; color: #991b1b; }
.aet-estado-ausente { background: #ffedd5; color: #9a3412; }
.aet-estado-reprogramado { background: #f3e8ff; color: #6b21a8; }
.aet-estado-libre { background: #ccfbf1; color: #115e59; }

.aet-daynav {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.aet-daynav a, .aet-daynav span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--aet-card);
  border: 1px solid var(--aet-line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--aet-ink);
  font-weight: 750;
  padding: 0 0.5rem;
}
.aet-daynav .aet-hoy { background: var(--aet-accent); color: #fff; border-color: var(--aet-accent); }

.aet-hint { color: var(--aet-muted); margin-top: 1rem; }
button.aet-link {
  background: none;
  border: 0;
  padding: 0.6rem 0;
  color: var(--aet-accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
}
.aet-actions { display: grid; gap: 0.7rem; margin-top: 1.1rem; }

.aet-choice {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--aet-card);
  border: 2px solid var(--aet-line);
  border-radius: 16px;
  padding: 1.05rem 1.15rem;
  margin: 0 0 0.75rem;
  color: var(--aet-ink);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  min-height: 76px;
}
.aet-choice:hover { border-color: var(--aet-accent); }
.aet-choice strong { display: block; font-size: 1.12rem; margin-bottom: 0.25rem; }
.aet-choice span { color: var(--aet-muted); font-size: 0.95rem; }

.aet-slot, .aet-slot-libre {
  display: inline-flex;
  min-height: 52px;
  min-width: 5.8rem;
  margin: 0 0.4rem 0.5rem 0;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: 12px;
  background: var(--aet-accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  align-items: center;
  justify-content: center;
}
.aet-slot-libre { background: #0f766e; }
.aet-slot:hover, .aet-slot-libre:hover { background: var(--aet-accent-dark); }

.aet-book-head {
  background: var(--aet-card);
  border: 1px solid var(--aet-line);
  border-radius: 20px;
  padding: 1.05rem 1.15rem 1.15rem;
  margin: 0 0 1.15rem;
  box-shadow: var(--aet-shadow);
}
.aet-book-head .aet-brand { margin: 0 0 0.2rem; }
.aet-book-head h1 { margin: 0 0 0.45rem; font-size: 1.55rem; }
.aet-book-loc {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  color: var(--aet-muted);
  font-size: 0.95rem;
}
.aet-book-loc svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aet-steps {
  list-style: none;
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1.2rem;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.aet-steps li {
  flex: 1 0 auto;
  min-width: 4.8rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--aet-muted);
  padding: 0.35rem 0.2rem 0;
  border-top: 3px solid var(--aet-line);
}
.aet-steps li.is-done { color: var(--aet-accent-dark); border-top-color: var(--aet-accent); }
.aet-steps li.is-now { color: var(--aet-ink); border-top-color: var(--aet-accent); border-top-width: 4px; }

.aet-pick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0.85rem 0 1.2rem;
}
.aet-pick-form { margin: 0; display: flex; min-width: 0; }
.aet-pick {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  background: var(--aet-card);
  border: 1px solid var(--aet-line);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  color: var(--aet-ink);
  font: inherit;
  cursor: pointer;
  min-height: 88px;
  box-shadow: var(--aet-shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.aet-pick:hover, .aet-pick:focus-visible {
  border-color: var(--aet-accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.12);
}
.aet-pick-txt { flex: 1; min-width: 0; }
.aet-pick-txt strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.2rem;
}
.aet-pick-txt span { display: block; color: var(--aet-muted); font-size: 0.92rem; }
.aet-pick-txt .aet-pick-badge {
  display: inline-block;
  width: fit-content;
  margin-top: 0.35rem;
  background: #ecfdf5;
  color: #115e59;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.aet-pick-go {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--aet-accent);
  opacity: 0.7;
}
.aet-pick-go svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aet-pick-ico, .aet-av {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.aet-pick-ico svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.aet-pick-ico svg .aet-fill { fill: currentColor; stroke: none; }
.aet-ico-clinica, .aet-ico-gen { background: #ccfbf1; color: #0f766e; }
.aet-ico-trauma { background: #ffedd5; color: #c2410c; }
.aet-ico-odonto { background: #dbeafe; color: #1d4ed8; }
.aet-ico-kine { background: #dcfce7; color: #15803d; }
.aet-ico-psico, .aet-ico-fono { background: #f3e8ff; color: #7e22ce; }
.aet-ico-nutri { background: #fef9c3; color: #a16207; }
.aet-ico-clock { background: #ecfeff; color: #0e7490; }
.aet-ico-shield { background: #e0e7ff; color: #3730a3; }

.aet-av { color: #fff; font-size: 0.92rem; border-radius: 50%; }
.aet-av-1 { background: #0f766e; }
.aet-av-2 { background: #1d4ed8; }
.aet-av-3 { background: #7e22ce; }
.aet-av-4 { background: #c2410c; }
.aet-av-5 { background: #15803d; }

.aet-cal {
  background: var(--aet-card);
  border: 1px solid var(--aet-line);
  border-radius: 20px;
  padding: 1rem 0.9rem 1.15rem;
  box-shadow: var(--aet-shadow);
  margin: 0.85rem 0 1rem;
}
.aet-cal-head {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.aet-cal-head form {
  margin: 0;
  min-width: 0;
  width: 2.75rem;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.aet-cal-head h3 {
  margin: 0;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 800;
}
.aet-cal-nav, .aet-cal-navoff {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--aet-line);
  background: #fff;
  color: var(--aet-ink);
  cursor: pointer;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}
.aet-cal-nav:hover { border-color: var(--aet-accent); color: var(--aet-accent-dark); }
.aet-cal-navoff { opacity: 0.35; cursor: default; }
.aet-cal-wd, .aet-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.28rem;
}
.aet-cal-wd span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--aet-muted);
  padding: 0.15rem 0 0.4rem;
}
.aet-cal-blank, .aet-cal-day {
  min-height: 44px;
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 750;
  border: 0;
  background: transparent;
  color: #b4c0bc;
  padding: 0;
}
.aet-cal-day.is-free {
  background: #ccfbf1;
  color: #115e59;
  font-weight: 800;
  cursor: pointer;
}
.aet-cal-day.is-free:hover, .aet-cal-day.is-free:focus-visible {
  background: var(--aet-accent);
  color: #fff;
}
.aet-cal-day.is-today { box-shadow: inset 0 0 0 2px var(--aet-accent); }
.aet-cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 0.15rem;
}
.aet-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.15rem 0;
  border-top: 1px solid var(--aet-line);
  color: var(--aet-muted);
  font-size: 0.88rem;
}
.aet-cal-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.aet-cal-key i {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  background: #ccfbf1;
  display: inline-block;
}
.aet-cal-key i.is-off { background: #e8eeeb; }

.aet-slot-board { margin: 0.5rem 0 1rem; }
.aet-slot-grupo {
  margin: 1rem 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--aet-muted);
}
.aet-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.aet-slots .aet-slot {
  margin: 0;
  flex: 1 1 5.4rem;
  max-width: 8.2rem;
}

.aet-backrow { margin: 0.25rem 0 0; }

.aet-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

@media (min-width: 720px) {
  html, body { font-size: 16px; }
  main.aet-main { max-width: 52rem; padding-top: 1.6rem; }
  .aet-kpis { grid-template-columns: repeat(4, 1fr); }
  .aet-hero h1 { font-size: 2.2rem; }
  .aet-pick-grid { grid-template-columns: 1fr 1fr; }
  .aet-cal { padding: 1.15rem 1.2rem 1.3rem; }
}
