:root {
  --primary: #ffffff;
  --secondary: #000000;
  --accent: #ff0000;
  --accent-contrast: #ffffff;
  --page-bg: #f4f4f4;
  --card-bg: #ffffff;
  --border: #dddddd;
  --muted: #666666;
  --success: #16803c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page-bg);
  color: var(--secondary);
}
.site-header {
  background: var(--secondary);
  color: var(--primary);
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 12px 24px;
}
.brand { display:flex; align-items:center; gap:14px; }
.brand img {
  max-width: 180px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: var(--primary);
}
.brand-name { font-size: 20px; font-weight: 700; }
.brand-subtitle { opacity:.75; margin-top:3px; }
.booking-shell { max-width: 780px; margin: 40px auto; padding: 0 18px; }
.card { background:var(--card-bg); border-radius:16px; box-shadow:0 10px 35px rgba(0,0,0,.08); padding:28px; }
.progress { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:28px; }
.step { padding:8px 12px; border-radius:999px; background:#eee; color:#777; font-size:13px; }
.step.active { background:var(--accent); color:var(--accent-contrast); }
h1,h2 { margin-top:0; }
.muted { color:var(--muted); line-height:1.5; }
label { display:block; font-weight:700; margin:18px 0 7px; }
input, select {
  width:100%; padding:13px 14px; border:1px solid var(--border);
  border-radius:9px; font-size:16px; background:#fff;
}
button, .button {
  border:0; border-radius:9px; padding:13px 18px; font-size:15px;
  font-weight:700; cursor:pointer; text-decoration:none; display:inline-block;
}
.primary { background:var(--accent); color:var(--accent-contrast); margin-top:24px; width:100%; }
.primary:disabled { opacity:.45; cursor:not-allowed; }
.secondary { background:var(--secondary); color:var(--primary); }
.back { background:none; color:var(--secondary); padding:0; margin-bottom:18px; }
.summary, .review, .selection-summary, .calendar-note {
  border:1px solid var(--border); border-radius:10px; padding:15px; margin-top:18px;
}
.calendar-note { display:flex; flex-direction:column; gap:4px; background:#fafafa; }
.slots { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:10px; margin-top:18px; }
.slot {
  border:1px solid var(--border); background:#fff; color:var(--secondary);
  padding:12px; border-radius:9px; text-align:center; cursor:pointer;
}
.slot:hover { border-color:var(--accent); }
.slot.start, .slot.selected { background:var(--accent); color:#fff; border-color:var(--accent); }
.slot.unavailable { background:#eee; color:#999; cursor:not-allowed; text-decoration:line-through; }
.slot.blocked { background:#a8a8a8; }
.slot.full::after { content:" • Full"; }
.selection-summary { font-weight:700; }
.hidden { display:none !important; }
.state { padding:28px; text-align:center; }
.error { color:#a00000; background:#fff0f0; border-radius:10px; }
.success { text-align:center; padding:25px 5px; }
.success-icon {
  width:58px; height:58px; border-radius:50%; background:var(--success);
  color:#fff; display:grid; place-items:center; margin:0 auto 14px; font-size:30px;
}
.success .button { margin-top:12px; }
.site-footer { text-align:center; padding:25px; color:#777; font-size:13px; }
.payment-notice { padding:12px; background:#fff8e5; border-radius:8px; margin-top:15px; }
@media(max-width:600px) {
  .card { padding:20px; }
  .booking-shell { margin:20px auto; }
}



/* =========================================
   BOOKING DATE CALENDAR
   ========================================= */
.calendar {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 18px;
  background: #fff;
}
.calendar-header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.calendar-month {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}
.calendar-nav {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--secondary);
  font-size: 28px;
  line-height: 1;
}
.calendar-nav:hover:not(:disabled) { border-color: var(--accent); }
.calendar-nav:disabled { opacity: .35; cursor: not-allowed; }
.calendar-weekdays, .calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
}
.calendar-day {
  min-height: 42px;
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--secondary);
  font-size: 15px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.calendar-day.available { cursor: pointer; }
.calendar-day.available:hover { border-color: var(--accent); }
.calendar-day.selected {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.calendar-day.unavailable, .calendar-day.outside-range {
  background: #f1f1f1;
  color: #aaa;
  cursor: not-allowed;
}
.calendar-day.blank { visibility: hidden; border: 0; }
#dateDisplay {
  background: #f8f8f8;
  cursor: default;
}
@media(max-width:450px) {
  .calendar { padding: 10px; }
  .calendar-weekdays, .calendar-days { gap: 3px; }
  .calendar-day { min-height: 38px; font-size: 14px; }
}

/* =========================================
   LOCATION SETTINGS
   ========================================= */

.settings-shell {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 18px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
}

.settings-header .button {
  white-space: nowrap;
}

.settings-section {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.settings-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.settings-section h2 {
  margin-bottom: 8px;
}

.settings-section textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 16px;
  background: #fff;
  font-family: inherit;
  resize: vertical;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.color-grid input[type="color"] {
  width: 100%;
  height: 50px;
  padding: 4px;
  cursor: pointer;
}

.logo-preview {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  text-align: center;
}

.logo-preview img {
  max-width: 260px;
  max-height: 100px;
  object-fit: contain;
}

.settings-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  gap: 15px;
}

.settings-status span {
  font-weight: 700;
}

.availability-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.availability-summary > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
  background: #fafafa;
}

.availability-summary strong,
.availability-summary span {
  display: block;
}

.availability-summary span {
  margin-top: 7px;
  color: var(--muted);
}

.settings-save {
  border-top: 1px solid var(--border);
  padding-top: 25px;
  margin-top: 10px;
}

.settings-save .primary {
  margin-top: 12px;
}

@media(max-width: 700px) {

  .settings-header {
    flex-direction: column;
  }

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

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

}

@media(max-width: 450px) {

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

  /* =========================================
     MOBILE TEXT WRAPPING
     ========================================= */

  /* Branding logo preview */
  .logo-preview {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .logo-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100px;
    margin: 0 auto;
    object-fit: contain;
  }

  /* Calendar information */
  #calendarInfo,
  #blockingCalendarControls {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-all !important;
  }

  #blockingCalendarControls * {
    min-width: 0;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-all !important;
  }

  /* Other User / CC recipient email addresses */
  #otherUserEmailOptions,
  #otherUserEmailRecipients {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #otherUserEmailRecipients label {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #otherUserEmailRecipients label > span {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #otherUserEmailRecipients .muted {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* User cards */
  #usersList > div {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #usersList code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Availability time rows */
  .availability-row {
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  .availability-row input,
  .availability-row select,
  .availability-row button {
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
  }

  .availability-row label {
    width: 100%;
  }

}

.summary-section {
  display: block;
  margin-bottom: 18px;
}

.summary-section:last-child {
  margin-bottom: 0;
}

/* =========================================================
   CUSTOM ALERT / CONFIRM
   ========================================================= */

#customAlertOverlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .72);
}

#customAlertOverlay.show {
    display: flex;
}

.customAlertBox {
    width: min(92vw, 760px);
    min-height: 360px;
    padding: 34px 42px 30px;
    background: #e6e6e6;
    color: #000;
    border: 6px solid #ed1c24;
    border-radius: 64px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.customAlertLogo {
    width: min(300px, 55%);
    max-height: 100px;
    object-fit: contain;
    margin: 0 auto 18px;
}

#customAlertMessage {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px 24px;
    font-size: clamp(22px, 3vw, 42px);
    line-height: 1.2;
    font-weight: bold;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.customAlertButtons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.customAlertButton {
    min-width: 120px;
    padding: 11px 24px;
    border: 0;
    border-radius: 7px;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.customAlertButton:hover {
    background: #555;
}

.customAlertButton.confirm {
    background: #168016;
}

.customAlertButton.cancel {
    background: #8b0000;
}

@media (max-width: 600px) {

    #customAlertOverlay {
        padding: 14px;
    }

    .customAlertBox {
        min-height: 280px;
        padding: 25px 20px 22px;
        border-width: 5px;
        border-radius: 42px;
    }

    .customAlertLogo {
        width: min(220px, 70%);
        max-height: 72px;
        margin-bottom: 8px;
    }

    #customAlertMessage {
        padding: 8px 6px 18px;
        font-size: clamp(20px, 6vw, 30px);
    }

    .customAlertButtons {
        gap: 10px;
    }

    .customAlertButton {
        min-width: 105px;
        padding: 10px 18px;
        font-size: 15px;
    }
}
