:root {
  --sapt-espresso: #4A342A;
  --sapt-camel:    #B2967D;
  --sapt-linen:    #F5F1EA;
  --sapt-khaki:    #D7C9B8;
  --sapt-white:    #ffffff;
}

/* Wrap */
.sapt-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px;
  font-family: Georgia, 'Times New Roman', serif;
}

/* Iframe skeleton loader */
.sapt-iframe-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 320px;
  background: var(--sapt-linen);
  border: 1px solid var(--sapt-khaki);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: opacity 0.4s ease;
}
.sapt-iframe-loader--done {
  opacity: 0;
  pointer-events: none;
}
.sapt-iframe-loader__spinner svg {
  animation: sapt-spin 1s linear infinite;
  display: block;
}
.sapt-iframe-loader__text {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sapt-camel);
  margin: 0;
}
@keyframes sapt-spin {
  to { transform: rotate(360deg); }
}

/* Vagaro injected iframe — force responsive */
.sapt-wrap iframe,
#frameTitle ~ iframe {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: block !important;
  border: none !important;
}

/* Progress bar */
.sapt-progress {
  height: 4px;
  background: var(--sapt-khaki);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}
.sapt-progress-bar {
  height: 100%;
  background: var(--sapt-camel);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Steps */
.sapt-step { display: none; animation: saptFadeIn 0.3s ease; }
.sapt-step.active { display: block; }

@keyframes saptFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sapt-step-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sapt-camel);
  margin-bottom: 28px;
}
.sapt-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sapt-camel);
  color: var(--sapt-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* Fields */
.sapt-fields { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.sapt-field { display: flex; flex-direction: column; gap: 8px; }
.sapt-field label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sapt-espresso);
  font-weight: 600;
}
.sapt-field input {
  padding: 14px 16px;
  border: 1.5px solid var(--sapt-khaki);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: var(--sapt-espresso);
  background: var(--sapt-white);
  transition: border-color 0.2s;
  outline: none;
}
.sapt-field input:focus { border-color: var(--sapt-camel); }
.sapt-field input.error { border-color: #c0392b; }

/* Services */
.sapt-services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}
.sapt-svc-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1.5px solid var(--sapt-khaki);
  border-radius: 10px;
  background: var(--sapt-white);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.sapt-svc-btn:hover  { border-color: var(--sapt-camel); background: #fdf9f6; }
.sapt-svc-btn.active { border-color: var(--sapt-espresso); background: var(--sapt-linen); }

.sapt-svc-name  { font-size: 15px; color: var(--sapt-espresso); font-weight: 600; }
.sapt-svc-meta  { font-size: 12px; color: var(--sapt-camel); }
.sapt-svc-price { font-size: 16px; color: var(--sapt-espresso); font-weight: 700; margin-top: 4px; }

/* Calendar */
.sapt-datetime {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
.sapt-cal-wrap {
  border: 1.5px solid var(--sapt-khaki);
  border-radius: 10px;
  overflow: hidden;
}
.sapt-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--sapt-espresso);
  color: var(--sapt-white);
}
.sapt-cal-header button {
  background: none;
  border: none;
  color: var(--sapt-camel);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
}
#saptCalTitle { font-size: 14px; letter-spacing: 1px; }
.sapt-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--sapt-linen);
}
.sapt-cal-weekdays span {
  text-align: center;
  padding: 8px 0;
  font-size: 11px;
  color: var(--sapt-camel);
  font-weight: 700;
  letter-spacing: 1px;
}
.sapt-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px;
  background: var(--sapt-white);
}
.sapt-cal-day-cell {
  text-align: center;
  padding: 8px 4px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--sapt-espresso);
  transition: all 0.15s;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sapt-cal-day-cell:hover:not(.disabled):not(.past) { background: var(--sapt-linen); }
.sapt-cal-day-cell.selected { background: var(--sapt-espresso); color: var(--sapt-white); border-radius: 6px; }
.sapt-cal-day-cell.today { font-weight: 700; color: var(--sapt-camel); }
.sapt-cal-day-cell.past, .sapt-cal-day-cell.disabled { color: var(--sapt-khaki); cursor: default; pointer-events: none; }
.sapt-cal-day-cell.empty { cursor: default; }

/* Times */
.sapt-times-wrap {
  display: flex;
  flex-direction: column;
}
.sapt-times-hint {
  font-size: 13px;
  color: var(--sapt-camel);
  text-align: center;
  margin: auto 0;
}
.sapt-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sapt-time-btn {
  padding: 12px;
  border: 1.5px solid var(--sapt-khaki);
  border-radius: 8px;
  background: var(--sapt-white);
  font-size: 14px;
  color: var(--sapt-espresso);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sapt-time-btn:hover:not(:disabled) { border-color: var(--sapt-camel); }
.sapt-time-btn.active { background: var(--sapt-espresso); color: var(--sapt-white); border-color: var(--sapt-espresso); }
.sapt-time-btn:disabled { color: var(--sapt-khaki); cursor: not-allowed; text-decoration: line-through; }

/* Summary */
.sapt-summary {
  border: 1.5px solid var(--sapt-khaki);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 28px;
}
.sapt-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--sapt-linen);
  font-size: 15px;
  color: var(--sapt-espresso);
}
.sapt-summary-row span { color: var(--sapt-camel); font-size: 13px; }
.sapt-summary-divider { height: 1px; background: var(--sapt-khaki); margin: 0 20px; }
.sapt-summary-total { background: var(--sapt-linen); font-weight: 700; }
.sapt-summary-note {
  padding: 12px 20px;
  font-size: 12px;
  color: var(--sapt-camel);
  margin: 0;
}

/* Buttons */
.sapt-nav-row { display: flex; gap: 12px; margin-top: 8px; }
.sapt-step > .sapt-btn.sapt-next { margin-top: 8px; }
.sapt-btn {
  padding: 14px 32px;
  background: var(--sapt-espresso);
  color: var(--sapt-white);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}
.sapt-btn:hover:not(:disabled) { opacity: 0.85; }
.sapt-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sapt-btn--outline {
  background: transparent;
  color: var(--sapt-espresso);
  border: 1.5px solid var(--sapt-khaki);
}

/* Success */
.sapt-success {
  text-align: center;
  padding: 60px 20px;
}
.sapt-success h3 { font-size: 28px; color: var(--sapt-espresso); margin: 20px 0 12px; }
.sapt-success > p { color: var(--sapt-camel); font-size: 16px; }

.sapt-success-divider {
  width: 48px;
  height: 1px;
  background: var(--sapt-khaki);
  margin: 36px auto;
}

.sapt-success-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 420px;
  margin: 0 auto;
}
.sapt-success-steps li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--sapt-linen);
  border: 1px solid var(--sapt-khaki);
  border-radius: 10px;
  padding: 16px 20px;
}
.sapt-success-step-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.sapt-success-steps li div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sapt-success-steps li strong {
  font-size: 15px;
  color: var(--sapt-espresso);
  font-weight: 600;
}
.sapt-success-steps li span {
  font-size: 13px;
  color: var(--sapt-camel);
  line-height: 1.5;
}

.sapt-success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .sapt-services { grid-template-columns: 1fr; }
  .sapt-datetime { grid-template-columns: 1fr; }
  .sapt-nav-row  { flex-direction: column; }
  .sapt-wrap { padding: 24px 12px; }
  .vagaro { width: 100% !important; }
}

/* Hide Vagaro widget while loader spinner is visible */
.sapt-wrap .vagaro-container.vagaro-embedded-widget {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Once loader is marked done, reveal the widget smoothly */
.sapt-iframe-loader--done ~ .vagaro-container.vagaro-embedded-widget {
  opacity: 1;
  pointer-events: auto;
}

/* Remove phantom gap from empty #frameTitle div */
#frameTitle:empty {
  display: none !important;
}
