/* signup modal — built on the site tokens: Archivo labels, Inter body, papaya, 2px radii */

html.fm-open { overflow: hidden; }

.fmodal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: clamp(12px, 3vw, 40px); }
.fmodal[hidden] { display: none; }
.fm-veil { position: absolute; inset: 0; background: rgba(20, 8, 2, .62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; transition: opacity .26s ease; }
.fmodal.in .fm-veil { opacity: 1; }

.fm-card {
  position: relative; z-index: 1; width: min(940px, 100%); max-height: calc(100dvh - 24px);
  display: grid; grid-template-columns: 300px 1fr; background: #fff; border-radius: 3px;
  box-shadow: 0 60px 120px -40px rgba(20, 8, 2, .6); overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .3s ease, transform .38s cubic-bezier(.22, 1, .36, 1);
}
.fmodal.in .fm-card { opacity: 1; transform: none; }

.fm-x {
  position: absolute; top: 10px; right: 12px; z-index: 3; width: 34px; height: 34px; border: 0;
  background: transparent; color: var(--mut); font-size: 26px; line-height: 1; cursor: pointer;
  border-radius: 2px; transition: color .2s, background .2s;
}
.fm-x:hover { color: var(--ink); background: rgba(22, 19, 16, .06); }

/* branded rail */
.fm-side { background: var(--papaya); color: #fff; padding: 34px 28px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.fm-side:before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 3px), repeating-linear-gradient(0deg, rgba(74, 10, 0, .08) 0 1px, transparent 1px 3px);
}
.fm-side > * { position: relative; }
.fm-side .dots { --d: 9px; color: #fff; }
.fm-side-k { font-family: var(--disp); font-weight: 500; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .82); margin: 0; }
.fm-side-h { font-family: var(--body); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.04; font-size: 27px; color: #fff; margin: 0; max-width: none; }
.fm-side-list { list-style: none; margin: auto 0 0; padding: 16px 0 0; border-top: 1px solid rgba(255, 255, 255, .3); display: grid; gap: 10px; }
.fm-side-list li { font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, .92); padding-left: 16px; position: relative; }
.fm-side-list li:before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; background: #fff; }
.fm-side-f { font-family: var(--disp); font-weight: 400; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .78); margin: 0; }

/* form pane */
.fm-main { padding: 38px clamp(24px, 3.4vw, 44px) 34px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fm-kicker { font-family: var(--disp); font-weight: 500; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--burnt); margin: 0; }
.fm-title { font-family: var(--body); font-weight: 900; text-transform: uppercase; letter-spacing: -.012em; line-height: 1.04; font-size: clamp(23px, 2.5vw, 31px); color: var(--papaya); margin: 10px 0 0; }
.fm-sub { font-size: 13.5px; color: var(--sec); margin: 10px 0 0; max-width: 52ch; }
#fmForm { margin-top: 24px; display: grid; gap: 15px; }

.fm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.fm-field { display: grid; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.fm-field > label, .fm-field > legend {
  font-family: var(--disp); font-weight: 500; font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--sec); padding: 0;
}
.fm-opt { color: var(--mut); letter-spacing: .1em; }

.fm-field input[type=text], .fm-field input[type=email], .fm-field select {
  font-family: var(--body); font-weight: 300; font-size: 14.5px; color: var(--ink);
  padding: 12px 13px; border: 1px solid var(--rule); border-radius: 2px; background: #fff;
  width: 100%; transition: border-color .2s, box-shadow .2s;
}
.fm-field select { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23655F56' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.fm-field input:focus, .fm-field select:focus { outline: 0; border-color: var(--papaya); box-shadow: 0 0 0 3px rgba(242, 96, 12, .16); }
.fm-field input.bad, .fm-field select.bad { border-color: #C0300A; }
.fm-field input.bad:focus, .fm-field select.bad:focus { box-shadow: 0 0 0 3px rgba(192, 48, 10, .16); }

.fm-err { font-size: 11.5px; color: #C0300A; margin: 0; display: none; line-height: 1.4; }
.fm-err.on { display: block; }

/* plan picker */
.fm-plans[hidden], [data-only][hidden] { display: none; }
.fm-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fm-plan { position: relative; cursor: pointer; }
.fm-plan input { position: absolute; opacity: 0; width: 0; height: 0; }
.fm-plan-b { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid var(--rule); border-radius: 2px; transition: border-color .2s, background .2s, box-shadow .2s; height: 100%; }
.fm-plan:hover .fm-plan-b { border-color: var(--limestone); }
.fm-plan input:checked + .fm-plan-b { border-color: var(--papaya); background: rgba(242, 96, 12, .05); box-shadow: inset 0 0 0 1px var(--papaya); }
.fm-plan input:focus-visible + .fm-plan-b { box-shadow: 0 0 0 3px rgba(242, 96, 12, .22); }
.fm-plan-n { font-family: var(--disp); font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.fm-plan-p { font-size: 16px; font-weight: 500; color: var(--papaya); }
.fm-plan-p s { color: var(--mut); font-size: 12px; margin-right: 5px; font-weight: 300; }
.fm-plan-d { font-size: 11.5px; line-height: 1.42; color: var(--mut); }

/* consent */
.fm-check { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.fm-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--papaya); flex: none; cursor: pointer; }
.fm-check input:focus-visible { outline: 2px solid var(--papaya); outline-offset: 2px; }
.fm-check label { font-size: 12.5px; line-height: 1.5; color: var(--sec); cursor: pointer; }
#fmConsent-err { margin-top: -8px; }

.fm-formerr { font-size: 12.5px; color: #C0300A; background: rgba(192, 48, 10, .07); border-left: 2px solid #C0300A; padding: 10px 12px; margin: 0; }
.fm-formerr[hidden] { display: none; }

.fm-submit { justify-content: center; width: 100%; position: relative; }
.fm-submit:disabled { cursor: wait; opacity: .8; }
.fm-spin { display: none; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, .38); border-top-color: #fff; border-radius: 50%; animation: fmspin .7s linear infinite; }
.fm-submit.busy .fm-spin { display: block; }
@keyframes fmspin { to { transform: rotate(360deg); } }
.fm-note { text-align: center; margin: 0; }

/* success */
.fm-done { display: grid; gap: 12px; justify-items: start; padding: 8px 0; }
.fm-done[hidden] { display: none; }
.fm-done:focus { outline: 0; }
.fm-tick { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(242, 96, 12, .12); color: var(--papaya); }
.fm-next { list-style: none; counter-reset: n; display: grid; gap: 10px; margin: 8px 0 6px; padding: 16px 0 0; border-top: 1px solid var(--rule); width: 100%; }
.fm-next li { counter-increment: n; font-size: 13px; color: var(--sec); padding-left: 30px; position: relative; line-height: 1.5; }
.fm-next li:before { content: "0" counter(n); position: absolute; left: 0; top: 1px; font-family: var(--disp); font-weight: 500; font-size: 10.5px; letter-spacing: .12em; color: var(--papaya); }

@media (max-width: 860px) {
  .fm-card { grid-template-columns: 1fr; }
  .fm-side { padding: 24px 26px 22px; gap: 12px; }
  .fm-side-h { font-size: 21px; }
  .fm-side-list, .fm-side-f { display: none; }
}
@media (max-width: 860px) {
  /* the close control sits over the orange rail here, so it has to read on it */
  .fm-x { color: rgba(255, 255, 255, .82); }
  .fm-x:hover { color: #fff; background: rgba(255, 255, 255, .16); }
}
@media (max-width: 560px) {
  .fmodal { padding: 0; align-items: stretch; }
  .fm-card { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; grid-template-rows: auto 1fr; }
  .fm-main { padding: 24px 20px 30px; }
  .fm-row, .fm-plan-grid { grid-template-columns: 1fr; }
  .fm-side-h { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .fm-veil, .fm-card { transition: none; }
  .fm-spin { animation: none; }
}
