/* Modal RDV — mobile first, calendrier compact */
.raam-calendly-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.raam-calendly-modal.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.raam-calendly-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  backdrop-filter: blur(2px);
}

.raam-calendly-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(92dvh, 640px);
  background: #f5f0e6;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -8px 40px rgba(26, 26, 26, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.raam-calendly-modal.is-open .raam-calendly-modal__panel {
  transform: translateY(0);
}

.raam-calendly-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
  flex-shrink: 0;
}

.raam-calendly-modal__title {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

.raam-calendly-modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.06);
  color: #1a1a1a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.raam-calendly-modal__close:hover,
.raam-calendly-modal__close:focus-visible {
  background: rgba(233, 84, 32, 0.12);
  color: #e95420;
  outline: none;
}

.raam-calendly-modal__body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.raam-calendly-modal__loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #f5f0e6;
  z-index: 2;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.raam-calendly-modal__loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.raam-calendly-modal__spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(233, 84, 32, 0.2);
  border-top-color: #e95420;
  border-radius: 50%;
  animation: raam-calendly-spin 0.7s linear infinite;
}

.raam-calendly-modal__loader-text {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(26, 26, 26, 0.65);
}

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

.raam-calendly-modal__embed {
  height: clamp(420px, 68dvh, 520px);
  min-height: 420px;
  overflow: hidden;
}

.raam-calendly-modal__embed .calendly-inline-widget,
.raam-calendly-modal__embed iframe {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 420px !important;
  max-height: clamp(420px, 68dvh, 520px) !important;
}

body.raam-calendly-open {
  overflow: hidden;
}

@media (min-width: 480px) {
  .raam-calendly-modal {
    align-items: center;
    padding: 1rem;
  }

  .raam-calendly-modal__panel {
    width: min(100%, 420px);
    max-height: min(88dvh, 600px);
    border-radius: 1rem;
    transform: translateY(12px) scale(0.98);
  }

  .raam-calendly-modal.is-open .raam-calendly-modal__panel {
    transform: translateY(0) scale(1);
  }
}
