/* Comment modal (Figma) — клон consultation-modal.css під відгуки. */
#getCommentV2.comment-modal-root.modal {
  --comment-bg: #212121;
  --comment-accent: #fcba1d;
  --comment-text: #ffffff;
  --comment-muted: rgba(255, 255, 255, 0.5);
  --comment-field-bg: #353535;
}

#getCommentV2.comment-modal-root .comment-modal-dialog {
  max-width: 440px;
}

@media (min-width: 1600px) {
  #getCommentV2.comment-modal-root .comment-modal-dialog {
    max-width: 548px;
  }
}

#getCommentV2.comment-modal-root .modal-content {
  overflow: visible;
}

#getCommentV2.comment-modal-root .comment-modal button:not(.comment-modal__submit) {
  margin: 0;
}

#getCommentV2.comment-modal-root .comment-modal input:not([type="checkbox"]):focus,
#getCommentV2.comment-modal-root .comment-modal input:not([type="checkbox"]):focus-visible,
#getCommentV2.comment-modal-root .comment-modal textarea:focus,
#getCommentV2.comment-modal-root .comment-modal textarea:focus-visible,
#getCommentV2.comment-modal-root .comment-modal .intl-tel-input input:focus,
#getCommentV2.comment-modal-root .comment-modal .intl-tel-input input:focus-visible,
#getCommentV2.comment-modal-root .comment-modal .intl-tel-input .selected-flag:focus,
#getCommentV2.comment-modal-root .comment-modal .intl-tel-input .selected-flag:focus-visible {
  outline: none;
  box-shadow: none;
}

.comment-modal {
  position: relative;
  background: var(--comment-bg);
  color: var(--comment-text);
  border-radius: 20px;
  font-family: "Mabry Pro", sans-serif;
  padding: 30px 30px 35px;
}

@media (min-width: 1600px) {
  .comment-modal {
    padding: 50px 30px 42px;
  }
}

.comment-modal__close {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  rotate: 45deg;
  opacity: 1;
}

.comment-modal__close:hover,
.comment-modal__close:focus {
  opacity: 0.75;
}

.comment-modal__title {
  margin: 0 0 21px;
  text-transform: uppercase;
  text-align: center;
  font-weight: 500;
  line-height: 1;
}

.comment-modal__title-main,
.comment-modal__title-accent {
  display: block;
  font-size: 28px;
}

.comment-modal__title-main {
  color: var(--comment-text);
}

.comment-modal__title-accent {
  color: var(--comment-accent);
}

@media (min-width: 1600px) {
  .comment-modal__title {
    margin-bottom: 22px;
  }
}

.comment-modal__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 1600px) {
  .comment-modal__title {
    margin-bottom: 28px;
  }

  .comment-modal__title-main,
  .comment-modal__title-accent {
    max-width: max-content;
    display: inline;
  }

  .comment-modal__form {
    gap: 22px;
    max-width: 423px;
    margin: 0 auto;
  }
}

.comment-modal__cf7-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.comment-modal__field,
.comment-modal__field label,
.comment-modal__field input,
.comment-modal__field textarea {
  width: 100%;
}

.comment-modal__field input,
.comment-modal__field textarea,
.comment-modal__field--phone {
  border: 0;
  border-radius: 10px;
  background: var(--comment-field-bg);
  color: var(--comment-text);
  font-size: 14px;
  font-weight: 300;
  line-height: 27px;
}

.comment-modal__field input {
  height: 60px;
  padding: 0 18px;
}

.comment-modal__field input::placeholder,
.comment-modal__field textarea::placeholder {
  color: var(--comment-muted);
}

/* Textarea «Ваш відгук» */
.comment-modal__field--textarea {
  display: block;
}

.comment-modal__field--textarea textarea {
  display: block;
  width: 100%;
  min-height: 100px;
  padding: 16px 18px;
  font-family: inherit;
  resize: vertical;
}

.comment-modal__field--phone {
  display: block;
  overflow: visible;
  padding: 0;
  position: relative;
  min-width: 0;
  height: 60px;
}

.comment-modal__field--phone .intl-tel-input {
  width: 100%;
  display: block;
  position: relative;
  border: 0;
  border-radius: 10px;
  overflow: visible;
  background: transparent;
  height: 100%;
}

.comment-modal__field--phone .flag-container {
  background: transparent;
  height: 100%;
  border-radius: 0;
  padding: 0;
  z-index: 5;
}

/* На всю ширину поля: country-list всередині flag-container, тож тягнемо контейнер; кліки лишаються на прапорі та інпуті */
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input.allow-dropdown .flag-container {
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  pointer-events: none;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input.allow-dropdown .selected-flag {
  pointer-events: auto;
}

/* Плагін: hover і separate-dial-code змінюють фон — лишаємо #353535 як у макеті */
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .selected-flag {
  background: var(--comment-field-bg) !important;
  background-color: var(--comment-field-bg) !important;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input.allow-dropdown .flag-container:hover .selected-flag {
  background: var(--comment-field-bg) !important;
  background-color: var(--comment-field-bg) !important;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input.separate-dial-code .selected-flag {
  background: var(--comment-field-bg) !important;
  background-color: var(--comment-field-bg) !important;
}

.comment-modal__field--phone .selected-flag {
  background: var(--comment-field-bg);
  border-radius: 10px 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 85px;
  padding: 0 8px 0 11px !important;
  height: 100%;
  cursor: pointer;
  font-size: 14px;
  font-weight: 300;
  line-height: 27px;
}

.comment-modal__field--phone .iti-flag.ua {
  position: relative;
  width: 18px;
  height: 12px;
  display: inline-block;
  background: linear-gradient(to bottom, #338af3 0 50%, #fcba1d 50% 100%);
}

.comment-modal__field--phone .intl-tel-input input,
.comment-modal__field--phone .intl-tel-input input[type="tel"],
.comment-modal__field--phone .intl-tel-input input[type="text"] {
  position: relative;
  z-index: 1;
  height: 60px;
  border: 0;
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.2;
  background: transparent;
  color: var(--comment-text);
}

.comment-modal__field--phone .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 input,
.comment-modal__field--phone .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 input[type="text"],
.comment-modal__field--phone .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 input[type="tel"] {
  padding-left: 100px;
}

.comment-modal__field--phone .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 input,
.comment-modal__field--phone .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 input[type="text"],
.comment-modal__field--phone .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 input[type="tel"] {
  padding-left: 95px;
}

.comment-modal__field--phone .selected-dial-code {
  color: var(--comment-text);
  font-size: 14px;
  line-height: 14px;
  padding-left: 24px;
}

/* Специфічність вища за intlTelInput.css (.intl-tel-input .selected-flag .iti-arrow) */
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .selected-flag .iti-arrow {
  width: 7px;
  height: 4px;
  border: 0 !important;
  margin-top: -2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 7px 4px;
  background-image: url("data:image/svg+xml,%3Csvg width='7' height='4' viewBox='0 0 7 4' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.5 0.5L3.5 3.5L6.5 0.5' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform 0.15s ease;
  transform: rotate(0deg);
}

/* Плагін шукає .iti-arrow всередині .iti-flag (помилка DOM) — клас .up ніколи не ставиться */
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input:has(.country-list:not(.hide)) .selected-flag .iti-arrow {
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  transform: rotate(180deg);
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .selected-flag .iti-arrow.up {
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  transform: rotate(180deg);
}

/* Список країн intl-tel-input */
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list {
  box-sizing: border-box;
  left: 0 !important;
  right: 0;
  width: 100% !important;
  min-width: 100%;
  margin: 5px 0 0 !important;
  padding: 0;
  list-style: none;
  background: #ffffff !important;
  color: #212121;
  border: 1px solid #ffffff !important;
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  max-height: min(280px, 50vh) !important;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10000;
  white-space: normal;
  pointer-events: auto;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list.dropup {
  margin-top: 0 !important;
  margin-bottom: 5px !important;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list .divider {
  padding: 0;
  margin: 0;
  min-height: 0;
  list-style: none;
  border-bottom: 1px solid #f0f0f0;
  pointer-events: none;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list .country {
  box-sizing: border-box;
  padding: 11px 18px !important;
  min-height: 50px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  line-height: 27px;
  color: #212121;
  background: #ffffff !important;
  cursor: pointer;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list .country .flag-box,
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list .country .country-name {
  margin-right: 0;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list .country .dial-code {
  color: rgba(33, 33, 33, 0.55);
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list .country.highlight,
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list .country:hover {
  background: #f0f0f0 !important;
}

/* Скролбар як у .team-modal-body */
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list {
  --comment-modal-scrollbar-thumb-max-height: 60px;
}

@supports not selector(::-webkit-scrollbar) {
  #getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list {
    scrollbar-width: thin;
    scrollbar-color: #212121 transparent;
  }
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list::-webkit-scrollbar {
  width: 4px;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list::-webkit-scrollbar-button {
  display: none;
  height: 0;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list::-webkit-scrollbar-track {
  background: transparent;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list::-webkit-scrollbar-thumb {
  background: #212121;
  border-radius: 3px;
  max-height: var(--comment-modal-scrollbar-thumb-max-height);
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list::-webkit-scrollbar-thumb:hover,
#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list::-webkit-scrollbar-thumb:active {
  background: #212121;
}

#getCommentV2.comment-modal-root .comment-modal__field--phone .intl-tel-input .country-list::-webkit-scrollbar-corner {
  background: transparent;
}

.comment-modal__field--phone input::placeholder {
  color: var(--comment-muted);
}

.comment-modal__submit {
  margin: 8px auto 0;
  min-height: 39px;
  border: 0;
  border-radius: 37px;
  background: var(--comment-accent);
  color: #212121;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 17px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  margin: 10px auto 0 !important;
}

.comment-modal__submit img {
  width: 17px;
  height: 8px;
}

.comment-modal__submit:hover,
.comment-modal__submit:focus {
  filter: brightness(1.05);
}

@media (min-width: 1600px) {
  .comment-modal__field input,
  .comment-modal__field--phone {
    width: 420px;
  }

  .comment-modal__field--textarea textarea {
    width: 420px;
    min-height: 120px;
  }

  .comment-modal__submit {
    min-height: 49px;
    font-size: 22px;
    line-height: normal;
    padding: 11px 33px;
  }

  .comment-modal__submit img {
    width: 25px;
    height: 11px;
  }
}

/* Мобільна версія: <576px (як Bootstrap sm) */
@media (max-width: 575.98px) {
  #getCommentV2.comment-modal-root .comment-modal-dialog {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  #getCommentV2.comment-modal-root .comment-modal-dialog .modal-content {
    height: 100%;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
  }

  #getCommentV2.comment-modal-root .comment-modal-dialog .modal-body {
    padding: 0;
    overflow: auto;
    max-height: 100svh;
    overflow: hidden;
  }

  .comment-modal {
    border-radius: 0;
    min-height: 100svh;
    padding: 62px 20px 32px;
    box-sizing: border-box;
  }

  .comment-modal__title {
    margin-bottom: 31px;
  }

  .comment-modal__form {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    gap: 15px;
  }
}

/* Як TY (#thankYouModalV2): вузький екран + достатня висота — маски та контент по центру */
@media (max-width: 499.98px) and (min-height: 701px) {
  #getCommentV2.comment-modal-root .comment-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 113px !important;
    padding-bottom: 32px;
    min-height: 100svh;
    background-color: var(--comment-bg);
    background-image: url("./images/thank-you/Mask_group-1.svg"), url("./images/thank-you/Mask_group.svg");
    background-repeat: no-repeat, no-repeat;
    background-position: top center, bottom center;
    background-size: 100% auto, 100% auto;
  }

  #getCommentV2.comment-modal-root .comment-modal__title {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }

  #getCommentV2.comment-modal-root .comment-modal__form {
    width: 100%;
    max-width: 100%;
  }
}

/* Як у thank-you-modal: прибираємо пробивання скролу фону на мобайлі */
#getCommentV2.comment-modal-root.modal.show {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Підказка при помилці валідації (трясеться) */
@keyframes comment-modal-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  12% {
    transform: translateX(-8px);
  }
  24% {
    transform: translateX(8px);
  }
  36% {
    transform: translateX(-5px);
  }
  48% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  72% {
    transform: translateX(3px);
  }
}

.comment-modal__shake {
  animation: comment-modal-shake 0.5s ease;
}

@keyframes comment-modal-shake-outline {
  0%,
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    box-shadow: 0 0 0 3px rgba(252, 186, 29, 0.55);
  }
}

.comment-modal__shake-reduced {
  animation: comment-modal-shake-outline 0.45s ease;
  border-radius: 12px;
}
