/* Text From Home referral invite modal — Andrea-final Package A (2026-09-21). */
.tfh-modal[hidden] { display: none; }
.tfh-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(28, 25, 23, 0.58);
  color: #1c1917;
}
.tfh-modal__dialog {
  position: relative;
  width: min(100%, 62rem);
  max-height: min(94vh, 42rem);
  overflow: auto;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid #e7e5e4;
  border-radius: 1.15rem;
  background: #fff;
  box-shadow: 0 1.5rem 4rem rgba(28, 25, 23, 0.25);
}
.tfh-modal__title {
  margin: 0 2.5rem 1.25rem 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.tfh-modal__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #78716c;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.tfh-modal__close:hover,
.tfh-modal__close:focus-visible { background: #faf7f2; color: #1c1917; }
.tfh-modal__label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
}
.tfh-modal__textarea {
  display: block;
  width: 100%;
  min-height: 10rem;
  resize: vertical;
  padding: 0.85rem 1rem;
  border: 1px solid #d6d3d1;
  border-radius: 0.7rem;
  background: #fafaf9;
  color: #1c1917;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
}
.tfh-modal__textarea:focus { outline: 3px solid rgba(180, 83, 9, 0.22); border-color: #b45309; }
.tfh-modal__terms {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.8rem 0 1.5rem;
  color: #57534e;
}
.tfh-modal__terms input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.05rem 0 0;
  accent-color: #b45309;
  flex: 0 0 auto;
}
.tfh-modal__terms a { color: #b45309; }
.tfh-modal__actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.tfh-modal__action {
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #b45309;
  border-radius: 0.65rem;
  background: #fff;
  color: #b45309;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tfh-modal__action:hover:not(:disabled),
.tfh-modal__action:focus-visible:not(:disabled) { background: #fff7ed; }
.tfh-modal__action:disabled { cursor: not-allowed; opacity: 0.42; }
.tfh-modal__status {
  min-height: 1.4em;
  margin: 0.55rem 0 0;
  color: #57534e;
  text-align: center;
  font-size: 0.9rem;
}
.tfh-modal__footer {
  margin: 0.35rem 0 0;
  color: #78716c;
  text-align: center;
  font-size: 0.95rem;
}
body.tfh-modal-open { overflow: hidden; }
@media (max-width: 640px) {
  .tfh-modal { padding: 0.5rem; align-items: end; }
  .tfh-modal__dialog { max-height: 95vh; border-radius: 1rem 1rem 0.75rem 0.75rem; }
  .tfh-modal__actions { grid-template-columns: 1fr; }
}

[data-invite-open][hidden] { display: none !important; }
