body.smd-appointment-open {
  overflow: hidden;
}

.appointment-modal[hidden],
.appointment-modal__form[hidden],
.appointment-modal__success[hidden] {
  display: none;
}

.appointment-modal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: Manrope, sans-serif;
}

.appointment-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: appointment-backdrop-in 0.22s ease both;
}

.appointment-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 30px 40px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(15, 35, 52, 0.22);
  color: #1a2332;
  animation: appointment-dialog-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.appointment-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #1a2332;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.appointment-modal__close:hover,
.appointment-modal__close:focus-visible {
  background: var(--smd-primary-soft);
  color: var(--smd-primary);
}

.appointment-modal__head {
  margin-bottom: 20px;
  text-align: center;
}

.appointment-modal__logo {
  display: block;
  width: auto;
  max-width: 250px;
  height: 58px;
  margin: 0 auto 16px;
  object-fit: contain;
}

.appointment-modal__title {
  margin: 0;
  color: #1a2332;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.appointment-modal__subtitle {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

.appointment-modal__form {
  display: grid;
  margin: 0;
}

.appointment-modal__field {
  position: relative;
  display: block;
  margin-bottom: 12px;
}

.appointment-modal__field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.appointment-modal__field input,
.appointment-modal__field textarea {
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #d8e5ee;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: #1a2332;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.appointment-modal__field input {
  height: 46px;
}

.appointment-modal__field textarea {
  min-height: 68px;
  padding-top: 11px;
  resize: vertical;
}

.appointment-modal__field input::placeholder,
.appointment-modal__field textarea::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.appointment-modal__field input:focus,
.appointment-modal__field textarea:focus {
  border-color: var(--smd-primary);
  box-shadow: 0 1px 0 var(--smd-primary);
}

.appointment-modal__field input:invalid:not(:placeholder-shown),
.appointment-modal__consent input:invalid {
  accent-color: #e5484d;
}

.appointment-modal__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 18px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.appointment-modal__consent input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: #25d366;
}

.appointment-modal__consent a {
  color: var(--smd-primary);
  font-weight: 700;
}

.appointment-modal__submit,
.appointment-modal__success button {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: #25d366;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--smd-brand-brown) 28%, transparent);
}

.appointment-modal__submit:hover,
.appointment-modal__success button:hover {
  background: var(--smd-brand-brown-hover);
  transform: translateY(-1px);
}

.appointment-modal__submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.appointment-modal__status {
  min-height: 18px;
  margin-top: 9px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.appointment-modal__status.is-error {
  color: #c53030;
}

.appointment-modal__success {
  padding: 10px 0 4px;
  text-align: center;
}

.appointment-modal__success-icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--smd-brand-brown) 28%, transparent);
}

.appointment-modal__success-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.appointment-modal__success h3 {
  margin: 0 0 10px;
  color: #1a2332;
  font-size: 22px;
  font-weight: 800;
}

.appointment-modal__success p {
  margin: 0 0 22px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.55;
}

.appointment-modal__website {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  .appointment-modal {
    align-items: center;
    padding: 8px;
  }

  .appointment-modal__dialog {
    width: min(360px, 100%);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 18px 18px 14px;
    border-radius: 18px;
  }

  .appointment-modal__close {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .appointment-modal__head {
    margin-bottom: 10px;
  }

  .appointment-modal__logo {
    max-width: 195px;
    height: 38px;
    margin-bottom: 8px;
  }

  .appointment-modal__title {
    font-size: 18px;
    letter-spacing: .035em;
  }

  .appointment-modal__subtitle {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.35;
  }

  .appointment-modal__field {
    margin-bottom: 7px;
  }

  .appointment-modal__field input {
    height: 38px;
    font-size: 14px;
  }

  .appointment-modal__field textarea {
    min-height: 46px;
    padding-top: 7px;
    font-size: 14px;
  }

  .appointment-modal__consent {
    gap: 8px;
    margin: 2px 0 10px;
    font-size: 10.5px;
    line-height: 1.35;
  }

  .appointment-modal__consent input {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .appointment-modal__submit,
  .appointment-modal__success button {
    min-height: 43px;
    padding: 9px 14px;
    font-size: 12px;
  }

  .appointment-modal__status {
    min-height: 14px;
    margin-top: 5px;
    font-size: 10.5px;
  }
}

@media (max-width: 768px) and (max-height: 680px) {
  .appointment-modal__subtitle,
  .appointment-modal__field--textarea {
    display: none;
  }
}

@keyframes appointment-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes appointment-dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
