/* Booking Widget — Dark theme matching valiotti.com */

.vb-widget {
  --bk-ink: #0a0a0a;
  --bk-paper: #f0ece4;
  --bk-paper-dim: #b5b0a6;
  --bk-accent: #cc5a3e;
  --bk-accent-hover: #b84e35;
  --bk-muted: #8a8578;
  --bk-border: rgba(240,236,228,0.12);
  --bk-surface: rgba(240,236,228,0.06);
  --bk-success: #4a9c6d;
  --bk-radius: 8px;
  --bk-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bk-serif: 'Cormorant Garamond', 'Georgia', serif;

  font-family: var(--bk-sans);
  color: var(--bk-paper);
  max-width: 440px;
  margin: 0 auto;
  min-height: 400px;
}

/* ═══ HEADER ═══ */
.vb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.vb-header__title {
  font-family: var(--bk-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--bk-paper);
  margin: 0;
}
.vb-header__tz {
  font-size: 0.78rem;
  color: var(--bk-muted);
}

/* ═══ BACK BUTTON ═══ */
.vb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--bk-muted);
  font-family: var(--bk-sans);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.vb-back:hover { color: var(--bk-paper); }
.vb-back svg { width: 16px; height: 16px; }

/* ═══ CALENDAR ═══ */
.vb-calendar {
  user-select: none;
}
.vb-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.vb-cal-nav__month {
  font-family: var(--bk-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--bk-paper);
}
.vb-cal-nav__btn {
  background: none;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  color: var(--bk-paper);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.vb-cal-nav__btn:hover { border-color: var(--bk-accent); }
.vb-cal-nav__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.vb-cal-nav__btn svg { width: 18px; height: 18px; }

.vb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.vb-cal-dow {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--bk-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0 8px;
}
.vb-cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--bk-radius);
  color: var(--bk-paper);
  font-family: var(--bk-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  padding: 0;
}
.vb-cal-day:hover { background: var(--bk-surface); }
.vb-cal-day--empty { cursor: default; }
.vb-cal-day--empty:hover { background: none; }
.vb-cal-day--disabled {
  color: var(--bk-muted);
  opacity: 0.35;
  cursor: not-allowed;
}
.vb-cal-day--disabled:hover { background: none; }
.vb-cal-day--today {
  border: 1px solid var(--bk-border);
}
.vb-cal-day--available::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bk-accent);
  position: absolute;
  bottom: 4px;
}
.vb-cal-day--selected {
  background: var(--bk-accent) !important;
  color: white;
}
.vb-cal-day--selected::after { background: white; }

/* ═══ TIME SLOTS ═══ */
.vb-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vb-slot-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--bk-muted);
  margin-bottom: 12px;
}
.vb-slot-summary svg { width: 18px; height: 18px; flex-shrink: 0; }
.vb-slot-summary strong {
  color: var(--bk-paper);
  font-weight: 500;
}
.vb-slot-btn {
  background: transparent;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  padding: 14px 16px;
  color: var(--bk-paper);
  font-family: var(--bk-sans);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.vb-slot-btn:hover {
  border-color: var(--bk-accent);
  background: rgba(204, 90, 62, 0.08);
}
.vb-slot-btn--selected {
  border-color: var(--bk-accent);
  background: var(--bk-accent);
  color: white;
}
.vb-no-slots {
  text-align: center;
  padding: 32px 16px;
  color: var(--bk-muted);
  font-size: 0.9rem;
}

/* ═══ FORM ═══ */
.vb-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.vb-form-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bk-surface);
  border-radius: var(--bk-radius);
  margin-bottom: 4px;
}
.vb-form-summary__text {
  font-size: 0.9rem;
  color: var(--bk-paper);
}
.vb-form-summary__edit {
  background: none;
  border: none;
  color: var(--bk-accent);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--bk-sans);
  padding: 0;
}
.vb-form-summary__edit:hover { text-decoration: underline; }

.vb-input {
  background: rgba(240,236,228,0.06);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  padding: 14px 16px;
  color: var(--bk-paper);
  font-family: var(--bk-sans);
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
  outline: none;
}
.vb-input::placeholder {
  color: var(--bk-muted);
}
.vb-input:focus {
  border-color: var(--bk-accent);
}
.vb-input--error {
  border-color: #c0392b;
}
.vb-error {
  font-size: 0.78rem;
  color: #e74c3c;
  margin-top: -8px;
}

/* Honeypot */
.vb-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ═══ BUTTONS ═══ */
.vb-btn {
  background: var(--bk-accent);
  color: white;
  border: none;
  border-radius: var(--bk-radius);
  padding: 16px 24px;
  font-family: var(--bk-sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.vb-btn:hover { background: var(--bk-accent-hover); }
.vb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spinner */
.vb-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: vb-spin 0.6s linear infinite;
}
@keyframes vb-spin {
  to { transform: rotate(360deg); }
}

/* ═══ SUCCESS ═══ */
.vb-success {
  text-align: center;
  padding: 32px 16px;
}
.vb-success__check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bk-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: vb-pop 0.4s ease;
}
@keyframes vb-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.vb-success__check svg {
  width: 32px;
  height: 32px;
  color: white;
}
.vb-success__title {
  font-family: var(--bk-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--bk-paper);
  margin-bottom: 8px;
}
.vb-success__text {
  font-size: 0.9rem;
  color: var(--bk-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.vb-success__detail {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--bk-paper);
  margin-bottom: 8px;
}
.vb-success__detail svg {
  width: 16px;
  height: 16px;
  color: var(--bk-accent);
  flex-shrink: 0;
}
.vb-success__link {
  display: inline-block;
  margin-top: 16px;
  color: var(--bk-accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.vb-success__link:hover { text-decoration: underline; }

/* ═══ SKELETON ═══ */
.vb-skeleton {
  background: var(--bk-surface);
  border-radius: var(--bk-radius);
  animation: vb-shimmer 1.5s ease-in-out infinite;
}
@keyframes vb-shimmer {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.vb-skeleton--slot {
  height: 48px;
  margin-bottom: 8px;
}
.vb-skeleton--cal {
  height: 280px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
  .vb-widget {
    max-width: 100%;
    padding: 0 4px;
  }
  .vb-cal-day {
    font-size: 0.82rem;
  }
  .vb-input {
    font-size: 16px; /* prevents iOS zoom */
  }
}
