:root {
  --ink: #17212b;
  --muted: #657382;
  --line: #d9e2e8;
  --soft-line: #edf2f5;
  --accent: #247984;
  --accent-dark: #185f68;
  --accent-soft: #e7f4f5;
  --surface: #ffffff;
  --bg: #f4f7f8;
  --error: #a93434;
  --success: #23633c;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(36, 121, 132, 0.12), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, #ffffff 0, var(--bg) 42%, #eef4f5 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

main {
  width: min(1000px, calc(100% - 24px));
  margin: 20px auto;
}

.booking-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(23, 33, 43, 0.11);
}

.intro {
  min-width: 0;
  padding: 28px;
  background: #f8fbfb;
  border-right: 1px solid var(--soft-line);
}

.eyebrow {
  width: fit-content;
  margin-bottom: 14px;
  border: 1px solid rgba(36, 121, 132, 0.26);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.details-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.detail-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
}

.detail-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.detail-title {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.detail-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-panel {
  min-width: 0;
  padding: 28px;
}

h1 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}

p {
  margin: 0 0 18px;
  color: var(--muted);
}

.field-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

form {
  display: grid;
  gap: 15px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label,
legend {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--ink);
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(40, 124, 137, 0.16);
}

.patient-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  position: relative;
}

.patient-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.patient-options label {
  min-height: 46px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.patient-options input:focus+label {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 121, 132, 0.16);
}

.patient-options input:checked+label {
  border-color: rgba(36, 121, 132, 0.45);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.hidden-field {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

button {
  width: fit-content;
  min-height: 44px;
  border: 1px solid var(--accent-dark);
  border-radius: 6px;
  padding: 11px 20px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.message {
  display: none;
  min-height: 48px;
  border-radius: 6px;
  padding: 12px 14px;
  font-weight: 700;
}

.message.success {
  display: block;
  border: 1px solid rgba(35, 99, 60, 0.35);
  background: rgba(35, 99, 60, 0.08);
  color: var(--success);
}

.message.error {
  display: block;
  border: 1px solid rgba(169, 52, 52, 0.35);
  background: rgba(169, 52, 52, 0.08);
  color: var(--error);
}

/* Calendar Widget styles */
.calendar-container {
  display: grid;
  gap: 12px;
  margin-top: 5px;
  margin-bottom: 5px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.calendar-header label {
  margin: 0;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.week-range-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  min-width: 120px;
  text-align: center;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 160ms ease;
  line-height: 1;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--bg);
  color: var(--muted);
}

.week-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 66px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  user-select: none;
  transition: all 160ms ease;
}

.day-card:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.day-card.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.day-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--bg);
  color: var(--ink);
}

.day-card .day-name {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: bold;
  color: var(--muted);
  margin-bottom: 2px;
}

.day-card.active .day-name {
  color: rgba(255, 255, 255, 0.85);
}

.day-card .day-date {
  font-size: 14px;
  font-weight: bold;
}

.time-slots-header {
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
  margin-top: 8px;
}

.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  min-height: 100px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom scrollbar for time slots */
.time-slots-grid::-webkit-scrollbar {
  width: 6px;
}
.time-slots-grid::-webkit-scrollbar-track {
  background: var(--soft-line);
  border-radius: 4px;
}
.time-slots-grid::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.time-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 160ms ease;
}

.time-slot:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.time-slot.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.hidden-inputs {
  display: none;
}

@media (max-width: 820px) {
  .booking-shell {
    grid-template-columns: 1fr;
  }

  .intro {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .details-list {
    display: none;
  }
}

@media (max-width: 640px) {
  main {
    width: calc(100% - 16px);
    max-width: 1000px;
    margin: 8px auto;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .intro,
  .form-panel {
    padding: 18px;
  }

  h1 {
    font-size: 22px;
  }

  .intro .eyebrow,
  .intro>p {
    display: none;
  }

  button {
    width: 100%;
  }

  .time-slots-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .time-slot {
    font-size: 12px;
    padding: 6px 4px;
  }
}

/* Checkbox styling */
.checkbox-group {
  display: grid;
  gap: 12px;
  margin-top: 5px;
  margin-bottom: 5px;
}

.checkbox-item {
  display: flex;
  align-items: start;
  gap: 10px;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 3px 0 0 0;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.checkbox-item label {
  font-size: 13px;
  font-weight: normal;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.checkbox-item label a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}

.checkbox-item label a:hover {
  color: var(--accent-dark);
}

body.in-iframe {
  background: #ffffff !important;
}

body.in-iframe main {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.in-iframe .booking-shell {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.in-iframe .intro {
  background: #f7f9fa !important;
  border-right: 1px solid #e5eaec !important;
}
