/*
 * Native SolidGold booking widget — drops into any /book/<slug>/ page.
 * Inherits the per-page --accent-a / --accent-b / --accent-gradient
 * CSS vars so it re-themes automatically. Dark glassmorphic look
 * matching the rest of the site.
 */

.sg-widget {
  max-width: 1000px;
  margin: 0 auto;
  background: linear-gradient(180deg, #0a1628 0%, #050b18 100%);
  border: 1px solid rgba(var(--accent-a-rgb), 0.18);
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4),
              0 0 60px rgba(var(--accent-a-rgb), 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 40px 44px 48px;
  color: #ffffff;
  font-family: 'DM Sans', -apple-system, sans-serif;
  position: relative;
  overflow: hidden;
}

.sg-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(var(--accent-a-rgb), 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 100%, rgba(var(--accent-b-rgb), 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.sg-widget > * {
  position: relative;
  z-index: 1;
}

.sg-widget-header {
  text-align: center;
  margin-bottom: 28px;
}

.sg-widget-title {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.sg-widget-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 300;
}

.sg-widget-sub strong {
  color: var(--accent-a);
  font-weight: 600;
}

/* Steps progress bar */
.sg-steps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}
.sg-step {
  width: 42px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.25s;
}
.sg-step.active {
  background: var(--accent-a);
  box-shadow: 0 0 12px rgba(var(--accent-a-rgb), 0.5);
}

/* Date strip */
.sg-date-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-a-rgb), 0.3) transparent;
}
.sg-date-strip::-webkit-scrollbar {
  height: 6px;
}
.sg-date-strip::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-a-rgb), 0.3);
  border-radius: 3px;
}
.sg-date-pill {
  flex-shrink: 0;
  min-width: 78px;
  padding: 14px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-family: inherit;
  color: #ffffff;
}
.sg-date-pill:hover:not(.disabled) {
  border-color: rgba(var(--accent-a-rgb), 0.45);
  background: rgba(var(--accent-a-rgb), 0.05);
  transform: translateY(-1px);
}
.sg-date-pill.active {
  background: rgba(var(--accent-a-rgb), 0.12);
  border-color: var(--accent-a);
  box-shadow: 0 0 0 1px var(--accent-a), 0 10px 24px rgba(var(--accent-a-rgb), 0.2);
}
.sg-date-pill.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.sg-date-weekday {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  margin-bottom: 4px;
}
.sg-date-pill.active .sg-date-weekday { color: var(--accent-b); }
.sg-date-day {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
}
.sg-date-month {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}
.sg-date-count {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
  font-weight: 500;
}
.sg-date-pill.active .sg-date-count { color: var(--accent-a); }

/* Time slot grid */
.sg-time-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}
.sg-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.sg-time-pill {
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.sg-time-pill:hover {
  border-color: rgba(var(--accent-a-rgb), 0.55);
  background: rgba(var(--accent-a-rgb), 0.08);
  transform: translateY(-1px);
}
.sg-time-pill.active {
  background: var(--accent-a);
  border-color: var(--accent-a);
  color: #050b18;
  box-shadow: 0 10px 28px rgba(var(--accent-a-rgb), 0.35);
}
.sg-time-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-style: italic;
}

/* Form fields */
.sg-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}
.sg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sg-field.full {
  grid-column: 1 / -1;
}
.sg-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
.sg-field input,
.sg-field textarea {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
}
.sg-field input::placeholder,
.sg-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.sg-field input:focus,
.sg-field textarea:focus {
  outline: none;
  border-color: var(--accent-a);
  background: rgba(var(--accent-a-rgb), 0.04);
  box-shadow: 0 0 0 3px rgba(var(--accent-a-rgb), 0.12);
}
.sg-field textarea {
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
}
.sg-field.error input,
.sg-field.error textarea {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}
.sg-field-error {
  color: #f87171;
  font-size: 12px;
  margin-top: 2px;
}

/* Summary strip above form */
.sg-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: rgba(var(--accent-a-rgb), 0.08);
  border: 1px solid rgba(var(--accent-a-rgb), 0.22);
  border-radius: 12px;
  font-size: 14px;
}
.sg-summary-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(var(--accent-a-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sg-summary-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent-a);
}
.sg-summary strong {
  color: var(--accent-a);
  font-weight: 700;
}
.sg-summary button {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.65);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sg-summary button:hover {
  border-color: var(--accent-a);
  color: var(--accent-a);
}

/* Buttons */
.sg-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  justify-content: flex-end;
}
.sg-btn {
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.sg-btn-primary {
  background: var(--accent-a);
  color: #050b18;
  box-shadow: 0 10px 28px rgba(var(--accent-a-rgb), 0.28);
}
.sg-btn-primary:hover:not(:disabled) {
  background: var(--accent-b);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(var(--accent-a-rgb), 0.4);
}
.sg-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.sg-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}
.sg-btn-ghost:hover {
  border-color: var(--accent-a);
  color: var(--accent-a);
}
.sg-btn-sm {
  padding: 9px 18px;
  font-size: 13px;
}
.sg-request-cta {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sg-request-cta__text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 560px) {
  .sg-request-cta { flex-direction: column; align-items: stretch; text-align: center; }
}

/* States */
.sg-loading {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}
.sg-loading::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(var(--accent-a-rgb), 0.2);
  border-top-color: var(--accent-a);
  border-radius: 50%;
  animation: sg-spin 0.8s linear infinite;
  margin-right: 12px;
  vertical-align: middle;
}
@keyframes sg-spin { to { transform: rotate(360deg); } }

.sg-error {
  text-align: center;
  padding: 40px 20px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 14px;
  font-size: 14px;
}

/* Confirmation */
.sg-confirmed {
  text-align: center;
  padding: 32px 20px 16px;
}
.sg-confirmed-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(var(--accent-a-rgb), 0.12);
  border: 2px solid var(--accent-a);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(var(--accent-a-rgb), 0.35);
}
.sg-confirmed-icon svg {
  width: 36px;
  height: 36px;
  color: var(--accent-a);
  stroke-width: 3;
}
.sg-confirmed h3 {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.sg-confirmed .sg-confirmed-when {
  font-size: 16px;
  color: var(--accent-a);
  margin-bottom: 18px;
  font-weight: 600;
}
.sg-confirmed-details {
  max-width: 460px;
  margin: 20px auto 28px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  text-align: left;
}
.sg-confirmed-details .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}
.sg-confirmed-details .row:last-child { border-bottom: none; }
.sg-confirmed-details .label {
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  padding-top: 2px;
}
.sg-confirmed-details .value {
  color: #ffffff;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}
.sg-confirmed-details .value a {
  color: var(--accent-a);
  font-weight: 700;
}

/* Mobile */
@media (max-width: 640px) {
  .sg-widget { padding: 28px 20px 32px; border-radius: 18px; }
  .sg-widget-title { font-size: 18px; }
  .sg-form { grid-template-columns: 1fr; }
  .sg-time-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .sg-btn-row { flex-direction: column-reverse; }
  .sg-btn { width: 100%; text-align: center; }
  .sg-date-pill { min-width: 68px; padding: 12px 8px; }
  .sg-date-day { font-size: 18px; }
}
