/* ============================================================
   AHCD — Components
   Botones, tarjetas, formularios, modales, badges, filtros.
   ============================================================ */

/* ============================================================
   BOTONES
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 0 var(--space-24);
  height: var(--touch-min);           /* ≥ 44px — touch target */
  min-height: var(--touch-min);       /* seguridad si el contenido wrappea */
  min-width: 120px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-system);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition:
    background-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.btn:focus-visible {
  outline: 2px solid var(--c-blue-2);
  outline-offset: 3px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primario — Rojo. SOLO para CTAs críticos (1 por pantalla) */
.btn--primary {
  background-color: var(--c-red);
  color: var(--c-white);
}

/* Secundario — Azul. Navegación e información */
.btn--secondary {
  background-color: var(--c-blue);
  color: var(--c-white);
}

/* Ghost — Gris. Acciones suaves */
.btn--ghost {
  background-color: #374151;
  color: white;
  border: 1.5px solid var(--c-line);
  text-decoration: none;
}


/* Tamaños */
.btn--sm {
  height: 36px;
  min-height: 36px;
  padding: 0 var(--space-16);
  font-size: var(--text-xs);
  min-width: 80px;
}

@media (max-width: 767px) {
  .btn--sm {
    height: var(--touch-min);
    min-height: var(--touch-min);
  }
}
.btn--lg {
  height: 52px;
  padding: 0 var(--space-32);
  font-size: var(--text-base);
}
.btn--full { width: 100%; }

/* Estado carga */
.btn--loading {
  cursor: wait;
  opacity: 0.75;
  pointer-events: none;
}

/* Blanco — Para uso en secciones de fondo azul */
.btn--white {
  background-color: var(--c-white);
  color: var(--c-blue);
  border: none;
}

/* Red — Alias de primario (uso directo en campus) */
.btn--red {
  background-color: var(--c-red);
  color: var(--c-white);
}

/* Outline — Borde con fondo transparente */
.btn--outline {
  background-color: transparent;
  color: var(--c-blue);
  border: 1.5px solid var(--c-blue);
}

/* ============================================================
   TARJETAS
   ============================================================ */

.card {
  background-color: var(--c-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card--border {
  box-shadow: none;
  border: 1.5px solid var(--c-line);
}

.card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background-color: var(--c-bg);
  flex-shrink: 0;
}

.card__img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--c-line);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.card__body {
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  flex: 1;
}

.card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-blue-2);
}

.card__title {
  font-size: var(--text-md);
  color: var(--c-blue);
  font-weight: 700;
  line-height: var(--line-height-tight);
}

.card__text {
  font-size: var(--text-sm);
  color: var(--c-text);
  flex: 1;
  opacity: 0.85;
}

.card__footer {
  padding: var(--space-16) var(--space-24);
  border-top: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

/* ── Tarjeta horizontal (desktop) ────────────────────────────── */
@media (min-width: 768px) {
  .card--horizontal {
    flex-direction: row;
  }
  .card--horizontal .card__img,
  .card--horizontal .card__img-placeholder {
    width: 260px;
    aspect-ratio: auto;
    flex-shrink: 0;
  }
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: 2px var(--space-8);
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.4;
}

.badge--green   { background-color: #E8F5E9; color: #2E7D32; }
.badge--red     { background-color: #FFEBEE; color: var(--c-red); }
.badge--blue    { background-color: #E3F0FF; color: var(--c-blue); }
.badge--gray    { background-color: var(--c-bg); color: var(--c-text); }
.badge--yellow  { background-color: #FFFDE7; color: #E65100; }
.badge--outline {
  background-color: transparent;
  border: 1.5px solid var(--c-line);
  color: var(--c-text);
}
.badge--lg {
  font-size: var(--text-xs);
  padding: 4px var(--space-12);
  letter-spacing: 0.05em;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.form__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-blue);
  cursor: pointer;
}

.form__label--required::after {
  content: ' *';
  color: var(--c-red);
  font-weight: 700;
}

/* Inputs, selects, textareas */
.form__input,
.form__select,
.form__textarea {
  width: 100%;
  height: var(--touch-min);
  padding: 0 var(--space-16);
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-md);
  font-family: var(--font-system);
  font-size: var(--text-sm);
  color: var(--c-text);
  background-color: var(--c-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form__textarea {
  height: auto;
  min-height: 120px;
  padding: var(--space-12) var(--space-16);
  resize: vertical;
  line-height: var(--line-height-base);
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  border-color: var(--c-blue-2);
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--c-line);
}

/* Estados de error */
.form__input--error,
.form__select--error,
.form__textarea--error {
  border-color: var(--c-red);
}

.form__input--error:focus,
.form__select--error:focus,
.form__textarea--error:focus {
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

.form__error {
  font-size: var(--text-xs);
  color: var(--c-red);
  font-weight: 500;
  display: none;
  margin-top: var(--space-4);
}

.form__error--visible { display: block; }

.form__hint {
  font-size: var(--text-xs);
  color: var(--c-text);
  opacity: 0.65;
  line-height: var(--line-height-base);
}

/* Fila de 2 columnas en tablet+ */
.form__row {
  display: grid;
  gap: var(--space-16);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .form__row--2 { grid-template-columns: 1fr 1fr; }
  .form__row--3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* Select con flecha custom */
.form__select-wrap {
  position: relative;
}

.form__select-wrap::after {
  content: '';
  position: absolute;
  right: var(--space-16);
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--c-text);
  pointer-events: none;
}

.form__select-wrap .form__select {
  padding-right: var(--space-48);
  cursor: pointer;
}

/* Checkbox y radio */
.form__check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  cursor: pointer;
}

.form__check input[type="checkbox"],
.form__check input[type="radio"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--c-blue);
  cursor: pointer;
}

.form__check-label {
  font-size: var(--text-sm);
  color: var(--c-text);
  line-height: var(--line-height-base);
}

/* Submit row */
.form__submit {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding-top: var(--space-8);
}

@media (min-width: 768px) {
  .form__submit {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }
}

/* Feedback inline */
.form__feedback {
  padding: var(--space-16);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  display: none;
}

.form__feedback--success {
  display: block;
  background-color: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.form__feedback--error {
  display: block;
  background-color: #FFEBEE;
  color: var(--c-red);
  border: 1px solid #EF9A9A;
}

/* ============================================================
   FORMULARIOS MODALES — sistema ahcd-*
   Diseño compartido con el landing (values en px, sin rem)
   ============================================================ */

/* Steps */
.ahcd-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ahcd-step {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 14px;
  border-radius: 100px;
  background: #F5F5F5;
  color: #BDBDBD;
}
.ahcd-step--active { background: #1E3A5F; color: #fff; }
.ahcd-step--done   { background: #E3EDF8; color: #1E3A5F; }

/* Subtítulo del modal */
.ahcd-modal__subtitle {
  font-size: 14px;
  color: #4A4A4A;
  line-height: 1.65;
  margin-bottom: 24px;
  margin-top: -4px;
}

/* Form */
.ahcd-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ahcd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ahcd-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #4A4A4A;
}
.ahcd-field label.ahcd-required::after {
  content: ' *';
  color: #C62828;
}
.ahcd-field input,
.ahcd-field select,
.ahcd-field textarea {
  padding: 11px 14px;
  border: 1.5px solid #BDBDBD;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}
.ahcd-field input:focus,
.ahcd-field select:focus,
.ahcd-field textarea:focus {
  border-color: #1E3A5F;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}
.ahcd-field textarea { resize: vertical; min-height: 88px; }
.ahcd-field input.ahcd-input--error,
.ahcd-field select.ahcd-input--error,
.ahcd-field textarea.ahcd-input--error {
  border-color: #C62828;
}
.ahcd-field input.ahcd-input--error:focus,
.ahcd-field select.ahcd-input--error:focus,
.ahcd-field textarea.ahcd-input--error:focus {
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}
.ahcd-select-wrap {
  position: relative;
}
.ahcd-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #4A4A4A;
  pointer-events: none;
}
.ahcd-select-wrap select { padding-right: 40px; cursor: pointer; }

.ahcd-field-error {
  display: none;
  font-size: 11px;
  color: #C62828;
  font-weight: 600;
}
.ahcd-field-error:not(:empty) { display: block; }

.ahcd-hint {
  font-size: 11px;
  color: #4A4A4A;
  opacity: 0.7;
  line-height: 1.5;
}

.ahcd-row {
  display: flex;
  gap: 12px;
}
.ahcd-row .ahcd-field { flex: 1; min-width: 0; }

/* Buttons */
.ahcd-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.ahcd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s, filter 0.18s, box-shadow 0.18s, border-color 0.18s;
  white-space: nowrap;
  line-height: 1;
  min-height: 44px;
}
.ahcd-btn--primary { background: #C62828; color: #fff; border: none; }

.ahcd-btn--secondary { background: transparent; color: #4A4A4A; border: 1.5px solid #BDBDBD; }

.ahcd-btn--blue { background: #1E3A5F; color: #fff; border: none; }

.ahcd-btn--full { width: 100%; }
.ahcd-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Error / messages */
.ahcd-form-error {
  background: #FFEBEE;
  border: 1px solid #FFCDD2;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #C62828;
  margin-top: 8px;
}

/* Success screen */
.ahcd-success {
  text-align: center;
  padding: 32px 16px;
}
.ahcd-success__icon {
  font-size: 52px;
  display: block;
  margin-bottom: 16px;
  color: #2E7D32;
}
.ahcd-success__title {
  font-size: 22px;
  font-weight: 700;
  color: #1E3A5F;
  margin-bottom: 10px;
}
.ahcd-success__text {
  font-size: 15px;
  color: #4A4A4A;
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 12px;
}

/* Slot recap banner */
.ahcd-slot-recap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #E8F0F9;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #1E3A5F;
  margin-bottom: 20px;
}

/* Professional selector */
.ahcd-prof-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
@media (min-width: 480px) {
  .ahcd-prof-grid { grid-template-columns: repeat(4, 1fr); }
}
.ahcd-prof-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 2px solid #BDBDBD;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  min-height: 44px;
}

.ahcd-prof-btn__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #1E3A5F;
  color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ahcd-prof-btn__name {
  font-size: 14px;
  font-weight: 700;
  color: #1E3A5F;
}

/* Spinner */
.ahcd-spinner {
  width: 28px; height: 28px;
  border: 3px solid #dce8f5;
  border-top-color: #1E3A5F;
  border-radius: 50%;
  animation: ahcd-spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes ahcd-spin { to { transform: rotate(360deg); } }

/* Loading */
.ahcd-loading {
  padding: 32px;
  text-align: center;
  font-size: 14px;
  color: #4A4A4A;
}

/* Calendar */
.ahcd-calendar {
  border: 1.5px solid #BDBDBD;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ahcd-calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1E3A5F;
  padding: 12px 16px;
}
.ahcd-calendar__nav-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  line-height: 1;
  min-height: unset;
}
.ahcd-calendar__nav-btn:disabled { opacity: 0.3; cursor: default; }
.ahcd-calendar__month {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
}
.ahcd-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
}
.ahcd-calendar__dow {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4A4A4A;
  background: #F5F5F5;
  border-bottom: 1px solid #BDBDBD;
}
.ahcd-calendar__cell {
  min-height: 40px;
  padding: 6px 4px 4px;
  text-align: center;
  font-size: 13px;
  color: #4A4A4A;
  border-right: 1px solid #F5F5F5;
  border-bottom: 1px solid #F5F5F5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: default;
  position: relative;
}
.ahcd-calendar__cell--empty { background: #FAFAFA; }
.ahcd-calendar__cell--past  { color: #BDBDBD; background: #FAFAFA; }
.ahcd-calendar__cell--avail {
  cursor: pointer;
  font-weight: 700;
  background: #fff;
  transition: background 0.15s;
}
.ahcd-calendar__cell--avail:hover { background: #E8F0F9; color: #1E3A5F; }
.ahcd-calendar__cell--selected { background: #1E3A5F !important; color: #fff !important; }
.ahcd-calendar__cell--selected .ahcd-dot { background: #fff; }
.ahcd-calendar__cell--today { outline: 2px solid #C62828; outline-offset: -2px; }
.ahcd-dot {
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #C62828;
  flex-shrink: 0;
}

/* Time slots */
.ahcd-timeslots {
  border-top: 1px solid #BDBDBD;
  padding: 16px;
  background: #FAFAFA;
  border-radius: 0 0 10px 10px;
}
.ahcd-timeslots__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4A4A4A;
  margin-bottom: 12px;
}
.ahcd-timeslots__grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ahcd-timeslot {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1.5px solid #1E3A5F;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #1E3A5F;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
}
.ahcd-timeslot:hover { background: #1E3A5F; color: #fff; }
.ahcd-timeslot--selected { background: #C62828; border-color: #C62828; color: #fff; }
.ahcd-timeslots__empty { font-size: 13px; color: #BDBDBD; }

/* No slots */
.ahcd-no-slots {
  padding: 24px 0;
  text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
  .ahcd-row { flex-direction: column; gap: 16px; }
  .ahcd-form-actions { justify-content: stretch; }
  .ahcd-form-actions .ahcd-btn { flex: 1; }
}

/* ============================================================
   MODALES — diseño igual al landing (caja centrada, no bottom-sheet)
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: rgba(15, 25, 45, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition-slow),
    visibility var(--transition-slow);
}

.modal-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  background-color: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform var(--transition-slow);
}

.modal-overlay--visible .modal {
  transform: scale(1);
}

/* Sin drag handle */
.modal::before { display: none; }

/* ── Header ── */
.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 36px 40px 20px;
  border-bottom: none;
  position: sticky;
  top: 0;
  background-color: #fff;
  z-index: 1;
  flex-shrink: 0;
  gap: 12px;
}

.modal__title {
  font-size: 22px;
  font-weight: 700;
  color: #1E3A5F;
  line-height: 1.25;
  flex: 1;
}

/* Botón cerrar — circular, gris, como el landing */
.modal__close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: none;
  background: #F5F5F5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #4A4A4A;
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
  margin-top: 2px;
}


/* ── Body ── */
.modal__body {
  padding: 0 40px 36px;
  flex: 1;
}

/* ── Footer (opcional) ── */
.modal__footer {
  padding: 16px 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .modal__footer {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* ── Responsive mobile ── */
@media (max-width: 500px) {
  .modal__header { padding: 28px 24px 16px; }
  .modal__body   { padding: 0 24px 28px; }
  .modal__footer { padding: 12px 24px 20px; }
}

/* ============================================================
   FILTROS
   ============================================================ */

.filters {
  background-color: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

@media (min-width: 768px) {
  .filters {
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--space-16);
    padding: var(--space-24);
  }
}

.filter__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  flex: 1 1 180px;
}

.filter__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-blue);
}

.filter__select {
  height: var(--touch-min);
  padding: 0 var(--space-32) 0 var(--space-12);
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-md);
  font-family: var(--font-system);
  font-size: var(--text-sm);
  color: var(--c-text);
  background-color: var(--c-white);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%234A4A4A' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter__select:focus {
  border-color: var(--c-blue-2);
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

.filters__actions {
  display: flex;
  gap: var(--space-8);
  align-items: flex-end;
  flex-shrink: 0;
}

/* Chips de filtros activos */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  padding-block: var(--space-8);
  min-height: 40px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-12);
  border-radius: 100px;
  background-color: var(--c-blue);
  color: var(--c-white);
  font-size: var(--text-xs);
  font-weight: 600;
}

.filter-chip__remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 var(--space-4);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.filter-chip__remove:hover { color: var(--c-white); }

/* ============================================================
   LISTAS INSTITUCIONALES
   ============================================================ */

.list-inst {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.list-inst__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  padding: var(--space-16);
  background-color: var(--c-white);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--c-blue-2);
}

.list-inst__number {
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--c-blue);
  opacity: 0.3;
  line-height: 1;
  flex-shrink: 0;
  min-width: 32px;
}

.list-inst__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-blue);
  margin-bottom: var(--space-4);
}

.list-inst__text {
  font-size: var(--text-xs);
  color: var(--c-text);
  margin-bottom: 0;
  opacity: 0.8;
}

/* ============================================================
   ESTADOS DE CARGA
   ============================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-bg) 25%,
    #ECECEC 50%,
    var(--c-bg) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-8);
}

.skeleton-text--short { width: 40%; }
.skeleton-text--mid   { width: 70%; }
.skeleton-text--full  { width: 100%; }

/* ============================================================
   ALERTAS / BANNERS
   ============================================================ */

.alert {
  padding: var(--space-16);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
}

.alert--info    { background-color: #E3F0FF; color: var(--c-blue); border: 1px solid #BFD7F7; }
.alert--success { background-color: #E8F5E9; color: #2E7D32;      border: 1px solid #A5D6A7; }
.alert--warning { background-color: #FFFDE7; color: #E65100;      border: 1px solid #FFE082; }
.alert--error   { background-color: #FFEBEE; color: var(--c-red); border: 1px solid #EF9A9A; }

/* Scroll lock cuando un modal está abierto */
body.modal-open { overflow: hidden; }

/* ============================================================
   FLUJO AGENDAR — selector de profesional + calendario (ag-*)
   ============================================================ */

.ag-booking {
  width: 100%;
}

/* ── Indicador de pasos ─────────────────────────────────────── */
.ag-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-24);
}
.ag-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--c-line);
}
.ag-step--active .ag-step__num {
  background: var(--c-blue);
  color: #fff;
}
.ag-step--active .ag-step__label { color: var(--c-blue); font-weight: 600; }
.ag-step--done   .ag-step__num  { background: #2E7D32; color: #fff; }
.ag-step--done   .ag-step__label { color: #2E7D32; }
.ag-step__num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c-line);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ag-step__label { white-space: nowrap; }
.ag-step-sep {
  flex: 1;
  height: 1px;
  background: var(--c-line);
  min-width: 16px;
  max-width: 40px;
}

/* ── Panel de paso ──────────────────────────────────────────── */
.ag-step-panel { width: 100%; }
.ag-step-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-blue);
  margin: 0 0 var(--space-8);
}
.ag-step-desc {
  font-size: var(--text-sm);
  color: var(--c-text);
  margin: 0 0 var(--space-16);
}
.ag-prof-name { color: var(--c-red); }
.ag-back-btn {
  background: none;
  border: none;
  color: var(--c-blue);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: var(--space-16);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Selector de profesionales ──────────────────────────────── */
.ag-prof-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-12);
}
.ag-prof-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-16) var(--space-12);
  border: 2px solid var(--c-line);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.ag-prof-btn__avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-blue);
  color: #fff;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ag-prof-btn__name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--c-blue);
}

/* ── Calendario ─────────────────────────────────────────────── */
.ag-cal { margin-bottom: var(--space-16); }
.ag-cal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-12);
}
.ag-cal__nav {
  background: none;
  border: 1px solid var(--c-line);
  width: 32px; height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-blue);
  transition: background .12s;
}

.ag-cal__nav--disabled { opacity: .35; pointer-events: none; }
.ag-cal__month {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-blue);
}
.ag-cal__dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.ag-cal__dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text);
  padding: 4px 0;
}
.ag-cal__cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.ag-cal__cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 13px;
  border-radius: 4px;
  position: relative;
}
.ag-cal__cell--empty   { background: transparent; }
.ag-cal__cell--past    { color: var(--c-line); }
.ag-cal__cell--inactive { color: var(--c-line); }
.ag-cal__cell--available {
  background: #E3EFF9;
  color: var(--c-blue);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color .12s, background .12s;
}
.ag-cal__cell--available:hover { border-color: var(--c-blue); background: #cde0f4; }
.ag-cal__cell--selected {
  background: var(--c-blue) !important;
  color: #fff !important;
  border-color: var(--c-blue) !important;
}
.ag-cal__cell-day { line-height: 1; }

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: #1a1a1a;
  color: #f5f5f5;
  padding: var(--space-16) var(--space-24);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner--visible {
  transform: translateY(0);
}

.cookie-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-24);
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  min-width: 240px;
  font-size: .9rem;
  line-height: 1.5;
  color: #d4d4d4;
  margin: 0;
}

.cookie-banner__link {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.cookie-banner__link:hover {
  color: #fff;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-8);
  flex-shrink: 0;
  flex-wrap: wrap;
}

@media (max-width: 599px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner__actions {
    justify-content: stretch;
  }
  .cookie-banner__actions .btn {
    flex: 1;
  }
}
.ag-cal__cell-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-red);
}
.ag-cal__cell--selected .ag-cal__cell-dot { background: rgba(255,255,255,.7); }

/* ── Slots de horario ───────────────────────────────────────── */
.ag-slots { margin-top: var(--space-16); }
.ag-slots__title {
  font-size: var(--text-sm);
  color: var(--c-text);
  margin: 0 0 var(--space-12);
}
.ag-slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}
.ag-slot-btn {
  padding: 7px 16px;
  border: 2px solid var(--c-blue);
  background: #fff;
  color: var(--c-blue);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: background .12s, color .12s;
}

.ag-slots__empty, .ag-no-slots, .ag-loading {
  font-size: var(--text-sm);
  color: var(--c-text);
  padding: var(--space-12) 0;
  font-style: italic;
}

/* ── Resumen de reserva ─────────────────────────────────────── */
.ag-summary {
  background: #E3EFF9;
  border-left: 4px solid var(--c-blue);
  padding: var(--space-12) var(--space-16);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-20);
  font-size: var(--text-sm);
}
.ag-summary strong { color: var(--c-blue); font-size: var(--text-base); }

/* ── Form de datos personales ───────────────────────────────── */
.ag-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-16);
}
.ag-field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-blue);
}
.ag-field label span[aria-hidden] { color: var(--c-red); }
.ag-field input, .ag-field textarea, .ag-field select {
  padding: 10px 12px;
  border: 1px solid var(--c-line);
  background: #fff;
  font-size: var(--text-sm);
  color: var(--c-text);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .12s;
}
.ag-field input:focus, .ag-field textarea:focus, .ag-field select:focus {
  outline: none;
  border-color: var(--c-blue);
}
.ag-field textarea { resize: vertical; min-height: 90px; }
.ag-field__err {
  font-size: 12px;
  color: var(--c-red);
  min-height: 16px;
}
.ag-form-err {
  font-size: var(--text-sm);
  color: var(--c-red);
  background: #FFEBEE;
  border: 1px solid #EF9A9A;
  padding: 10px 14px;
  margin-bottom: var(--space-12);
}

/* ── Éxito ──────────────────────────────────────────────────── */
.ag-success {
  text-align: center;
  padding: var(--space-32) var(--space-16);
}
.ag-success__icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-16);
}
.ag-success__title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-blue);
  margin: 0 0 var(--space-12);
}
.ag-success__msg {
  font-size: var(--text-base);
  color: var(--c-text);
  margin: 0 0 var(--space-8);
}

@media (min-width: 480px) {
  .ag-prof-grid { grid-template-columns: repeat(4, 1fr); }
}
