.demo-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top, 0px));
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  overscroll-behavior: contain;
}

.demo-modal-overlay.open {
  display: flex;
}

.demo-modal {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 44px 40px;
  max-width: 620px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.18);
  max-height: 90vh;
  overflow-y: auto;
  animation: dmSlideUp 0.25s ease;
  overscroll-behavior: contain;
}

@keyframes dmSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-modal-close {
  display: block;
  margin-left: auto;
  margin-bottom: 8px;
  background: none;
  border: none;
  font-size: 28px;
  color: #94A3B8;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.demo-modal-close:hover {
  color: #1E293B;
}

.dm-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  background: #F1F5F9;
  border-radius: 10px;
  padding: 4px;
}

.dm-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.dm-tab:hover {
  color: #1E293B;
}

.dm-tab.active {
  background: #FFFFFF;
  color: #1E293B;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.dm-pane {
  display: none;
}

.dm-pane.active {
  display: block;
}

.demo-modal.demo-modal--booking {
  overflow: hidden;
}

.demo-modal.demo-modal--booking .dm-pane.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.demo-modal-sub {
  color: #6B7280;
  font-size: 13.5px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.dm-calendly-frame {
  width: 100%;
  height: min(700px, calc(100vh - 220px));
  min-height: 520px;
  border-radius: 12px;
  overflow: hidden;
  background: #FAFBFC;
  flex: 1 1 auto;
}

.dm-booking-status {
  text-align: center;
  color: #6B7280;
  font-size: 13px;
  padding: 16px;
  line-height: 1.6;
}

.dm-booking-status.hidden {
  display: none;
}

.dm-form-group {
  margin-bottom: 20px;
}

.dm-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
  margin-bottom: 6px;
}

.dm-form-group input,
.dm-form-group select,
.dm-form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #1E293B;
  background: #FAFBFC;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.dm-form-group input:focus,
.dm-form-group select:focus,
.dm-form-group textarea:focus {
  border-color: #4A8FE2;
  box-shadow: 0 0 0 3px rgba(74, 143, 226, 0.12);
  background: #FFFFFF;
}

.dm-form-group input::placeholder,
.dm-form-group textarea::placeholder {
  color: #B0B7C3;
}

.dm-form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 40px;
  cursor: pointer;
}

.dm-form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.dm-form-error {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  color: #B91C1C;
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.dm-form-error.show {
  display: block;
}

.dm-form-note {
  margin-top: 16px;
  color: #6B7280;
  font-size: 12.5px;
  line-height: 1.6;
}

.dm-form-note a {
  color: #4A8FE2;
  text-decoration: none;
  font-weight: 600;
}

.dm-form-note a:hover {
  text-decoration: underline;
}

.dm-form-success {
  display: none;
  text-align: center;
  padding: 32px 16px;
}

.dm-form-success.show {
  display: block;
}

.dm-check-circle {
  width: 56px;
  height: 56px;
  background: rgba(5, 150, 105, 0.1);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.dm-form-success h3 {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 8px;
}

.dm-form-success p {
  color: #6B7280;
  font-size: 14px;
  line-height: 1.6;
}

.dm-hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 600px) {
  .demo-modal-overlay {
    padding: 12px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .demo-modal {
    padding: 28px 18px;
    margin: auto 0;
    max-height: none;
    width: 100%;
  }

  .demo-modal.demo-modal--booking {
    max-height: none;
  }

  .dm-calendly-frame {
    height: 65vh;
    min-height: 420px;
  }
}
