/* TxSTEMed SMS Opt-In. Uses the theme's tokens, with fallbacks so it still
   reads correctly under another theme. */
.txoptin {
  --tx-surface: var(--surface, #0f2436);
  --tx-raised: var(--raised, #14304a);
  --tx-line: var(--line, #23415c);
  --tx-text: var(--text, #dde8f2);
  --tx-muted: var(--muted, #8fa6bb);
  --tx-head: var(--head, #ffffff);
  --tx-beacon: var(--beacon, #ffc24a);
  --tx-fill: var(--signal-fill, #cc4313);
  --tx-fill-hover: var(--signal-fill-hover, #b23a10);
  max-width: 760px;
  color: var(--tx-text);
}
.txoptin__title { margin: 0 0 .4em; color: var(--tx-head); }

.txoptin > :first-child { margin-top: 0; }

.txoptin__form,
.txoptin__terms,
.txoptin__notice {
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  border-radius: 3px;
  padding: 1.5rem;
  margin: 1.5rem 0 0;
}
.txoptin__form { border-top: 3px solid var(--tx-fill); }
.txoptin__terms { border-top: 3px solid var(--tx-beacon); }
.txoptin__notice--error { border-top: 3px solid #e5484d; }
.txoptin__notice p:last-child { margin-bottom: 0; }

.txoptin__groups { border: 0; background: transparent; margin: 0 0 1.25rem; padding: 0; min-width: 0; }
.txoptin__groups legend { font-weight: 600; color: var(--tx-head); padding: 0; margin-bottom: .6rem; }

.txoptin__check {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .55rem .7rem; margin: 0 0 .4rem;
  border: 1px solid var(--tx-line); border-radius: 3px;
  background: var(--tx-raised); cursor: pointer;
}
.txoptin__check input[type="checkbox"] {
  flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: .3rem 0 0;
  accent-color: var(--tx-beacon);
}
.txoptin__check span { color: var(--tx-text); }
.txoptin__consent { margin: 1.25rem 0; font-size: .93rem; line-height: 1.55; }

.txoptin__row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.txoptin__field { margin: 0; }
.txoptin__field label { display: block; font-weight: 600; color: var(--tx-head); margin-bottom: .35rem; }
.txoptin__opt { font-weight: 400; color: var(--tx-muted); }
.txoptin__hint { display: block; font-size: .84rem; color: var(--tx-muted); margin-top: .3rem; }
.txoptin__field input { width: 100%; }
.txoptin__field input[aria-invalid="true"],
.txoptin__check.is-invalid,
.txoptin__groups.is-invalid .txoptin__check { border-color: #ff8a8a; }

/* Honeypot: off screen, not display:none, so simple bots still fill it */
.txoptin__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.txoptin__turnstile { margin: 0 0 1rem; min-height: 1px; }
.txoptin__actions { margin: 0; }
.txoptin__submit {
  display: inline-block; cursor: pointer;
  background: var(--tx-fill); color: #fff;
  border: 2px solid transparent; border-radius: 3px;
  font: inherit; font-weight: 600; padding: .75em 1.4em;
}
.txoptin__submit:hover, .txoptin__submit:focus { background: var(--tx-fill-hover); color: #fff; }
.txoptin__submit[disabled] { opacity: .6; cursor: not-allowed; }

.txoptin__msg { margin-top: 1rem; }
.txoptin__msg:empty { display: none; }
.txoptin__msg p {
  margin: 0; padding: .75rem .9rem; border-radius: 3px;
  border: 1px solid var(--tx-line); background: var(--tx-raised); color: var(--tx-head);
}
.txoptin__msg.is-error p { border-color: #ff8a8a; }
.txoptin__msg.is-ok p { border-color: #3fbf8f; }

.txoptin__terms h3 { margin-top: 0; color: var(--tx-head); }
.txoptin__terms ul { margin: 0 0 1rem; padding-left: 1.3rem; }
.txoptin__terms li { margin-bottom: .45rem; }
.txoptin__terms strong { color: var(--tx-head); }
.txoptin__links { margin: 0; display: flex; gap: .6rem; flex-wrap: wrap; }
.txoptin__links a { color: var(--tx-beacon); }

/* The hidden attribute must win over any theme display rule */
.txoptin [hidden] { display: none !important; }

/* 1.4.0: one form. Email first, text alerts as an optional section. */
.txoptin__lead { margin: 0 0 1.25rem; }
.txoptin__lists { margin-top: 1.25rem; }
.txoptin__sms {
  margin: 1.5rem 0 1.25rem; padding: 1.1rem 1.1rem .2rem; min-width: 0;
  border: 1px solid var(--tx-line); border-left: 3px solid var(--tx-beacon); border-radius: 3px;
  background: transparent; background-image: none;
}
.txoptin__sms > legend { font-weight: 600; color: var(--tx-head); padding: 0 .4rem; }
.txoptin__sms-hint { margin: 0 0 1rem; }
.txoptin__sms .txoptin__field { margin: 0 0 1rem; }
.txoptin__sms .txoptin__consent { margin: 0 0 1rem; }
.txoptin__groups legend { font-weight: 600; }
.txoptin__onegroup { margin: 0 0 1rem; font-weight: 600; color: var(--tx-head); }
.txoptin__field input[type="email"] { width: 100%; }
.txoptin__title + .txoptin__form,
.txoptin__title + .txoptin__notice { margin-top: 0; }
