/* AT 8/10 — календарь выбора даты + читаемость блока согласия в формах.
   Подключается после styles.css. */

/* ——— Календарь ——— */

.at-datepicker {
  position: fixed;
  z-index: 1200;
  width: 300px;
  max-width: calc(100vw - 16px);
  padding: 14px;
  border: 1px solid rgba(34, 29, 26, 0.14);
  border-radius: 14px;
  background: #fff8eb;
  color: #221d1a;
  box-shadow: 0 18px 48px rgba(24, 16, 14, 0.28);
  font-size: 14px;
  line-height: 1.2;
}

.at-datepicker[hidden] {
  display: none;
}

.at-datepicker__head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.at-datepicker__title {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.at-datepicker__nav {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(34, 29, 26, 0.16);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.at-datepicker__nav:hover:not(:disabled) {
  background: rgba(34, 29, 26, 0.07);
}

.at-datepicker__nav:disabled {
  opacity: 0.32;
  cursor: default;
}

.at-datepicker__weekdays,
.at-datepicker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.at-datepicker__weekdays {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(34, 29, 26, 0.6);
}

.at-datepicker__weekdays span {
  text-align: center;
  padding: 4px 0;
}

.at-datepicker__cell {
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.at-datepicker__cell--empty {
  cursor: default;
}

.at-datepicker__cell:hover:not(:disabled):not(.is-selected) {
  background: rgba(34, 29, 26, 0.09);
}

.at-datepicker__cell:focus-visible {
  outline: 2px solid #4a1721;
  outline-offset: 1px;
}

.at-datepicker__cell.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1px rgba(74, 23, 33, 0.5);
}

.at-datepicker__cell.is-selected {
  background: #4a1721;
  color: #fff8eb;
  font-weight: 600;
}

.at-datepicker__cell.is-disabled,
.at-datepicker__cell:disabled {
  opacity: 0.3;
  cursor: default;
}

.at-datepicker__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(34, 29, 26, 0.12);
}

.at-datepicker__today,
.at-datepicker__close {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(34, 29, 26, 0.18);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.at-datepicker__close {
  border-color: transparent;
  background: #4a1721;
  color: #fff8eb;
}

.at-datepicker__today:hover {
  background: rgba(34, 29, 26, 0.07);
}

/* Узкие экраны — панель снизу на всю ширину, крупные ячейки под палец. */
.at-datepicker--sheet {
  top: auto !important;
  right: 8px;
  bottom: 8px;
  left: 8px !important;
  width: auto;
  max-width: none;
  padding: 16px;
  border-radius: 18px;
}

.at-datepicker--sheet .at-datepicker__cell {
  min-height: 44px;
}

.at-datepicker--sheet .at-datepicker__nav,
.at-datepicker--sheet .at-datepicker__today,
.at-datepicker--sheet .at-datepicker__close {
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  .at-datepicker__cell,
  .at-datepicker__nav {
    transition: none;
  }
}

/* ——— Читаемость согласия и примечаний в формах ——— */

/* Ссылки наследуют цвет текста: на светлой форме тёмные, на тёмной — светлые. */
.consent a,
.form-note a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.consent a:hover,
.form-note a:hover {
  text-decoration-thickness: 2px;
}

/* Формы на тёмном фоне: поднимаем контраст примечания до читаемого. */
.concept-booking-dialog .consent,
.concept-booking-dialog .form-note,
.concept-booking-dialog .form-status {
  color: rgba(255, 248, 235, 0.82);
}

/* Чекбокс согласия — заметнее и удобнее для попадания пальцем. */
.consent {
  font-size: 13px;
  gap: 12px;
  cursor: pointer;
}

.consent input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0;
  flex: none;
  cursor: pointer;
}

.concept-booking-dialog .consent input[type="checkbox"] {
  outline: 1px solid rgba(255, 248, 235, 0.45);
  outline-offset: 1px;
  border-radius: 3px;
}

.consent input[type="checkbox"]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Поле даты: место под иконку календаря + запрет зума на iOS (шрифт ≥16px). */
input[data-date-text],
input[data-datepicker] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23887e73' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  padding-right: 40px;
  cursor: pointer;
}

@media (max-width: 640px) {
  input[data-date-text],
  input[data-datepicker] {
    font-size: 16px;
  }
}
