/* ==========================================================================
   Schedule a call — modal (Figma 73:504 / 78:47279, mobile 139:1839 / 140:2139)
   Native <dialog>: the browser handles Esc, focus trapping and the backdrop.
   Behaviour: js/schedule-call.js
   ========================================================================== */

.call-modal {
  width: min(600px, 100% - 32px);
  max-width: none;                /* the UA default (100% - 6px - 2em) would shrink it */
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--color-white);
  box-shadow: var(--shadow-dropdown);
  color: var(--color-text-main);
  overflow: auto;
}

.call-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.call-modal[open] {
  animation: call-modal-in 0.25s ease-out;
}

.call-modal[open]::backdrop {
  animation: call-modal-fade 0.25s ease-out;
}

@keyframes call-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
}

@keyframes call-modal-fade {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .call-modal[open],
  .call-modal[open]::backdrop {
    animation: none;
  }
}

/* ---- Header ---- */

.call-modal__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--color-stroke-soft);
}

.call-modal__icon {
  flex-shrink: 0;
  display: flex;
  padding: 10px;
  border: 1px solid var(--color-stroke-soft);
  border-radius: var(--radius-pill);
}

.call-modal__icon img {
  width: 24px;
  height: 24px;
}

.call-modal__heading {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-right: 24px;            /* keep clear of the close button */
}

.call-modal__title {
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  font-weight: var(--fw-medium);
  letter-spacing: -0.176px;
}

.call-modal__text {
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  letter-spacing: -0.084px;
  color: var(--color-text-sub);
}

.call-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.call-modal__close:hover {
  background: var(--color-zinc-100);
}

.call-modal__close img {
  width: 20px;
  height: 20px;
}

/* ---- Body ---- */

.call-modal__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
}

.call-modal__inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.call-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.call-field__label {
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  font-weight: var(--fw-medium);
  letter-spacing: -0.084px;
}

/* the white 40px box around every field */
.call-field__control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--color-stroke-soft);
  border-radius: 10px;
  background: var(--color-white);
  box-shadow: var(--shadow-input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.call-field__control:focus-within {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(79, 54, 234, 0.15);
  outline: none;
}

.call-field__icon,
.call-field__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.call-field__input {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  letter-spacing: -0.084px;
  color: var(--color-text-main);
  appearance: none;
  outline: none;
}

/* the whole date box opens the native picker; its own icon stays hidden */
.call-field__input[type="date"] {
  position: static;
}

.call-field__input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0;
  cursor: pointer;
}

select.call-field__input {
  cursor: pointer;
}

/* ---- "How long do you need?" — single choice, drawn as Figma's square boxes ---- */

.call-duration {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.call-duration__label {
  padding: 0;
  margin-bottom: 12px;
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  font-weight: var(--fw-medium);
  color: var(--color-zinc-800);
}

.call-duration__options {
  display: flex;
  gap: 12px;
}

.call-duration__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  cursor: pointer;
}

.call-duration__option input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 2px solid var(--color-zinc-300);
  border-radius: 0;
  background: var(--color-white);
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.call-duration__option input:checked {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  box-shadow: inset 0 0 0 2px var(--color-white);
}

.call-duration__option input:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* ---- Step 2: chosen date, editable ---- */

.call-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--color-zinc-100);
}

.call-summary__text {
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  font-weight: var(--fw-medium);
  color: var(--color-zinc-800);
}

.call-summary__edit {
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.call-summary__edit img {
  width: 20px;
  height: 20px;
}

/* ---- Footer ---- */

.call-modal__foot {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--color-stroke-soft);
}

.call-modal__foot .btn {
  flex: 1 1 0;
  font-weight: var(--fw-regular);
}

/* thank-you step: no body, so no divider above the button */
.call-modal__step[data-step="3"] .call-modal__foot {
  border-top: 0;
}
