/* ===============================
   eBrevia demo modal
   English direct demo form (Salesforce Web-to-Lead) + optional Calendly,
   plus the Japanese iframe modal. Injected on every page by demo-modal.js.
   Scoped to #eb-* / #jp-* / .eb-* so it can't collide with page styles.
================================ */
#eb-demo-overlay,
#eb-demo-overlay * {
  box-sizing: border-box;
}

#eb-demo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000002;
  background: rgba(0, 0, 0, 0.58);
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow-x: hidden;
  overflow-y: auto;
}

#eb-demo-overlay.eb-open {
  display: flex;
}

#eb-demo-modal {
  position: relative;
  width: min(920px, calc(100vw - 40px));
  max-width: 920px;
  max-height: calc(100vh - 56px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
  font-family: Inter, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
}

#eb-demo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  font-size: 24px;
  line-height: 36px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  z-index: 100;
}

#eb-demo-title {
  margin: 0 0 4px !important;
  padding: 0 52px 0 0 !important;
  font-size: 28px !important;
  line-height: 1.1 !important;
  color: #FA9200 !important;
  font-weight: 700 !important;
}

#eb-demo-subtitle {
  margin: 0 0 18px !important;
  padding: 0 52px 0 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: #6b7280 !important;
}

.eb-demo-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.eb-form-panel,
.eb-calendar-panel {
  min-width: 0;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.08);
}

.eb-form-panel {
  padding: 18px;
}

.eb-form-panel h3 {
  margin: 0 0 14px !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  color: #1f2937 !important;
  font-weight: 700 !important;
}

.eb-field {
  margin: 0 0 10px !important;
  padding: 0 !important;
}

.eb-field label {
  display: block;
  margin: 0 0 4px !important;
  padding: 0 !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  color: #6b7280 !important;
  font-weight: 700 !important;
}

.eb-field .optional {
  color: #9ca3af !important;
  font-weight: 400 !important;
}

.eb-field input {
  width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  background: #f9fafb !important;
  box-shadow: none !important;
}

.eb-field input:focus {
  outline: none !important;
  background: #ffffff !important;
  border-color: #FA9200 !important;
  box-shadow: 0 0 0 2px rgba(250, 146, 0, 0.22) !important;
}

.eb-submit-btn {
  width: 100% !important;
  height: 38px !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 6px !important;
  background: #FA9200 !important;
  color: #ffffff !important;
  font-size: 13px !important;
  line-height: 38px !important;
  font-weight: 700 !important;
  cursor: pointer;
}

.eb-submit-btn:hover {
  background: #e28300 !important;
}

.eb-submit-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.eb-form-status {
  display: none;
  margin: 9px 0 0 !important;
  padding: 8px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  color: #365314 !important;
  background: #ecfccb !important;
  border: 1px solid #bef264 !important;
  border-radius: 6px !important;
  text-align: center !important;
}

.eb-privacy-note {
  margin: 10px 0 0 !important;
  padding: 0 !important;
  font-size: 9.5px !important;
  line-height: 1.35 !important;
  font-style: italic !important;
  color: #9ca3af !important;
  text-align: center !important;
}

.eb-calendar-panel {
  position: relative;
  min-height: 388px;
}

.eb-schedule-choice {
  min-height: 388px;
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(250, 146, 0, 0.12), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fffaf3 100%);
}

.eb-schedule-kicker {
  margin: 0 0 8px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  color: #8700ff !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

.eb-schedule-choice h3 {
  margin: 0 0 10px !important;
  padding: 0 !important;
  font-size: 24px !important;
  line-height: 1.15 !important;
  color: #1f2937 !important;
  font-weight: 700 !important;
}

.eb-schedule-choice p {
  margin: 0 0 18px !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #6b7280 !important;
}

.eb-schedule-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #f3d7ac;
  border-radius: 10px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
}

.eb-schedule-note strong {
  color: #1f2937;
}

.eb-after-submit-actions {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.eb-schedule-choice.eb-submitted .eb-after-submit-actions {
  display: flex;
}

.eb-schedule-btn,
.eb-skip-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.eb-schedule-btn {
  color: #ffffff;
  background: #FA9200;
  border: 2px solid #FA9200;
}

.eb-schedule-btn:hover {
  background: #e28300;
  border-color: #e28300;
}

.eb-skip-btn {
  color: #FA9200;
  background: #ffffff;
  border: 2px solid #FA9200;
}

.eb-skip-btn:hover {
  background: rgba(250, 146, 0, 0.08);
}

#eb-calendly-widget {
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 560px;
  max-height: 560px;
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
}

#eb-calendly-widget iframe {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 560px !important;
  border: 0 !important;
  transform: none !important;
  border-radius: 10px !important;
}

.eb-calendly-fallback {
  display: none;
  margin: 10px 4px 0;
  color: #8700ff !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
}

.eb-calendly-fallback:hover {
  text-decoration: underline !important;
}

.eb-calendar-panel.eb-calendly-active .eb-calendly-fallback {
  display: inline-block;
}

.eb-calendar-panel.eb-calendly-active {
  height: 560px;
  max-height: 560px;
}

body.eb-demo-no-scroll,
body.jp-demo-no-scroll {
  overflow: hidden !important;
}

/* ===============================
   Japanese iframe demo modal
================================ */
#jp-demo-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000001;
}

#jp-demo-modal.jp-open {
  display: block;
}

.jp-demo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.jp-demo-modal-content {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 90vh;
  margin: 5vh auto;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
}

#jp-demo-iframe {
  width: 100%;
  height: 100%;
  border: none;
  overflow: auto;
}

.jp-demo-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 36px;
  text-align: center;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

@media (max-width: 820px) {
  #eb-demo-overlay {
    align-items: flex-start;
    padding: 18px;
  }

  #eb-demo-modal {
    width: calc(100vw - 36px);
    max-height: none;
    padding: 22px;
  }

  .eb-demo-grid {
    grid-template-columns: 1fr;
  }

  .eb-calendar-panel,
  .eb-schedule-choice {
    min-height: 360px;
  }

  .eb-calendar-panel.eb-calendly-active,
  #eb-calendly-widget,
  #eb-calendly-widget iframe {
    height: 620px !important;
    max-height: 620px !important;
  }
}

@media (max-width: 520px) {
  #eb-demo-overlay {
    padding: 12px;
  }

  #eb-demo-modal {
    width: calc(100vw - 24px);
    padding: 18px;
    border-radius: 14px;
  }

  #eb-demo-title {
    font-size: 23px !important;
  }

  #eb-demo-subtitle {
    font-size: 13px !important;
  }

  .eb-schedule-choice {
    padding: 24px 20px;
  }

  .eb-schedule-choice h3 {
    font-size: 21px !important;
  }

  .eb-schedule-btn,
  .eb-skip-btn {
    width: 100%;
  }

  .eb-calendar-panel.eb-calendly-active,
  #eb-calendly-widget,
  #eb-calendly-widget iframe {
    height: 640px !important;
    max-height: 640px !important;
  }
}

@media (max-width: 768px) {
  .jp-demo-backdrop {
    display: none;
  }

  .jp-demo-modal-content {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }

  #jp-demo-iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .jp-demo-close {
    top: 12px;
    right: 12px;
    z-index: 20;
  }
}
