/* Custom booking calendar — matches foeldvary.com contact UI */

.bc-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.bc-shell {
  width: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.dark .bc-shell {
  border-color: #2a3441;
  background: #1e293b;
}

.bc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem 0.25rem;
}

.bc-toolbar-left,
.bc-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.bc-title-stack {
  display: none;
}

.bc-today-btn {
  margin: 0;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #dce0e5;
  background: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #637588;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.bc-today-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.dark .bc-today-btn {
  border-color: #334155;
  background: #0f172a;
  color: #94a3b8;
}

.dark .bc-today-btn:hover {
  border-color: #818cf8;
  color: #818cf8;
}

.bc-title-period {
  margin: 0 0 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: #111418;
  white-space: nowrap;
}

.dark .bc-title-period {
  color: #f8fafc;
}

.bc-title-month {
  font-weight: 700;
}

.bc-title-year {
  font-weight: 400;
}

.bc-seg,
.bc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid #dce0e5;
  background: #ffffff;
  color: #637588;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.dark .bc-seg,
.dark .bc-icon-btn {
  border-color: #334155;
  background: #0f172a;
  color: #94a3b8;
}

.bc-seg {
  height: 2rem;
  padding: 0 0.75rem;
  position: relative;
}

.bc-seg-group .bc-seg {
  border-radius: 0;
}

.bc-seg-group .bc-seg:first-child {
  border-radius: 0.5rem 0 0 0.5rem;
}

.bc-seg-group .bc-seg:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
}

.bc-seg-group .bc-seg + .bc-seg {
  margin-left: -1px;
}

.bc-seg-group .bc-seg.is-active {
  z-index: 1;
}

.bc-icon-btn {
  width: 2rem;
  height: 2rem;
}

.bc-seg:hover,
.bc-icon-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.bc-seg.is-active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.bc-seg:focus-visible,
.bc-icon-btn:focus-visible,
.bc-day:focus-visible,
.bc-slot:focus-visible,
.bc-continue:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.bc-seg-group {
  display: inline-flex;
  gap: 0;
  padding: 0.2rem;
  border-radius: 0.65rem;
  background: #f8fafc;
}

.dark .bc-seg-group {
  background: rgba(15, 23, 42, 0.65);
}

.bc-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.bc-tz {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.bc-body {
  padding: 0.25rem 1rem 1rem;
}

/* ——— Month view ——— */
.bc-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.bc-dow {
  padding: 0.35rem 0;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.bc-day {
  aspect-ratio: 1;
  min-height: 2.5rem;
  border-radius: 0.65rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #111418;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dark .bc-day {
  border-color: #334155;
  background: #0f172a;
  color: #e2e8f0;
}

.bc-day:hover:not(:disabled):not(.is-weekend) {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.08);
}

.bc-day.is-weekend,
.bc-day.is-outside,
.bc-day:disabled {
  border-color: #e5e7eb;
  background: #f1f5f9;
  color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.7;
}

.dark .bc-day.is-weekend,
.dark .bc-day.is-outside,
.dark .bc-day:disabled {
  border-color: #1e293b;
  background: #0b1220;
  color: #475569;
}

.bc-day.is-today {
  border-color: rgba(99, 102, 241, 0.45);
  color: #6366f1;
}

.dark .bc-day.is-today {
  color: #818cf8;
}

.bc-day.is-selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.16);
  color: #6366f1;
}

.bc-day-slots {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.dark .bc-day-slots {
  border-top-color: #2a3441;
}

.bc-day-slots-title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111418;
}

.dark .bc-day-slots-title {
  color: #f8fafc;
}

.bc-slot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.5rem;
}

/* ——— Week view ——— */
.bc-week-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bc-week-grid {
  display: grid;
  grid-template-columns: 4.25rem repeat(5, minmax(5.5rem, 1fr));
  gap: 0.35rem;
  min-width: 36rem;
}

@media (min-width: 900px) {
  .bc-week-grid {
    grid-template-columns: 4.5rem repeat(5, minmax(6.25rem, 1fr));
    min-width: 0;
  }
}

.bc-week-corner,
.bc-week-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  line-height: 1.2;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.bc-week-head {
  flex-direction: row;
  gap: 0.35rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
}

.dark .bc-week-head {
  background: transparent;
  color: #94a3b8;
}

.bc-week-head-day {
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.bc-week-head-date {
  font-size: 0.9375rem;
  color: #111418;
}

.dark .bc-week-head-date {
  color: #f8fafc;
}

.bc-week-head.is-today .bc-week-head-date {
  color: #6366f1;
}

.bc-week-head.is-today {
  border: none;
  background: transparent;
}

.dark .bc-week-head.is-today .bc-week-head-date {
  color: #818cf8;
}

.dark .bc-week-head.is-today {
  border: none;
  background: transparent;
}

.bc-week-time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  min-height: 3.75rem;
}

@media (min-width: 900px) {
  .bc-week-time {
    min-height: 3.75rem; /* ~60px */
  }
}

.bc-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.35rem;
  border-radius: 0.55rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 900px) {
  .bc-slot {
    min-height: 3.75rem;
    min-width: 6.25rem; /* ~100px feel on desktop week cells */
  }
}

.dark .bc-slot {
  border-color: #334155;
  background: #0f172a;
  color: #cbd5e1;
}

.bc-slot.is-available:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.bc-slot.is-busy,
.bc-slot.is-busy:disabled {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  cursor: not-allowed;
  opacity: 1;
}

.dark .bc-slot.is-busy,
.dark .bc-slot.is-busy:disabled {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.bc-slot.is-selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.18);
  color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.bc-slot.is-disabled:not(.is-busy),
.bc-slot:disabled:not(.is-busy) {
  border-color: #e5e7eb;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.7;
}

.dark .bc-slot.is-disabled:not(.is-busy),
.dark .bc-slot:disabled:not(.is-busy) {
  border-color: #1e293b;
  background: #0b1220;
  color: #475569;
}

.bc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0 1rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.bc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.bc-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.2rem;
  border: 1px solid #e2e8f0;
}

.bc-swatch-available {
  background: #ffffff;
}

.dark .bc-swatch-available {
  background: #0f172a;
  border-color: #334155;
}

.bc-swatch-busy {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.5);
}

.bc-swatch-selected {
  background: rgba(99, 102, 241, 0.45);
  border-color: #6366f1;
}

.bc-swatch-disabled {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.dark .bc-swatch-disabled {
  background: #0b1220;
  border-color: #1e293b;
}

/* ——— Selection summary ——— */
.bc-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.dark .bc-summary {
  border-color: #2a3441;
  background: rgba(15, 23, 42, 0.55);
}

.bc-summary.is-empty .bc-summary-value {
  color: #94a3b8;
  font-weight: 500;
}

.bc-summary-label {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.bc-summary-value {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #111418;
}

.dark .bc-summary-value {
  color: #f8fafc;
}

.bc-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 0.5rem;
  border: none;
  background: #6366f1;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.bc-continue:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.bc-continue:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.bc-status {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.bc-error {
  margin: 0 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.dark .bc-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.bc-error-title {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #dc2626;
}

.dark .bc-error-title {
  color: #fca5a5;
}

.bc-error-text {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}

.dark .bc-error-text {
  color: #94a3b8;
}

.bc-error-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  padding: 0 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: transparent;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.dark .bc-error-retry {
  color: #fca5a5;
}

.bc-error-retry:hover {
  background: rgba(239, 68, 68, 0.1);
}

.booking-submit-error {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  font-size: 0.875rem;
  line-height: 1.45;
  color: #b91c1c;
}

.dark .booking-submit-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.booking-submit-error.hidden {
  display: none;
}

.bc-shell.is-loading {
  opacity: 0.85;
}
