/* Shared form/button/error primitives.
   Used by the landing newsletter form, the auth/invitation surface, and
   the newsletter confirm/unsubscribe pages. Anything reused in more than
   one page lives here, not in landing.css. */

/* Required marker (asterisk) — appended inside .field-label to mark
   required inputs. Subtle, non-decorative, ARIA-hidden because the input
   itself carries `required` + `aria-required` for assistive tech. */
.required {
  color: var(--ink-mute);
  font-weight: 400;
  margin-left: 0.15em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}
.field-full { grid-column: 1 / -1; }
.field-label {
  font-family: var(--body-font);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.005em;
  color: var(--ink);
  line-height: 1.2;
}
.field-input {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: var(--font-form-input);
  line-height: 1.4;
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--duration-quick) var(--ease-standard),
              background-color var(--duration-quick) var(--ease-standard);
}
.field-input::placeholder { color: var(--ink-faint); }
.field-input:hover { border-color: var(--ink-soft); }
.field-input:focus-visible {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.field-input[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-bg);
}
/* Mono-tabular variant for numeric codes (confirmation, OTP, etc.). */
.field-input--code {
  font-family: var(--mono-font);
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}
.field-error {
  font-size: var(--step--1);
  color: var(--danger);
  line-height: 1.4;
  min-height: 1em;
}
.field-error--inline {
  /* form-level error banner: removes the height reservation when the
     element is being used as a banner instead of as a per-field slot. */
  min-height: 0;
}
.field-hint {
  font-size: var(--step--1);
  color: var(--ink-mute);
  line-height: 1.4;
  min-height: 0;
}
.field-hint:empty { display: none; }
.field-hint button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.field-hint button:hover { color: var(--ink-soft); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--body-font);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.005em;
  line-height: 1;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  min-width: 144px;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--duration-quick) var(--ease-standard),
              filter var(--duration-quick) var(--ease-standard);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-yellow);
  transform: translateX(-100%);
  transition: transform var(--duration-medium) var(--ease-standard);
  z-index: 0;
}
.btn > span {
  position: relative;
  z-index: 1;
  transition: color var(--duration-medium) var(--ease-standard);
}
.btn:hover::after { transform: translateX(0); }
.btn:hover > span { color: var(--ink); }
.btn:active { transform: translateY(1px); filter: brightness(0.97); }
.btn:focus-visible { box-shadow: inset 0 0 0 2px var(--bg); }
.btn[aria-busy="true"], .btn:disabled {
  opacity: 1;
  background: var(--bg-disabled);
  border-color: var(--bg-disabled);
  color: var(--ink-disabled);
  cursor: not-allowed;
}
.btn:disabled::after,
.btn[aria-busy="true"]::after {
  transform: translateX(-100%);
}

/* Global focus baseline. base.css zeroes :focus-visible for the default
   look; every interactive surface must restore a visible ring. Anchors,
   the brand link, and dynamically generated buttons inherit this. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
/* Components with their own focus treatment opt out via :where() or a
   targeted override (.btn, .field-input, .header-login, .acc-trigger
   already do this). */
.btn:focus-visible,
.field-input:focus-visible,
.header-login:focus-visible,
.acc-trigger:focus-visible {
  outline: 0;
}

/* Confirm-page error banner (form-level, non-field). */
.auth-error {
  font-size: var(--step--1);
  color: var(--danger);
  line-height: 1.4;
  margin: 0;
}

/* Inline mono span — used to display an email address in tabular type
   inside otherwise proportional copy (success / check-inbox pages). */
.mono-inline {
  font-family: var(--mono-font);
  font-size: 0.95em;
}

/* Inline tagging boxes for technical identifiers and system names.
   Both are transparent with a thin outline — they read as "tag" rather
   than "highlighted text", per common UI tagging conventions.

   .tag-tech       — neutral grey outline, mono font. Use for HTTP
                     headers, function names, hash algorithms, package
                     identifiers, CSP directives. The default <code>
                     element renders as .tag-tech via the doc-section
                     rule below, so authors can still write <code>X</code>.

   .tag-system     — warm-orange outline, mono font. Use for programming
                     languages, runtimes, platforms, hosting services
                     ("Go", "Node.js", "SQLite", "Fly.io"). Distinct
                     from .tag-tech so a reader can scan the page and
                     instantly tell "system this runs on" from
                     "API/identifier this code uses". */
.tag-tech,
.tag-system {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 0.85em;
  line-height: 1.4;
  padding: 1px 6px;
  border: 1px solid;
  border-radius: 4px;
  background: transparent;
  vertical-align: baseline;
  white-space: nowrap;
}
.tag-tech {
  border-color: var(--rule-mid);
  color: var(--ink-soft);
}
.tag-system {
  border-color: var(--tag-orange-line);
  color: var(--tag-orange);
}
