:root {
  --free: #16a34a;
  --booked: #d1d5db;
  --accent: #2563eb;
  --text: #1f2937;
  --muted: #6b7280;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: #f9fafb;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.site-header, .site-footer { text-align: center; padding: 1rem; }
.site-header h1 { margin: 0; font-size: 1.5rem; }
.site-footer { color: var(--muted); font-size: 0.9rem; margin-top: auto; }

main { flex: 1; display: flex; justify-content: center; padding: 1rem; }

.booking {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
}

.calendar-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.1);
  padding: 1.25rem;
  width: min(420px, 95vw);
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.calendar-nav h2 { margin: 0; font-size: 1.1rem; }
.calendar-nav button {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s;
}
.calendar-nav button:hover:not(:disabled) { background: #f3f4f6; }
.calendar-nav button:disabled { opacity: 0.35; cursor: default; }

.calendar-weekdays, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekdays {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
}

.day {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  background: transparent;
  transition: transform 0.1s, background 0.15s;
}
.day.free { background: #ecfdf5; color: #065f46; cursor: pointer; }
.day.free:hover { background: var(--free); color: #fff; transform: scale(1.06); }
.day.booked { background: var(--booked); color: #6b7280; text-decoration: line-through; }
.day.disabled { color: #d1d5db; }
.day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.day.selected { background: var(--accent); color: #fff; }

.legend { font-size: 0.8rem; color: var(--muted); margin: 0.9rem 0 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 10px; }
.dot-free { background: var(--free); }
.dot-booked { background: var(--booked); }

.booking-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.1);
  padding: 1.25rem;
  width: min(340px, 95vw);
  animation: slide-in 0.2s ease-out;
}
.booking-panel.hidden { display: none; }
.booking-panel h3 { margin-top: 0; }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

form label { display: block; margin-top: 0.75rem; font-size: 0.9rem; }
form input {
  width: 100%;
  padding: 0.55rem;
  margin-top: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}
form input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.field-error { color: #dc2626; font-size: 0.8rem; min-height: 1em; margin: 0.25rem 0 0; }

form button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: filter 0.15s;
}
form button:hover:not(:disabled) { filter: brightness(1.1); }
form button:disabled { opacity: 0.6; cursor: wait; }
form button.secondary { background: #f3f4f6; color: var(--text); margin-top: 0.5rem; }

.result { background: #fff; border-radius: 12px; padding: 2rem; box-shadow: 0 1px 4px rgb(0 0 0 / 0.1); text-align: center; }
