/* Form pieces shared by /join and /host. */
.form { display: grid; gap: 24px; }
.form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.field { display: grid; gap: 2px; }
.field[hidden] { display: none; }
.field-label, .form legend { padding: 0; font-size: 14px; color: var(--strong); }
.field-label .optional, .form legend .optional { margin-inline-start: 6px; color: var(--faint); }
.form legend { margin-block-end: 9px; }

.input {
  inline-size: 100%; min-block-size: 44px; padding: 10px 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: inset 0 -1px 0 #ffffff26;
  color: var(--strong); font: inherit; font-size: 16px; line-height: 1.5;
  transition: box-shadow 150ms var(--ease-out);
}
textarea.input { min-block-size: 72px; resize: none; field-sizing: content; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--strong); }
@media (hover: hover) and (pointer: fine) { .input:hover:not(:focus) { box-shadow: inset 0 -1px 0 #ffffff4d; } }
.field[data-invalid] .input { box-shadow: inset 0 -1px 0 #f0a296; }
.form .field-hint { margin: 6px 0 0; font-size: 13px; color: var(--faint); }
.form .error { margin: 0; font-size: 13px; color: #f0a296; }
.form .error:empty { display: none; }

/* Pill choices: radios and checkboxes that look like the shop's pills when picked. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; block-size: 36px; padding-inline: 15px; border-radius: 6px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-size: 14px; white-space: nowrap;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), transform 160ms var(--ease-out);
}
.chip input:checked + span { background: var(--strong); color: var(--bg); box-shadow: none; }
.chip input:active + span { transform: scale(0.97); }
.chip input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.chip input:disabled + span { opacity: .4; }
.chip input:disabled { cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .chip input:hover:not(:checked):not(:disabled) + span { color: var(--strong); } }

.check { display: flex; align-items: flex-start; gap: 11px; color: var(--strong); font-size: 15px; cursor: pointer; }
.check input {
  appearance: none; flex: none; display: grid; place-items: center; inline-size: 19px; block-size: 19px; margin: 2px 0 0;
  border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px #ffffff2e; cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}
.check input::after {
  content: ""; inline-size: 11px; block-size: 11px; background: var(--bg); opacity: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4 4.8 9 10 3' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4 4.8 9 10 3' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.check input:checked { background: var(--strong); box-shadow: none; }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form .form-note { margin: 0; font-size: 13px; color: var(--faint); }
.form .form-error { margin: 0; font-size: 14px; color: #f0a296; }
.form .form-error:empty { display: none; }
/* Bots fill in every field; people never see this one. */
.honey { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }

/* On a plain text page (/host) the form sits a little apart from the intro. */
.page .form, .page .sent { margin-block-start: 40px; }

/* Tabs (plans on /join, setups on /host, draw or upload on /ads; --n is how many). The white pill slides to the one you pick. */
.plan-tabs { position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); padding: 3px; margin-block-end: 24px; border-radius: 8px; box-shadow: inset 0 0 0 1px #ffffff1f; }
.plan-tabs::before {
  content: ""; position: absolute; inset-block: 3px; inset-inline-start: 3px; inline-size: calc((100% - 6px) / var(--n, 3)); border-radius: 5px; background: var(--strong);
  transform: translateX(calc(var(--at, 0) * 100%)); transition: transform 320ms var(--ease-out);
}
.plan-tab { position: relative; block-size: 34px; border: 0; border-radius: 5px; background: none; color: var(--text); font-size: 13px; cursor: pointer; transition: color 200ms var(--ease-out); }
.plan-tab[aria-pressed="true"] { color: var(--bg); }
.plan-tab:focus-visible { outline: 2px solid var(--faint); outline-offset: 2px; }
.plan-tab:disabled { cursor: default; }
@media (hover: hover) and (pointer: fine) { .plan-tab:not([aria-pressed="true"]):hover { color: var(--strong); } }

@media (prefers-reduced-motion: reduce) { .plan-tabs::before, .plan-tab { transition: none; } }

/* After a form sends: the answer replaces the form in place. */
.sent h2 { margin: 0 0 10px; font-size: 17px; font-weight: 500; color: var(--strong); }
.sent p { margin: 0 0 10px; }
.sent:focus { outline: none; }

/* The receipt: a desk and what it costs. Its dot is lit once the desk is yours (picked on /join, paid on /members). */
.pick { display: flex; align-items: center; gap: 14px; }
.pick-light { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: #34363b; transition: background-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out); }
.pick.picked .pick-light { background: var(--lamp); box-shadow: 0 0 0 4px #f3d59e1f, 0 0 18px 3px #f3d59e59; }
.pick-text { display: grid; gap: 1px; min-inline-size: 0; }
.pick-plan { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.pick.picked .pick-plan { color: var(--strong); }
.pick.pop { animation: pop 350ms var(--ease-out); }
@keyframes pop { 40% { transform: scale(1.02); } }

@media (prefers-reduced-motion: reduce) { .input, .chip span, .check input, .pick-light { transition: none; } .pick.pop { animation: none; } }
