.modal {
  width: min(832px, calc(100% - 24px));
  border: none;
  padding: 0;
  background: transparent;
}

#modal-letter {
  overflow: visible;
}

.modal::backdrop {
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
}

dialog.modal[open]:modal {
  position: fixed;
  left: 50%;
  top: 60px;
  transform: translate(-50%, 0);
  margin: 0;
}

/* VIP modal: top-right aligned */
#modal-vip[open]:modal {
  left: auto;
  right: 54px;
  top: 54px;
  transform: none;
  width: 100%;
  max-width: 592px;
}

dialog.modal[open]:not(:modal) {
  position: fixed;
  inset: 0;
  width: auto;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 60px 12px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  z-index: 100;
}

#modal-vip[open]:not(:modal) {
  justify-content: flex-end;
  padding-top: 54px;
  padding-right: 54px;
}

dialog.modal[open]:not(:modal) .modal__panel {
  max-height: calc(100vh - 24px);
  overflow: auto;
}

html.is-scroll-locked,
body.is-scroll-locked {
  overflow: hidden;
}

.modal__panel {
  border-radius: 56px;
  background: #150C2C;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 40px 140px rgba(0, 0, 0, .55);
  position: relative;
}

.modal__close {
  position: absolute;
  right: 40px;
  top: 40px;
  width: 18px;
  height: 18px;
  border-radius: 0;
  border: none;
  background: transparent;
}

.modal__close::before,
.modal__close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  background: #AD6CFB;
  transform-origin: center;
}

.modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg)
}

.modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg)
}

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.field--full {
  grid-column: 1 / -1
}

.field__label {
  font-size: 13px;
  color: var(--muted)
}

.input {
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(21, 12, 44, .42);
  padding: 0 25px;
  outline: none;
}

.modal .input {
  height: 58px;
  background-color: rgba(0, 0, 0, .3);
  box-shadow: inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1);
  width: 100%;
}

.modal .input::placeholder {
  color: #fff;
}

.textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  min-height: 140px;
}

.input:focus {
  border-color: rgba(173, 108, 251, .55);
  box-shadow: 0 0 0 6px rgba(173, 108, 251, .14);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  user-select: none;
}

.check__box {
  margin-top: 4px
}

.check__text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35
}

/* VIP modal content */

.vip-modal {
  width: min(592px, calc(100% - 24px));
  padding: 44px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
}

.vip-modal--details {
  width: 100%;
}

.vip-modal--details {
  background-image: url(../img/modal_details_bg.png);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: none;
}

.vip-modal--details .modal__close::before,
.vip-modal--details .modal__close::after {
  background: #fff;
}

.vip-modal--details .vip-info__lead,
.vip-modal--details .vip-info__text {
  max-width: 389px;
  margin: 0 auto;
  letter-spacing: -0.01em;
}

.vip-modal__content {
  display: flex;
  flex-direction: column;
  gap: 29px;
}

.vip-modal__title {
  margin: 0;
  text-align: center;
  font-size: 40px;
  line-height: 84%;
}

.vip-modal__title-main {
  display: block;
  font-weight: 700;
}

.vip-modal__title-italic {
  display: block;
  font-family: "Cormorant Infant", serif;
  font-style: italic;
  font-size: 28px;
}

.vip-modal__text {
  margin: 0 0 16px 0;
  text-align: center;
  color: var(--muted);
}

.vip-modal__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 348px;
  margin: 0 auto;
}

.vip-modal__field {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.vip-modal__icon {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  background: radial-gradient(53.98% 100% at 50% 100%, #DFC5FF 0%, #AD6CFB 35.1%, #6B32FC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vip-modal__actions {
  display: flex;
  justify-content: center;
  width: 100%;
}

.vip-modal__actions .btn {
  max-width: 240px;
  width: 100%;
}

.vip-modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.vip-modal__success[hidden],
.vip-modal__content[hidden] {
  display: none;
}

.vip-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.vip-info__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
}

.vip-info__title-main {
  display: block;
  font-weight: 700;
}

.vip-info__title-sub {
  display: block;
  font-family: "Cormorant Infant", serif;
  font-style: italic;
  font-size: 28px;
}

.vip-info__lead {
  margin: 0;
  font-size: 16px;
}

.vip-info__text {
  margin: 0;
  color: var(--muted);
}

.vip-info__subtitle {
  margin: 0;
  font-weight: 400;
}

.vip-info__prices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.vip-info__price-card {
  min-width: 220px;
  padding: 18px 24px;
  border-radius: 10px;
  background: #150C2C;
  box-shadow: inset 0px 0px 8.8px rgba(255, 255, 255, .05), inset 0px 0px 8.8px rgba(255, 255, 255, .05), inset 0px 0px 8.8px rgba(255, 255, 255, .05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.vip-info__price-label {
  font-size: 16px;
  line-height: 96%;
  color: #fff;
  max-width: 126px;
}

.vip-info__price-value {
  margin-top: 4px;
  font-size: 40px;
  font-weight: 700;
}

.vip-info__footer {
  margin: 8px auto 0;
  color: #fff;
  max-width: 423px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

/* Letter wizard */

.modal-letter__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.modal-letter__success-title {
  margin: 0;
  text-align: center;
  font-size: 24px;
  line-height: 110%;
  margin-bottom: 24px;
}

.modal-letter__success-title-main {
  display: block;
  font-weight: 700;
}

.modal-letter__success-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}

.modal-letter__success-actions .btn {
  max-width: 240px;
  width: 100%;
}

.modal-letter__step {
  border-radius: 56px;
  display: block;
  padding: 24px;
  box-shadow: inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1);
}

.modal-letter__step[data-letter-step="2"] {
  background-image: url(../img/step2bg_mask.png);
}

.modal-letter__step[hidden] {
  display: none;
}

.modal-letter__channels {
  padding: 0 55px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.modal-letter__channel {
  border-radius: 35px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: #150C2C;
  box-shadow: inset 0px 0px 8.8px rgb(255 255 255 / 11%), inset 0px 0px 8.8px rgb(255 255 255 / 11%), inset 0px 0px 8.8px rgb(255 255 255 / 11%);
  padding: 49px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 43px;
}

.modal-letter__channel-icon {
  width: 124px;
  height: 124px;
}

.modal-letter__channel-title {
  font-weight: 500;
}

.modal-letter__form {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 19px;
  padding: 0 70px;
}

.date-form {
  padding: 0 190px;
}

.date-form,
.date-form input {
  text-align: center;
}

.modal-letter__attachments {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 36px;
}

.modal-letter__attachments .btn {
  padding: 0;
  display: flex;
  gap: 19px;
  border: none;
  outline: none;
  box-shadow: none;
}

.modal-letter__attachments .btn .icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, .3);
}

.modal-letter__attachments .btn:hover .icon {
  box-shadow: inset 0 0 15px rgba(255, 255, 255, .25);
}

[name="delivery_date"] {
  max-width: 200px;
  margin: 0 auto;
}

.flatpickr-wrapper {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.fp-head {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 25px;
}

.fp-head select.fp-select {
  background: #150C2C;
  box-shadow: inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 14px 37px 14px 17px;
}

.fp-head .fp-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none !important;
  padding-right: 70px;
}

.fp-head .fp-select::-ms-expand {
  display: none;
}

.fp-head .fp-select-wrap {
  position: relative;
}

.fp-head .fp-select-wrap::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 7px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='11' height='7' viewBox='0 0 11 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.82571 0H1.17429C0.128912 0 -0.391777 1.32393 0.345194 2.10147L4.67092 6.64065C5.12752 7.11978 5.87248 7.11978 6.32908 6.64065L10.6548 2.10147C11.3918 1.32813 10.8711 0 9.82571 0Z' fill='white'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
  display: none !important;
}

.flatpickr-innerContainer {
  justify-content: center;
}

.flatpickr-calendar {
  background: linear-gradient(rgb(13 11 59 / 35%), rgb(13 11 59 / 35%)) padding-box, linear-gradient(to bottom right, rgba(255, 255, 255, 0.15) 0%, rgb(13 11 59 / 50%) 30%, rgb(13 11 59 / 35%) 70%, rgba(255, 255, 255, 0.15) 100%) border-box !important;
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, .1) !important;
  box-shadow: none !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  border-radius: 35px !important;
  padding: 17px 39px 32px !important;
  min-width: 444px;
  top: calc(100% + 18px) !important;
}

.flatpickr-weekdays {
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #362D4D;
}

.flatpickr-current-month {
  color: #fff !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #362D4D !important;
}

.flatpickr-day:not(.prevMonthDay):not(.nextMonthDay) {
  color: #fff !important;
}

span.flatpickr-weekday {
  color: #362D4D !important;
}

.flatpickr-day.today,
.flatpickr-day:hover {
  background: radial-gradient(53.98% 100% at 50% 100%, #DFC5FF 0%, #AD6CFB 35.1%, #6B32FC 100%) !important;
}

.modal-letter__footer {
  margin-top: 15px;
  display: flex;
  justify-content: center;
}

.modal-letter__hint {
  margin-top: 4px;
}

.modal-letter__contacts {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-letter__contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-letter__contact-row input {
  width: 100%;
  height: 58px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, .3);
  box-shadow: inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1);
}

.modal-letter__contact-row .icon,
.vip-modal__fields .icon {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, .3);
  box-shadow: inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1), inset 0px 0px 8.8px rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-letter-contact {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  padding: 0;
  background-color: transparent;
  border: none;
}

[data-contact-add] {
  background-image: url("data:image/svg+xml,%3Csvg width='23' height='23' viewBox='0 0 23 23' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.7279 9.89952L22.6274 9.89951L22.6274 12.7279L12.7279 12.7279L12.7279 22.6274L9.89952 22.6274L9.89945 12.7279L1.13249e-05 12.7279L0 9.8995L9.89946 9.89953L9.8995 0L12.7279 1.31129e-06L12.7279 9.89952Z' fill='%23AD6CFB'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

[data-contact-remove] {
  background-image: url("data:image/svg+xml,%3Csvg width='22' height='3' viewBox='0 0 22 3' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='22' height='3' fill='%23AD6CFB'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.modal-letter__status {
  margin-top: 10px;
}

@media (max-width: 640px) {
  .modal-letter__channels {
    grid-template-columns: minmax(0, 1fr);
    padding: 30px 0;
  }

  .modal-letter__channel {
    padding: 32px 32px 42px;
  }

  dialog.modal[open]:modal {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    min-width: 100%;
    transform: translate(0, 0);
    padding: 49px 20px;
    overflow: hidden auto;
  }

  .modal__panel {
    width: 100%;
  }

  .modal-letter__form {
    padding: 38px 6px 0;
  }
}