/* ==========================================================================
   Jeff Morris (The High Trust Guy) 2-Step Pre-Qualification & Booking Modal
   Dark editorial luxury theme matching #000000 / #5195fe site aesthetic.
   ========================================================================== */

.dsb-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(2, 6, 14, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dsb-overlay.dsb-active {
  opacity: 1;
  pointer-events: auto;
}

.dsb-overlay *,
.dsb-overlay *::before,
.dsb-overlay *::after {
  box-sizing: border-box;
}

.dsb-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #090e1a;
  color: #ffffff;
  border: 1px solid rgba(93, 157, 252, 0.35);
  border-top: 4px solid #5195fe;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.78), 0 0 36px rgba(81, 149, 254, 0.14);
  padding: clamp(22px, 3.5vw, 34px);
  transform: scale(0.97) translateY(10px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.24s ease;
  text-align: left;
}

.dsb-overlay.dsb-active .dsb-dialog {
  transform: scale(1) translateY(0);
}

.dsb-dialog.dsb-step-2-wide {
  max-width: 880px;
}

/* Header & Stepper */
.dsb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.dsb-header-text {
  flex: 1;
  min-width: 0;
}

.dsb-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dsb-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dsb-step-pill.dsb-is-active {
  background: rgba(81, 149, 254, 0.16);
  color: #8bb9fe;
  border-color: rgba(81, 149, 254, 0.48);
}

.dsb-step-pill.dsb-is-done {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
}

.dsb-step-sep {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  font-weight: 700;
}

.dsb-title {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 700;
  line-height: 1.22;
  color: #ffffff;
  margin: 0 0 6px;
}

.dsb-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

.dsb-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.84);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dsb-close:hover {
  background: rgba(81, 149, 254, 0.2);
  border-color: rgba(81, 149, 254, 0.5);
  color: #ffffff;
}

/* Form Layout */
.dsb-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dsb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dsb-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dsb-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.dsb-req {
  color: #5d9dfc;
}

.dsb-input,
.dsb-select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: #ffffff;
  background: #0e1628;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dsb-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.dsb-select option {
  background: #090e1a;
  color: #ffffff;
}

.dsb-input:focus,
.dsb-select:focus {
  outline: none;
  background: #121c33;
  border-color: #5195fe;
  box-shadow: 0 0 0 3px rgba(81, 149, 254, 0.22);
}

.dsb-input[aria-invalid="true"],
.dsb-select[aria-invalid="true"] {
  border-color: #f87171;
  background: rgba(127, 29, 29, 0.24);
}

/* Timeline Radio Pills */
.dsb-radio-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dsb-radio-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 10px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0e1628;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dsb-radio-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.dsb-radio-pill:hover {
  border-color: rgba(81, 149, 254, 0.65);
  background: rgba(81, 149, 254, 0.1);
}

.dsb-radio-pill.dsb-selected {
  border-color: #5195fe;
  background: rgba(81, 149, 254, 0.2);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px #5195fe;
}

.dsb-radio-pill:focus-within {
  outline: 3px solid rgba(81, 149, 254, 0.35);
  outline-offset: 1px;
}

.dsb-radio-group[aria-invalid="true"] .dsb-radio-pill {
  border-color: #f87171;
}

/* Consent & Honeypot */
.dsb-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.dsb-consent input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #5195fe;
}

.dsb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.dsb-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  font-size: 13.5px;
  font-weight: 600;
}

.dsb-error:empty {
  display: none;
}

.dsb-submit-btn {
  width: 100%;
  min-height: 48px;
  padding: 13px 22px;
  border: none;
  border-radius: 980px;
  background: #5195fe;
  color: #040914;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(81, 149, 254, 0.32);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.dsb-submit-btn:hover {
  background: #7cb3fd;
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(81, 149, 254, 0.45);
}

.dsb-submit-btn:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.dsb-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.dsb-note a {
  color: #8bb9fe;
  text-decoration: underline;
}

/* Step 2: Calendar Embed */
.dsb-step-2 {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dsb-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #0e1628;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.dsb-summary-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dsb-summary-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 980px;
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
  font-size: 11.5px;
  font-weight: 700;
}

.dsb-edit-btn {
  border: 1px solid rgba(81, 149, 254, 0.45);
  background: rgba(81, 149, 254, 0.12);
  color: #8bb9fe;
  border-radius: 8px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dsb-edit-btn:hover {
  background: rgba(81, 149, 254, 0.22);
  border-color: #5195fe;
}

.dsb-iframe-wrap {
  position: relative;
  width: 100%;
  height: 640px;
  min-height: 540px;
  max-height: 70vh;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  overflow: hidden;
}

.dsb-iframe-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  background: #f8fafc;
  z-index: 1;
}

.dsb-iframe-loader.dsb-hidden {
  display: none;
}

.dsb-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #cbd5e1;
  border-top-color: #5195fe;
  border-radius: 50%;
  animation: dsb-spin 0.8s linear infinite;
}

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

.dsb-iframe {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

.dsb-step2-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.64);
  padding-top: 4px;
}

.dsb-fallback-link {
  color: #8bb9fe;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dsb-fallback-link:hover {
  color: #ffffff;
}

.dsb-hidden {
  display: none !important;
}

.dsb-close:focus-visible,
.dsb-submit-btn:focus-visible,
.dsb-edit-btn:focus-visible,
.dsb-fallback-link:focus-visible {
  outline: 3px solid rgba(81, 149, 254, 0.55);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .dsb-overlay {
    padding: 10px;
  }

  .dsb-dialog {
    padding: 18px 16px;
    border-radius: 14px;
    max-height: calc(100vh - 20px);
  }

  .dsb-grid-2,
  .dsb-radio-group {
    grid-template-columns: 1fr;
  }

  .dsb-iframe-wrap {
    height: 560px;
    min-height: 460px;
    max-height: 68vh;
  }
}
