/* 熙樂 Ciel｜預約第 2 階段：日曆、時段、聯絡資料水彩風格。
 * 僅限 #view-booking 的 step-2 可見時，保留全部日期／狀態／驗證／後端邏輯。
 * 既有紙張素材只當背景，不使用程式化圖片生成。
 */
:root {
  --booking-2-ink: #704b35;
  --booking-2-muted: #82654f;
  --booking-2-paper: #fff9ed;
  --booking-2-cream: #fbf0dc;
  --booking-2-line: #ddc4a0;
  --booking-2-green: #748b5e;
  --booking-2-green-dark: #4e6c40;
  --booking-2-warn: #ad6c56;
}

#view-booking:has(#step-2:not(.hidden)) > div:first-child {
  border: 1px solid #d6b792 !important;
  border-radius: 26px !important;
  background:
    linear-gradient(180deg,rgba(255,250,238,.80),rgba(250,237,218,.90)),
    url('../images/paper-wash.webp') center top / 100% auto repeat-y,
    #fff8e9 !important;
  box-shadow: 0 12px 32px rgba(92,65,40,.10) !important;
}
#view-booking:has(#step-2:not(.hidden)) > div:first-child > .p-6 {
  padding: clamp(.85rem, 2.5vw, 1.55rem) !important;
  background: transparent !important;
}
#view-booking #step-2 {
  min-width: 0;
}
#view-booking #step-2 > h3 {
  margin: .1rem 0 .4rem !important;
  color: #704b35 !important;
  font: 500 clamp(1.27rem, 3vw, 1.62rem)/1.55 'Iansui','Noto Serif TC',serif !important;
  letter-spacing: .065em;
}
#view-booking #step-2 > h3::before {
  content: '✿';
  margin-right: .5rem;
  font-size: .77em;
  color: #b58f70;
}
#view-booking #step-2 > h3 + p {
  margin: 0 0 1.12rem !important;
  color: #80664e !important;
  font-size: clamp(.88rem, 1.8vw, .98rem) !important;
  line-height: 1.65;
}
#view-booking #step-2 > h3 + p i {
  color: #87976b;
  margin-right: .25rem;
}
#view-booking #step-2 > .flex {
  display: grid !important;
  grid-template-columns: minmax(0,1fr);
  gap: clamp(.9rem,2.5vw,1.5rem) !important;
  align-items: start;
  min-width: 0;
}
#view-booking #step-2 > .flex > div {
  min-width: 0;
}
#view-booking #step-2 > .flex > div:first-child {
  padding: clamp(.72rem,2vw,1.05rem);
  border: 1px solid var(--booking-2-line);
  border-radius: 20px;
  background: rgba(255,252,244,.87) !important;
  box-shadow: 0 5px 16px rgba(99,74,44,.055);
}
#view-booking #step-2 > .flex > div:last-child {
  width: 100% !important;
  min-width: 0;
  gap: 1rem !important;
}
#view-booking #step-2 .calendar-header-card {
  margin-bottom: .72rem !important;
  padding: .65rem .7rem !important;
  min-height: 62px;
  border: 1px solid #dec6a4;
  border-radius: 16px !important;
  background:
    linear-gradient(105deg,rgba(241,224,199,.78),rgba(255,247,232,.95),rgba(233,232,203,.70)) !important;
  color: #73533c !important;
  box-shadow: 0 2px 7px rgba(104,72,44,.035);
}
#view-booking #step-2 .calendar-header-card #calendar-month-label {
  color: #674a32 !important;
  font: 500 clamp(1.09rem,2.5vw,1.32rem)/1.4 'Iansui','Noto Serif TC',serif !important;
  letter-spacing: .035em;
}
#view-booking #step-2 .calendar-header-card button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  padding: 0 !important;
  border: 1px solid #d5bb96;
  border-radius: 50%;
  background: #fffaf1 !important;
  color: #79553c !important;
  box-shadow: 0 2px 7px rgba(115,83,51,.05);
}
#view-booking #step-2 .calendar-header-card button:hover {
  background: #eaf0df !important;
  border-color: #9bac83;
}
#view-booking #step-2 .calendar-header-card button:focus-visible,
#view-booking #step-2 #calendar-grid button:focus-visible,
#view-booking #step-2 #time-slots-container button:focus-visible,
#view-booking #step-2 .booking-form-control:focus-visible {
  outline: 3px solid #7d9563 !important;
  outline-offset: 2px !important;
}
#view-booking #step-2 #calendar-sync-status {
  color: #647a4c !important;
  font-size: .78rem !important;
  line-height: 1.4;
}
#view-booking #step-2 .weekday-header {
  margin: .6rem 0 .45rem !important;
  gap: 0 !important;
  color: #8e6f53 !important;
  font-size: .88rem !important;
  font-weight: 700;
}
#view-booking #step-2 .weekday-header > div {
  padding: .22rem 0;
  min-width: 0;
}
#view-booking #calendar-grid {
  grid-template-columns: repeat(7,minmax(0,1fr)) !important;
  column-gap: clamp(2px,.65vw,6px) !important;
  row-gap: clamp(4px,.85vw,8px) !important;
  align-items: center;
  min-width: 0;
}
#view-booking #calendar-grid > div,
#view-booking #calendar-grid > button {
  min-width: 0;
  width: 100%;
  max-width: 44px;
  height: clamp(37px,4vw,43px);
  min-height: 37px;
  margin-inline: auto;
}
#view-booking #calendar-grid > button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 1px solid transparent;
  border-radius: 12px !important;
  /* Seven columns must fit even when root text is enlarged: keep day numerals readable without overflowing cells. */
  font: 600 clamp(13px,3.5vw,16px)/1 'Huninn',sans-serif;
  transition: border-color .15s,background-color .15s,box-shadow .15s;
}
#view-booking #calendar-grid > button:not(:disabled) {
  background: #fffaf1 !important;
  border-color: #decaaa !important;
  color: #704f3a !important;
  cursor: pointer;
}
#view-booking #calendar-grid > button:not(:disabled):hover {
  background: #edf2e4 !important;
  border-color: #8b9f71 !important;
  color: #45603b !important;
  transform: none !important;
}
#view-booking #calendar-grid > button[aria-pressed="true"] {
  background: #738d5e !important;
  border-color: #5b784a !important;
  color: #fffaf2 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24),0 3px 10px rgba(80,106,66,.13);
}
#view-booking #calendar-grid > button[aria-pressed="true"]:hover {
  background: #64814d !important;
  border-color: #4f6a3f !important;
  color: #fff !important;
}
#view-booking #calendar-grid > button:disabled {
  background: #f5efe6 !important;
  border-color: transparent !important;
  color: #ae9d88 !important;
  opacity: 1 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}
#view-booking #calendar-grid > button.date-full:disabled {
  background: #f7e6dd !important;
  border-color: #e3c2b6 !important;
  color: #a56f60 !important;
}
#view-booking #calendar-grid > button.date-loading:disabled {
  background: #faf4ea !important;
  color: #b5a898 !important;
  opacity: .6 !important;
}
#view-booking #calendar-status-message:not(.hidden) {
  margin-top: .85rem !important;
  padding: .8rem .65rem !important;
  border: 1px solid #dec4a2 !important;
  border-radius: 13px !important;
  background: #fff6e7 !important;
  color: #805f47 !important;
  line-height: 1.7;
  font-size: .87rem !important;
}
#view-booking #calendar-status-message button {
  min-height: 36px;
  color: #617a4d !important;
  font-weight: 700;
  text-underline-offset: 3px;
}
#view-booking #calendar-status-message button:focus-visible {
  outline: 3px solid #71875b;
  outline-offset: 2px;
}

#view-booking #step-2 > .flex > div:last-child > div:first-child {
  padding: clamp(.85rem,2vw,1.05rem);
  border: 1px solid var(--booking-2-line);
  border-radius: 18px;
  background: rgba(255,251,242,.89);
  box-shadow: 0 5px 14px rgba(91,70,43,.045);
  min-width: 0;
}
#view-booking #step-2 h4 {
  margin: 0 0 .65rem !important;
  color: #715039 !important;
  font: 500 clamp(1.04rem,2vw,1.18rem)/1.6 'Iansui','Noto Serif TC',serif !important;
  letter-spacing: .045em;
}
#view-booking #time-slots-container {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
#view-booking #time-slots-container > p {
  margin: 0 !important;
  padding: .95rem .55rem !important;
  color: #8a7159 !important;
  font-size: .9rem !important;
  line-height: 1.6;
}
#view-booking #time-slots-container > button {
  min-height: 46px;
  padding: .65rem .9rem !important;
  border: 1.5px solid #ddc6a8 !important;
  border-radius: 13px !important;
  background: #fffaf1 !important;
  color: #71523d !important;
  font-size: clamp(.91rem,1.5vw,1rem) !important;
  font-weight: 700;
  line-height: 1.5;
  gap: .5rem;
  box-shadow: 0 2px 6px rgba(94,69,40,.035);
}
#view-booking #time-slots-container > button:not(:disabled):hover {
  background: #eef2e4 !important;
  border-color: #91a479 !important;
  color: #4c693f !important;
}
#view-booking #time-slots-container > button:not(:disabled).bg-primary {
  background: #728b5c !important;
  border-color: #5e774d !important;
  color: #fffdf5 !important;
}
#view-booking #time-slots-container > button:disabled {
  background: #f4eee5 !important;
  border-color: #e0d3c0 !important;
  color: #998571 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}
#view-booking #time-slots-container > p.rounded-lg {
  background: #fff3e2 !important;
  color: #8b6548 !important;
  border: 1px solid #e0c9aa !important;
}

#view-booking #step-2 > .flex > div:last-child > div:last-child {
  padding: 0 !important;
  border-top: 0 !important;
  min-width: 0;
}
#view-booking #bookingBasicFields,
#view-booking #deceasedBookingFields {
  padding: clamp(.86rem,2vw,1.15rem) !important;
  border: 1px solid #d7bd9c !important;
  border-radius: 19px !important;
  background: rgba(255,250,239,.91) !important;
  box-shadow: 0 5px 15px rgba(99,73,43,.055);
  min-width: 0;
}
#view-booking #deceasedBookingFields {
  border-color: #d5c2bf !important;
  background: rgba(252,244,239,.93) !important;
}
#view-booking #bookingBasicFields > div:first-child,
#view-booking #deceasedBookingFields > div:first-child {
  color: #6d503a !important;
  font: 500 clamp(1.07rem,2vw,1.2rem)/1.6 'Iansui','Noto Serif TC',serif !important;
  letter-spacing: .03em;
}
#view-booking #bookingBasicFields > div:first-child i,
#view-booking #deceasedBookingFields > div:first-child i {
  color: #829668 !important;
}
#view-booking #deceasedBookingFields > div:first-child i {
  color: #b28b92 !important;
}
#view-booking #step-2 label {
  display: block;
  color: #76543d !important;
  font-size: clamp(.93rem,1.5vw,1.01rem) !important;
  font-weight: 700;
}
#view-booking #step-2 label .text-red-500 {
  color: #b96050 !important;
}
#view-booking #step-2 .booking-form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: .74rem .8rem !important;
  border: 1.5px solid #d2b797 !important;
  border-radius: 12px !important;
  background: #fffdf8 !important;
  color: #604733 !important;
  box-shadow: inset 0 1px 2px rgba(96,68,45,.035);
  font-size: 1rem !important;
  line-height: 1.55;
}
#view-booking #step-2 .booking-form-control::placeholder {
  color: #9a8a75 !important;
  opacity: 1;
}
#view-booking #step-2 .booking-form-control:focus {
  border-color: #77915c !important;
  outline: 3px solid rgba(113,143,84,.25) !important;
  outline-offset: 1px;
  box-shadow: inset 0 1px 2px rgba(96,68,45,.035);
}
#view-booking #step-2 textarea.booking-form-control {
  min-height: 96px !important;
  resize: vertical;
}
#view-booking #step-2 #bookingBasicFields p,
#view-booking #step-2 #deceasedBookingFields p {
  color: #856b55 !important;
  line-height: 1.7 !important;
  font-size: .86rem !important;
}
#view-booking #step-2 #petPassingCount {
  color: #816957 !important;
  font-size: .86rem !important;
  white-space: nowrap;
}
#view-booking:has(#step-2:not(.hidden)) #form-nav {
  padding: .85rem clamp(.9rem,2.6vw,1.5rem) !important;
  border-top: 1px solid #ddc49f !important;
  background: rgba(253,246,232,.96) !important;
  gap: .8rem;
}
#view-booking:has(#step-2:not(.hidden)) #form-nav button {
  min-height: 44px;
  padding: .65rem 1.25rem !important;
  border-radius: 999px !important;
  font-weight: 700;
}
#view-booking:has(#step-2:not(.hidden)) #btn-prev {
  border: 1px solid #d1b898 !important;
  background: #fff8ea !important;
  color: #765942 !important;
}
#view-booking:has(#step-2:not(.hidden)) #btn-next:not(:disabled) {
  border: 1px solid #5d7949 !important;
  background: #728c5c !important;
  color: #fff !important;
}
#view-booking:has(#step-2:not(.hidden)) #btn-next:disabled {
  border: 1px solid #d4c8b7 !important;
  background: #ded6c9 !important;
  color: #796b5a !important;
  cursor: not-allowed;
}
#view-booking:has(#step-2:not(.hidden)) #form-nav button:focus-visible {
  outline: 3px solid #819965 !important;
  outline-offset: 3px;
}

@media (min-width: 1040px) {
  #view-booking #step-2 > .flex {
    grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr);
    gap: 1rem !important;
  }
}
@media (max-width: 480px) {
  #view-booking:has(#step-2:not(.hidden)) > div:first-child {
    border-radius: 20px !important;
  }
  #view-booking #step-2 > .flex > div:first-child {
    padding: .6rem;
    border-radius: 15px;
  }
  #view-booking #step-2 .calendar-header-card {
    padding: .4rem .45rem !important;
    min-height: 56px;
  }
  #view-booking #step-2 .calendar-header-card button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  #view-booking #calendar-grid {
    column-gap: 2px !important;
    row-gap: 5px !important;
  }
  #view-booking #calendar-grid > button,
  #view-booking #calendar-grid > div {
    height: 38px;
    min-height: 38px;
  }
  #view-booking #step-2 .weekday-header { font-size: .78rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  #view-booking #step-2 #calendar-grid button,
  #view-booking #step-2 #time-slots-container button {
    transition: none !important;
  }
}
