/* Lịch và form đặt chỗ - Vườn Cưới An Nhiên. Prefix .cal- và .bk- */

/* ---------- lưới tháng ---------- */
.cal { border: 1px solid var(--hairline); background: var(--paper); padding: clamp(16px, 2.4vw, 26px); }
.cal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.cal-month { margin: 0; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.cal-nav { display: flex; gap: 6px; }
.cal-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--hairline);
  color: var(--olive); transition: border-color .2s, color .2s;
}
.cal-arrow:hover { border-color: var(--sage); color: var(--sage); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd {
  padding: 4px 0 8px; text-align: center; font-size: 9.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; min-height: 62px; padding: 4px 2px;
  border: 1px solid var(--hairline); background: transparent;
  font-variant-numeric: tabular-nums; color: var(--ink);
  transition: border-color .18s, background .18s;
}
.cal-day b { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1; }
.cal-day small { font-size: 8.5px; letter-spacing: .02em; color: var(--muted); line-height: 1.2; }
.cal-day.is-blank { border-color: transparent; }
.cal-day.is-free { background: #F6F8F0; border-color: #C9D2BC; }
.cal-day.is-free small { color: var(--olive); }
a.cal-day.is-free:hover { background: var(--sage-soft); border-color: var(--sage); }
.cal-day.is-held { background: var(--clay-soft); border-color: #DFC4B2; color: #8A5333; }
.cal-day.is-held small { color: #8A5333; }
.cal-day.is-taken, .cal-day.is-past { background: #EDE8DC; border-color: #E4DFD3; color: var(--muted-2); }
.cal-day.is-taken b, .cal-day.is-past b { text-decoration: line-through; }
.cal-day.is-week { background: var(--sand-soft); border-color: #E4D9C2; color: var(--muted); }
.cal-day.is-soon, .cal-day.is-far, .cal-day.is-closed {
  border-style: dashed; border-color: #E7E0D2; color: var(--muted-2); opacity: .72;
}
.cal-day.is-closed small, .cal-day.is-soon small, .cal-day.is-far small { color: var(--muted-2); }
.cal-day.is-selected { outline: 2px solid var(--olive); outline-offset: -2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; font-size: 11px; color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border: 1px solid var(--hairline); display: inline-block; }
.dot-free { background: #F6F8F0; border-color: #C9D2BC; }
.dot-held { background: var(--clay-soft); border-color: #DFC4B2; }
.dot-taken { background: #EDE8DC; border-color: #E4DFD3; }
.dot-off { background: transparent; border-style: dashed; }
.cal-note { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

/* ---------- form ---------- */
.bk { color: var(--ink); }
.bk-form {
  background: var(--paper); border: 1px solid var(--hairline);
  padding: clamp(20px, 3vw, 34px); display: grid; gap: clamp(16px, 2.4vw, 24px);
}
.bk-form[hidden] { display: none; }
.bk-intro { font-size: 13.5px; line-height: 1.7; color: var(--muted); margin: 0; max-width: 56ch; }
.bk-title { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -.02em; }
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.bk-fields { display: grid; gap: 18px; min-width: 0; }
.bk-field { display: grid; gap: 8px; min-width: 0; border: 0; padding: 0; margin: 0; }
.bk-field > label, .bk-field > legend {
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); padding: 0;
}
.bk-field legend { margin-bottom: 2px; }
.bk-count { margin-left: 8px; font-size: 10.5px; letter-spacing: .04em; text-transform: none; color: var(--olive); font-weight: 500; }
.bk-field input[type="text"],
.bk-field input[type="tel"],
.bk-field input[type="date"],
.bk-field input[type="number"],
.bk-field select,
.bk-field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--hairline); border-radius: 0;
  background: var(--cream); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.4;
  transition: border-color .2s, background .2s;
}
.bk-field textarea { resize: vertical; min-height: 88px; }
.bk-field select {
  appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236F7F63' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; cursor: pointer;
}
.bk-field input:focus-visible, .bk-field select:focus-visible, .bk-field textarea:focus-visible,
.bk-slot input:focus-visible + .bk-slot-in {
  outline: none; border-color: var(--sage); background: var(--paper);
}
.bk-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
.bk-hint, .bk-small { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.bk-optional { text-transform: none; letter-spacing: 0; color: var(--muted-2); font-weight: 400; }

/* ---------- khung giờ ---------- */
.bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 2px; }
.bk-slots--tour { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bk-slot { position: relative; display: block; cursor: pointer; min-width: 0; }
.bk-slot input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.bk-slot-in {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 62px; padding: 8px 4px;
  border: 1px solid var(--hairline); background: var(--cream); text-align: center;
  transition: border-color .18s, background .18s, color .18s;
}
.bk-slot-in b { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bk-slot-in small { font-size: 10px; letter-spacing: .04em; color: var(--muted); line-height: 1.2; }
.bk-slot:hover .bk-slot-in { border-color: var(--sage); }
.bk-slot input:checked + .bk-slot-in { background: var(--olive); border-color: var(--olive); color: var(--cream); }
.bk-slot input:checked + .bk-slot-in small { color: rgba(250, 246, 238, .8); }
.bk-slot.is-full { cursor: not-allowed; }
.bk-slot.is-full .bk-slot-in { background: var(--cream); border-style: dashed; color: var(--muted-2); opacity: .7; }
.bk-slot.is-full:hover .bk-slot-in { border-color: var(--hairline); }
.bk-slots-status { margin: 0; font-size: 12.5px; color: var(--muted); }
.bk-slots.is-loading { opacity: .5; pointer-events: none; }

/* ---------- tóm tắt ---------- */
.bk-summary {
  background: var(--cream); border: 1px solid var(--hairline); border-top: 1px solid var(--ink);
  padding: 22px; display: grid; gap: 8px; align-content: start; min-width: 0;
}
.bk-summary-eyebrow { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bk-sum-name { font-family: var(--serif); font-size: 24px; line-height: 1.2; font-weight: 400; }
.bk-sum-meta { font-size: 13px; color: var(--olive); font-weight: 500; font-variant-numeric: tabular-nums; }
.bk-sum-list { margin: 14px 0 0; display: grid; gap: 10px; }
.bk-sum-list > div { display: flex; justify-content: space-between; gap: 14px; border-top: 1px dotted var(--hairline); padding-top: 10px; }
.bk-sum-list dt { font-size: 11.5px; color: var(--muted); flex: none; }
.bk-sum-list dd { margin: 0; font-size: 13px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.bk-sum-note { margin: 14px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--muted); }

/* ---------- lỗi ---------- */
.bk-err { margin: 0; font-size: 12.5px; line-height: 1.5; color: #8A4B33; font-weight: 500; }
.bk-err:empty { display: none; }
.bk-err-form { padding: 12px 14px; border: 1px solid rgba(180, 121, 90, .4); background: var(--clay-soft); }
.bk-field.has-error input, .bk-field.has-error select, .bk-field.has-error textarea { border-color: var(--clay); background: var(--clay-soft); }

/* ---------- nút ---------- */
.bk-submit { display: grid; gap: 10px; }
.bk-submit .btn-block { min-height: 56px; }
.bk-small { text-align: center; }

/* ---------- thẻ xác nhận ---------- */
.bk-done {
  background: var(--paper); border: 1px solid var(--hairline); border-top: 1px solid var(--ink);
  padding: clamp(24px, 4vw, 40px);
  display: grid; gap: 6px; justify-items: center; text-align: center;
  max-width: 640px; margin-inline: auto;
}
.bk-done[hidden] { display: none; }
.bk-done-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--sage); color: var(--sage);
  font-size: 20px; margin-bottom: 8px;
}
.bk-done-title { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.bk-done-code { margin: 0; font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.bk-done-code b { color: var(--ink); letter-spacing: .1em; }
.bk-done-state { margin: 0; font-size: 12.5px; color: var(--muted); }
.bk-done-state b { color: var(--clay); }
.bk-done .bk-sum-list { width: 100%; margin-top: 14px; text-align: left; }
.bk-done-note { margin: 14px 0 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.bk-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }

@media (max-width: 980px) {
  .bk-grid { grid-template-columns: minmax(0, 1fr); }
  .bk-summary { border-top: 1px solid var(--ink); }
}

@media (max-width: 560px) {
  .bk-form { padding: 18px; }
  .bk-row { grid-template-columns: minmax(0, 1fr); }
  .cal { padding: 12px; }
  .cal-day { min-height: 50px; }
  .cal-day b { font-size: 16px; }
  .cal-day small { font-size: 7.5px; }
  .bk-done-actions { flex-direction: column; width: 100%; }
  .bk-done-actions .btn { width: 100%; white-space: normal; }
}

@media (max-width: 390px) {
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 50px; }
  .cal-day b { font-size: 15px; }
  .cal-day small { display: block; font-size: 7.5px; line-height: 1.15; }
  .cal-wd { font-size: 8.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-slot-in, .bk-field input, .bk-field select, .bk-field textarea, .cal-day, .cal-arrow { transition: none; }
}
