/* SerpScheduling — Frontend Booking Widget v1.1 */

.serp-sched-widget {
  --ss-accent: var(--serp-sched-accent, #533afd);
  --ss-bg: #ffffff;
  --ss-surface: #f8f9fb;
  --ss-border: #e5edf5;
  --ss-heading: #061b31;
  --ss-body: #64748d;
  --ss-label: #273951;
  --ss-radius: 6px;
  --ss-shadow: 0 1px 3px rgba(50, 50, 93, .12), 0 1px 2px rgba(0, 0, 0, .06);
  --ss-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-family: var(--ss-font);
  max-width: 440px;
  margin: 0 auto;
  background: var(--ss-bg);
  border: 1px solid var(--ss-border);
  border-radius: 8px;
  box-shadow: var(--ss-shadow);
  overflow: hidden;
  color: var(--ss-body);
  font-size: 14px;
  line-height: 1.5;
}

.serp-sched-widget *,
.serp-sched-widget *::before,
.serp-sched-widget *::after {
  box-sizing: border-box;
}

.serp-sched-theme-dark {
  --ss-bg: #1a1d2e;
  --ss-surface: #232640;
  --ss-border: rgba(255, 255, 255, .1);
  --ss-heading: rgba(255, 255, 255, .95);
  --ss-body: rgba(255, 255, 255, .65);
  --ss-label: rgba(255, 255, 255, .8);
}

.serp-sched-step {
  padding: 24px;
}

/* Confirm step — vertical gap matches .serp-sched-form so the textarea doesn't
   butt against the confirm button. */
.serp-sched-step-confirm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Header with pulsating live dot ────────────────────────────────────── */
/* Absolute-positioned dot — immune to any theme flex/block/float overrides.
   The header reserves left padding for the dot, and the dot lives in the
   absolute layer so parent display logic cannot shift it. */
.serp-sched-widget .serp-sched-header {
  position: relative !important;
  padding-left: 18px !important;
  margin-bottom: 14px !important;
  width: 100% !important;
  display: block !important;
}

.serp-sched-widget .serp-sched-header>.serp-sched-live-dot {
  position: absolute !important;
  top: 11px !important;
  left: 0 !important;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  max-width: 8px !important;
  min-height: 8px !important;
  max-height: 8px !important;
  border-radius: 50% !important;
  background: var(--dot-color, var(--ss-accent)) !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: block !important;
}

.serp-sched-widget .serp-sched-header>.serp-sched-header-text {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

/* Kill WP theme default top margin on the h3 that would push the title down
   and create a visible gap above it in basic/combined layouts. */
.serp-sched-widget .serp-sched-header>.serp-sched-header-text>.serp-sched-title {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.serp-sched-widget .serp-sched-header>.serp-sched-header-text>.serp-sched-title:first-child {
  margin-top: 0 !important;
}

/* Also reset the first descendant of header-text generally */
.serp-sched-widget .serp-sched-header>.serp-sched-header-text>*:first-child {
  margin-top: 0 !important;
}

.serp-sched-live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--dot-color, var(--ss-accent));
  opacity: 0;
  animation: serp-sched-pulse 2s ease-in-out infinite;
}

@keyframes serp-sched-pulse {

  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }

  50% {
    opacity: .3;
    transform: scale(1.5);
  }
}

.serp-sched-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ss-heading);
  letter-spacing: -0.2px;
}

.serp-sched-desc {
  margin: 4px 0 0 !important;
  padding: 0 !important;
  font-size: 13px;
  color: var(--ss-body);
}

.serp-sched-duration {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Form ──────────────────────────────────────────────────────────────── */
.serp-sched-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.serp-sched-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.serp-sched-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ss-label);
}

.serp-sched-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: var(--ss-font);
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius);
  background: var(--ss-bg);
  color: var(--ss-heading);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.serp-sched-input:focus {
  border-color: var(--ss-accent);
  box-shadow: 0 0 0 3px rgba(83, 58, 253, .12);
}

.serp-sched-textarea {
  resize: vertical;
  min-height: 60px;
}

.serp-sched-theme-dark .serp-sched-input {
  background: var(--ss-surface);
  border-color: var(--ss-border);
  color: var(--ss-heading);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.serp-sched-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--ss-font);
  color: #fff;
  background: var(--ss-accent);
  border: none;
  border-radius: var(--ss-radius);
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-align: center;
}

.serp-sched-btn:hover {
  opacity: .9;
}

.serp-sched-btn:active {
  transform: scale(.99);
}

.serp-sched-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.serp-sched-back {
  display: inline-block;
  background: none;
  border: none;
  color: var(--ss-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  font-family: var(--ss-font);
}

.serp-sched-back:hover {
  text-decoration: underline;
}

/* ── Calendar ──────────────────────────────────────────────────────────── */
.serp-sched-calendar-grid {
  margin-bottom: 20px;
}

.serp-sched-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.serp-sched-cal-header button {
  background: none;
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--ss-heading);
  transition: background .15s;
}

.serp-sched-cal-header button:hover {
  background: var(--ss-surface);
}

.serp-sched-cal-month {
  font-weight: 600;
  font-size: 15px;
  color: var(--ss-heading);
}

.serp-sched-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ss-body);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.serp-sched-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.serp-sched-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: var(--ss-radius);
  cursor: pointer;
  color: var(--ss-heading);
  transition: background .1s, color .1s;
  border: none;
  background: none;
  font-family: var(--ss-font);
}

.serp-sched-cal-day:hover:not(.is-disabled):not(.is-selected) {
  background: var(--ss-surface);
}

.serp-sched-cal-day.is-today {
  font-weight: 700;
}

.serp-sched-cal-day.is-selected {
  background: var(--ss-accent);
  color: #fff;
  font-weight: 600;
}

.serp-sched-cal-day.is-disabled {
  color: var(--ss-body);
  opacity: .35;
  cursor: default;
}

.serp-sched-cal-day.is-empty {
  cursor: default;
}

/* Available day = soft green highlight */
.serp-sched-cal-day.has-slots:not(.is-selected):not(.is-disabled) {
  background: rgba(21, 190, 83, .12);
  color: var(--ss-heading);
}

.serp-sched-cal-day.has-slots:not(.is-selected):not(.is-disabled):hover {
  background: rgba(21, 190, 83, .22);
}

.serp-sched-theme-dark .serp-sched-cal-day.has-slots:not(.is-selected):not(.is-disabled) {
  background: rgba(21, 190, 83, .15);
}

/* ── Time slots ────────────────────────────────────────────────────────── */
.serp-sched-slots-panel {
  border-top: 1px solid var(--ss-border);
  padding-top: 16px;
}

.serp-sched-slots-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ss-heading);
  margin: 0 0 10px;
}

.serp-sched-slots-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.serp-sched-slot {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius);
  background: var(--ss-bg);
  color: var(--ss-heading);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-family: var(--ss-font);
}

.serp-sched-slot:hover {
  border-color: var(--ss-accent);
  color: var(--ss-accent);
}

.serp-sched-slot.is-selected {
  background: var(--ss-accent);
  border-color: var(--ss-accent);
  color: #fff;
}

.serp-sched-slots-empty {
  font-size: 13px;
  color: var(--ss-body);
}

.serp-sched-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ss-border);
  border-top-color: var(--ss-accent);
  border-radius: 50%;
  animation: serp-sched-spin .6s linear infinite;
}

@keyframes serp-sched-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Confirm ───────────────────────────────────────────────────────────── */
.serp-sched-confirm-summary {
  background: var(--ss-surface);
  border-radius: var(--ss-radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ss-heading);
  line-height: 1.6;
}

.serp-sched-confirm-summary strong {
  font-weight: 600;
}

.serp-sched-booking-error {
  margin-top: 10px;
  font-size: 13px;
  color: #d93025;
}

/* ── Done ──────────────────────────────────────────────────────────────── */
.serp-sched-step-done {
  text-align: center;
  padding: 40px 24px;
}

.serp-sched-done-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.serp-sched-theme-dark .serp-sched-done-icon {
  background: rgba(46, 125, 50, .2);
}

.serp-sched-step-done h3 {
  margin: 0 0 8px;
  color: var(--ss-heading);
  font-size: 18px;
  font-weight: 600;
}

.serp-sched-done-details {
  font-size: 14px;
  color: var(--ss-heading);
  margin: 0 0 6px;
}

.serp-sched-done-email {
  font-size: 12px;
  color: var(--ss-body);
}

.serp-sched-error {
  color: #d93025;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

@media (max-width: 480px) {
  .serp-sched-widget {
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .serp-sched-step {
    padding: 18px 16px;
  }
}

/* ── Timezone note ─────────────────────────────────────────────────────── */
.serp-sched-tz-note {
  font-size: 13px;
  color: var(--ss-body);
  margin: 12px 0 0;
  opacity: .8;
  font-style: italic;
}

/* ── Add to Calendar links — 2x2 grid layout ──────────────────────────── */
.serp-sched-cal-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.serp-sched-cal-link {
  display: block;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--ss-radius);
  text-decoration: none;
  font-family: var(--ss-font);
  transition: opacity .15s;
  color: #fff !important;
  text-align: center;
}

.serp-sched-cal-link:hover,
.serp-sched-cal-link:focus,
.serp-sched-cal-link:visited {
  opacity: .85;
  color: #fff !important;
}

.serp-sched-cal-link--google {
  background: #4285f4;
}

.serp-sched-cal-link--outlook {
  background: #0078d4;
}

.serp-sched-cal-link--apple {
  background: #1d1d1f;
}

.serp-sched-cal-link--ics {
  background: #6b7280;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Layout Additions — Steps, Combined, Custom Fields, TOS, Powered By
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Button radius variable ────────────────────────────────────────────── */
.serp-sched-btn,
.serp-sched-input {
  border-radius: var(--ss-btn-radius, var(--ss-radius, 6px));
}

/* Textareas use a capped radius — full pill on tall fields flattens the sides.
      Square stays square, rounded stays 6px, pill softens to 14px. */
.serp-sched-textarea {
  border-radius: var(--ss-textarea-radius, var(--ss-radius, 6px)) !important;
}

/* ── Steps indicator bar ───────────────────────────────────────────────── */
.serp-sched-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ss-border);
}

.serp-sched-step-ind {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ss-body);
  opacity: .5;
  transition: opacity .2s, color .2s;
}

.serp-sched-step-ind.is-active {
  opacity: 1;
  color: var(--ss-heading);
}

.serp-sched-step-ind.is-completed {
  opacity: .65;
  color: var(--ss-heading);
}

.serp-sched-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ss-border);
  flex-shrink: 0;
  position: relative;
  transition: background .2s;
}

.serp-sched-step-ind.is-active .serp-sched-step-dot {
  background: var(--ss-accent);
}

.serp-sched-step-ind.is-active .serp-sched-step-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--ss-accent);
  opacity: 0;
  animation: serp-sched-step-pulse 2s ease-in-out infinite;
}

@keyframes serp-sched-step-pulse {

  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }

  50% {
    opacity: .3;
    transform: scale(1.6);
  }
}

.serp-sched-step-ind.is-completed .serp-sched-step-dot {
  width: 14px;
  height: 14px;
  background: var(--ss-accent);
}

.serp-sched-step-ind.is-completed .serp-sched-step-dot::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

/* ── Combined layout ───────────────────────────────────────────────────── */
.serp-sched-combined-cal {
  margin-top: 20px;
  transition: opacity .3s, filter .3s;
}

.serp-sched-combined-cal.is-faded {
  opacity: .4;
  pointer-events: none;
  position: relative;
}

.serp-sched-combined-cal.is-faded::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.serp-sched-form-collapsible {
  transition: max-height .3s ease, opacity .25s ease, margin .2s ease;
  overflow: hidden;
}

.serp-sched-form-collapsible.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

.serp-sched-edit-info {
  display: inline-block;
  background: none;
  border: none;
  color: var(--ss-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
  font-family: var(--ss-font);
}

.serp-sched-edit-info:hover {
  text-decoration: underline;
}

/* ── Custom field styles ───────────────────────────────────────────────── */
.serp-sched-radio-group,
.serp-sched-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.serp-sched-radio-label,
.serp-sched-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ss-body);
  cursor: pointer;
}

.serp-sched-radio-label input,
.serp-sched-checkbox-label input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  background: var(--ss-bg);
  background-image: none;
  border: 2px solid var(--ss-border);
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
  outline: none;
}

.serp-sched-radio-label input[type="radio"] {
  border-radius: 50%;
}

.serp-sched-checkbox-label input[type="checkbox"] {
  border-radius: 3px;
}

.serp-sched-radio-label input:checked,
.serp-sched-checkbox-label input:checked {
  background: var(--ss-accent);
  border-color: var(--ss-accent);
}

/* Radio: no inner dot — solid accent fill only */

.serp-sched-checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -55%) rotate(45deg);
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
}

/* ── TOS ───────────────────────────────────────────────────────────────── */
.serp-sched-tos {
  padding: 2px 0;
}

.serp-sched-tos-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--ss-body);
  line-height: 1.4;
  cursor: pointer;
}

.serp-sched-tos-label input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  background: var(--ss-bg);
  border: 2px solid var(--ss-border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
  outline: none;
}

.serp-sched-tos-label input[type="checkbox"]:checked {
  background: var(--ss-accent);
  border-color: var(--ss-accent);
}

.serp-sched-tos-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -55%) rotate(45deg);
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
}

.serp-sched-tos-label a {
  color: var(--ss-accent);
  text-decoration: underline;
}

.serp-sched-tos-label a:hover {
  opacity: .8;
}

/* ── Powered by ────────────────────────────────────────────────────────── */
.serp-sched-powered-by {
  text-align: center;
  padding: 10px 24px;
  border-top: 1px solid var(--ss-border);
  font-size: 11px;
  color: var(--ss-body);
}

.serp-sched-powered-by a,
.serp-sched-powered-by a:visited,
.serp-sched-powered-by a:focus {
  color: var(--ss-accent) !important;
  text-decoration: none;
  font-weight: 600;
}

.serp-sched-powered-by a:hover {
  color: var(--ss-accent) !important;
  text-decoration: underline;
}

/* ── Button icon ───────────────────────────────────────────────────────── */
.serp-sched-btn-icon {
  vertical-align: middle;
  margin-left: 6px;
}