/* =========================================================
   MODAL DE AGENDA PROFESIONAL
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  opacity: 0;
  visibility: hidden;
  transition: .25s ease;
}

.modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 18, 31, .76);
  backdrop-filter: blur(9px);
}

.modal-panel {
  position: relative;
  width: min(820px, 94vw);
  max-height: 92vh;
  overflow: auto;
  margin: 4vh auto;
  background:
    radial-gradient(circle at top left, rgba(201, 149, 46, .13), transparent 34%),
    #fff;
  border-radius: 34px;
  padding: 30px;
  box-shadow: 0 40px 110px rgba(0, 0, 0, .45);
  border: 1px solid rgba(201, 149, 46, .28);
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #eef4fa;
  color: #082b52;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .25s ease;
  z-index: 3;
}

.modal-close:hover {
  background: #c9952e;
  color: #fff;
  transform: rotate(90deg);
}

.agenda-head {
  text-align: center;
  margin-bottom: 24px;
}

.agenda-head img {
  width: 150px;
  margin: 0 auto 12px;
}

.agenda-head h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: #082b52;
  margin: 8px 0;
}

.agenda-head p {
  max-width: 620px;
  margin: 0 auto;
  color: #566477;
}

.appointment-form {
  display: grid;
  gap: 16px;
}

.appointment-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
  color: #082b52;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.appointment-form input,
.appointment-form textarea,
.appointment-form select {
  width: 100%;
  border: 1px solid #dce4ed;
  border-radius: 18px;
  padding: 14px 16px;
  background: #fff;
  outline: none;
  transition: .2s ease;
  color: #172235;
}

.appointment-form input:focus,
.appointment-form textarea:focus,
.appointment-form select:focus {
  border-color: #c9952e;
  box-shadow: 0 0 0 4px rgba(201, 149, 46, .14);
}

/* =========================================================
   CALENDARIO PERSONALIZADO
========================================================= */

.agenda-calendar-box,
.agenda-time-box {
  background: linear-gradient(135deg, #ffffff, #f7fbff);
  border: 1px solid #e5edf6;
  border-radius: 26px;
  padding: 18px;
  box-shadow: 0 14px 38px rgba(8, 43, 82, .08);
}

.calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.calendar-top strong {
  color: #082b52;
  font-size: 1.12rem;
  text-transform: capitalize;
}

.calendar-nav {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #eef4fa;
  color: #082b52;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .2s ease;
}

.calendar-nav:hover {
  background: #c9952e;
  color: #fff;
}

.calendar-nav:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: .78rem;
  color: #66758a;
  font-weight: 900;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day {
  position: relative;
  min-height: 58px;
  border: 1px solid #dde7f1;
  background: #fff;
  border-radius: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #082b52;
  font-weight: 900;
  transition: .2s ease;
}

.calendar-day:hover {
  border-color: #c9952e;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(201, 149, 46, .12);
}

.calendar-day.is-selected {
  background: linear-gradient(135deg, #082b52, #155b86);
  color: #fff;
  border-color: #c9952e;
  box-shadow: 0 14px 30px rgba(8, 43, 82, .22);
}

.calendar-day.is-disabled {
  background: #f2f5f8;
  color: #a8b3c1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.calendar-day.is-sunday {
  background: #fff4f1;
  color: #c0392b;
  border-color: #f3c6bd;
}

.calendar-day.is-sunday::after {
  content: "No atención";
  position: absolute;
  bottom: 5px;
  left: 4px;
  right: 4px;
  font-size: .58rem;
  font-weight: 800;
  color: #c0392b;
}

.calendar-day.is-empty {
  opacity: 0;
  pointer-events: none;
}

.calendar-note {
  margin-top: 14px;
  background: #fff8e8;
  color: #7a5520;
  border: 1px solid rgba(201, 149, 46, .24);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: .86rem;
  font-weight: 800;
}

.calendar-note i {
  color: #c9952e;
  margin-right: 7px;
}

/* =========================================================
   HORARIOS
========================================================= */

.time-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.time-title strong {
  color: #082b52;
  display: block;
}

.time-title span {
  color: #66758a;
  font-size: .86rem;
  font-weight: 700;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.time-slot {
  border: 1px solid #dce4ed;
  background: #fff;
  color: #082b52;
  border-radius: 16px;
  padding: 12px 8px;
  cursor: pointer;
  font-weight: 900;
  transition: .2s ease;
}

.time-slot:hover {
  border-color: #c9952e;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(201, 149, 46, .14);
}

.time-slot.is-selected {
  background: linear-gradient(135deg, #c9952e, #e0b956);
  color: #082b52;
  border-color: #c9952e;
}

.time-slot.is-booked {
  background: #f1f3f6;
  color: #9aa8b7;
  text-decoration: line-through;
  cursor: not-allowed;
  opacity: .75;
}

.time-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 18px;
  border-radius: 18px;
  background: #f5f8fc;
  color: #66758a;
  font-weight: 800;
}

.sunday-help {
  display: none;
  margin-top: 12px;
  background: #eefaf3;
  border: 1px solid rgba(37, 211, 102, .25);
  color: #0b7a42;
  border-radius: 18px;
  padding: 13px 14px;
  font-weight: 800;
  line-height: 1.5;
}

.sunday-help.is-active {
  display: block;
}

.sunday-help i {
  color: #25d366;
  margin-right: 7px;
}

.agenda-alert {
  display: none;
  border-radius: 18px;
  padding: 13px 15px;
  font-weight: 800;
  line-height: 1.5;
}

.agenda-alert.is-error {
  display: block;
  color: #922b21;
  background: #fff0ed;
  border: 1px solid #f3c6bd;
}

.agenda-alert.is-success {
  display: block;
  color: #0b7a42;
  background: #eefaf3;
  border: 1px solid rgba(37, 211, 102, .25);
}

.agenda-submit {
  width: 100%;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 760px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-panel {
    padding: 22px;
    margin: 2vh auto;
    border-radius: 26px;
  }

  .calendar-days,
  .calendar-weekdays {
    gap: 6px;
  }

  .calendar-day {
    min-height: 52px;
    border-radius: 14px;
  }

  .time-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 460px) {
  .time-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .agenda-head img {
    width: 128px;
  }
}