/* Универсальная модалка сообщений / записи */

.gf-msg-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.gf-msg-modal[hidden] {
  display: none;
}

@media (min-width: 640px) {
  .gf-msg-modal {
    align-items: center;
    padding: 1.25rem;
  }
}

.gf-msg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(6px);
}

.gf-msg-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  max-height: min(92svh, 38rem);
  margin: 0;
  border-radius: 1rem 1rem 0 0;
  border: 1px solid var(--gf-line, #2c333c);
  background:
    linear-gradient(165deg, rgba(77, 182, 165, 0.08), transparent 40%),
    var(--gf-surface, #1a1f26);
  box-shadow: var(--gf-shadow-soft, 0 18px 50px rgba(0, 0, 0, 0.28));
  color: var(--gf-ink-soft, #dfe3e8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .gf-msg-modal__dialog {
    width: min(100%, 36rem);
    border-radius: var(--gf-radius, 10px);
  }
}

.gf-msg-modal__scroll {
  overflow: auto;
  max-height: inherit;
  padding: 1.15rem 1.35rem 1.15rem 1.2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 208, 191, 0.38) transparent;
}

.gf-msg-modal__scroll::-webkit-scrollbar {
  width: 5px;
}

.gf-msg-modal__scroll::-webkit-scrollbar-track {
  margin: 0.75rem 0;
  background: transparent;
}

.gf-msg-modal__scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(111, 208, 191, 0.3);
  border: 1px solid transparent;
  background-clip: content-box;
}

.gf-msg-modal__scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 208, 191, 0.55);
  background-clip: content-box;
}

@media (min-width: 640px) {
  .gf-msg-modal__scroll {
    padding: 1.35rem 1.7rem 1.35rem 1.5rem;
  }
}

.gf-msg-modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(210, 220, 228, 0.55);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.gf-msg-modal__close:hover,
.gf-msg-modal__close:focus-visible {
  color: rgba(232, 244, 240, 0.95);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.gf-msg-modal__title {
  margin: 0 1.6rem 0.3rem 0;
  font-family: var(--gf-font-display, Manrope, sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--gf-ink, #e8eaed);
}

.gf-msg-modal__lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--gf-muted, #9aa3ad);
}

.gf-msg-modal__context {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--gf-radius-sm, 8px);
  border: 1px solid rgba(77, 182, 165, 0.28);
  background: var(--gf-accent-soft, rgba(77, 182, 165, 0.16));
  color: var(--gf-ink-soft, #dfe3e8);
  font-size: 0.82rem;
  line-height: 1.35;
}

.gf-msg-modal__form.gf-form {
  margin-top: 0;
  max-width: none;
  gap: 0.65rem;
}

.gf-msg-modal__form .gf-form__field {
  gap: 0.22rem;
}

.gf-msg-modal__form .gf-form__field label {
  font-size: 0.82rem;
}

.gf-msg-modal__req {
  color: var(--gf-accent, #4db6a5);
  font-weight: 600;
}

.gf-msg-modal__form .gf-form__field input,
.gf-msg-modal__form .gf-form__field textarea {
  padding: 0.5rem 0.7rem;
  font-size: 0.92rem;
  line-height: 1.35;
  background: var(--gf-bg-elevated, #161a20);
}

.gf-msg-modal__form .gf-form__field textarea {
  min-height: 6.25rem;
  resize: vertical;
}

.gf-msg-modal__consent {
  align-items: center;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  line-height: 1.4;
  gap: 0.5rem;
}

.gf-msg-modal__consent input {
  margin-top: 0;
  align-self: center;
}

.gf-msg-modal__consent a {
  color: var(--gf-accent-strong, #6fd0bf);
}

.gf-msg-modal__actions {
  display: flex;
  justify-content: stretch;
  margin-top: 0.15rem;
}

.gf-msg-modal__submit {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
}

.gf-msg-modal__form .gf-form__status {
  font-size: 0.82rem;
  margin: 0;
}

/* ——— Sending / success iris ——— */

.gf-msg-modal__sending,
.gf-msg-modal__success {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 1.1rem 0 0.35rem;
}

.gf-msg-modal__sending[hidden],
.gf-msg-modal__success[hidden],
.gf-msg-modal__stage[hidden] {
  display: none;
}

.gf-msg-modal__iris {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
}

.gf-msg-modal__iris-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gf-msg-modal__iris-ring {
  fill: none;
  stroke: rgba(143, 221, 208, 0.55);
  stroke-width: 1.6;
}

.gf-msg-modal__iris-hole {
  fill: none;
}

.gf-msg-modal__iris-blades path,
[data-message-modal-iris-blades] path {
  fill: none !important;
  stroke: rgba(111, 208, 191, 0.95);
  stroke-width: 1.25;
  stroke-linejoin: round;
}

.gf-msg-modal__send-line {
  position: relative;
  width: min(100%, 11.5rem);
  height: 2px;
  margin: 0 auto 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.gf-msg-modal__send-line-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(77, 182, 165, 0.15),
    rgba(111, 208, 191, 0.95) 45%,
    rgba(160, 230, 215, 1)
  );
  box-shadow: 0 0 10px rgba(111, 208, 191, 0.45);
}

.gf-msg-modal__send-line.is-sending .gf-msg-modal__send-line-fill {
  transition: none;
}

.gf-msg-modal__send-line.is-done .gf-msg-modal__send-line-fill {
  width: 100%;
  transition: width 0.45s var(--gf-ease, cubic-bezier(0.22, 1, 0.36, 1));
  box-shadow: 0 0 14px rgba(111, 208, 191, 0.65);
}

.gf-msg-modal__sending-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--gf-muted, #9aa3ad);
}

.gf-msg-modal__check {
  color: rgba(160, 230, 215, 0.95);
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  opacity: 0;
}

.gf-msg-modal__check.is-drawn {
  opacity: 1;
  animation: gf-msg-check 0.55s 0.1s var(--gf-ease, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
}

.gf-msg-modal__success-title {
  margin: 0 0 0.35rem;
  animation: gf-msg-rise 0.45s 0.08s both;
}

.gf-msg-modal__success-lead {
  max-width: 22rem;
  margin-bottom: 1rem;
  animation: gf-msg-rise 0.45s 0.18s both;
}

.gf-msg-modal__success .gf-msg-modal__actions {
  width: min(100%, 12rem);
  margin-top: 0.15rem;
  animation: gf-msg-rise 0.45s 0.28s both;
}

@keyframes gf-msg-check {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes gf-msg-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.gf-msg-modal-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .gf-msg-modal__check.is-drawn,
  .gf-msg-modal__success-title,
  .gf-msg-modal__success-lead,
  .gf-msg-modal__success .gf-msg-modal__actions,
  .gf-msg-modal__send-line.is-done .gf-msg-modal__send-line-fill {
    animation: none !important;
    transition: none !important;
  }

  .gf-msg-modal__check.is-drawn {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}
