/* ==========================================================================
   Modal de recado para o casal — compartilhado (landing + /obrigado)
   ========================================================================== */

body.msg-locked {
  overflow: hidden;
}

.msg-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  background: transparent;
}

.msg-modal[open] {
  display: grid;
  place-items: center;
}

.msg-modal::backdrop {
  background: rgba(40, 47, 40, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.msg-modal__panel {
  width: min(100%, 560px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: clamp(1.3rem, 3vw, 2rem);
  background: var(--cream, #fbf9f4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  box-shadow: 0 40px 80px -48px rgba(44, 50, 44, 0.35);
  animation: msgIn 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  overscroll-behavior: contain;
}

.msg-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.msg-modal__title {
  margin-top: 0.35rem;
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink, #2c322c);
}

.msg-modal__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--ink-2, #4a524a);
  background: transparent;
  border: 1px solid var(--line, #e5e0d4);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}

.msg-modal__close:hover {
  background: var(--paper, #fff);
  border-color: var(--sage-300, #c8d9c2);
}

.msg-modal__close svg {
  width: 16px;
  height: 16px;
}

.msg-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.msg-form[hidden] {
  display: none;
}

.msg-form__intro {
  margin-bottom: 0.2rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-3, #6d756d);
}

.msg-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.msg-form label {
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3, #6d756d);
}

.msg-form__error {
  padding: 0.7rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #7d3f38;
  background: #fbf0ed;
  border: 1px solid #e7c7c1;
  border-radius: 10px;
}

.msg-form__error[hidden] {
  display: none;
}

.msg-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.msg-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 1.2rem 0.5rem 0.4rem;
  text-align: center;
}

.msg-success[hidden] {
  display: none;
}

.msg-success__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  color: var(--sage-800, #4e6652);
  background: var(--sage-100, #eaf0e6);
  border-radius: 50%;
}

.msg-success__icon svg {
  width: 28px;
  height: 28px;
}

.msg-success h3 {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--ink, #2c322c);
}

.msg-success p {
  max-width: 38ch;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-3, #6d756d);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 680px) {
  .msg-modal {
    padding: 0;
    align-items: end;
  }

  .msg-modal[open] {
    align-items: end;
  }

  .msg-modal__panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding: 1.4rem 1.25rem calc(1.4rem + env(safe-area-inset-bottom));
  }

  .msg-form__actions {
    flex-direction: column-reverse;
  }

  .msg-form__actions .btn {
    width: 100%;
  }
}
