/* =====================================================================
   FIELDS — the input component, mockup 2026-10-14
   After the Untitled UI input: label above, a 44px box with an 8px radius,
   a 1px ring and the faintest shadow, a 20px icon on the left. Focus is a
   2px Blue Rail blue ring with a soft blue halo; an error turns the ring
   rose, shows the error icon, and puts the message under the field.
   Written to be lifted into site/css for every page, starting with sign
   in and sign up.

   <div class="fld">
     <label class="fld-label" for="x">Email</label>
     <div class="fld-box">
       <svg class="fld-ico">…</svg>
       <input class="fld-in" id="x">
       <svg class="fld-err">…</svg>             (not on a password field)
       <button class="fld-btn">…</button>        (optional trailing action)
     </div>
     <p class="fld-hint" hidden></p>             (errors only)
   </div>
   Sizes: .fld-sm 40px · default 44px · .fld-lg 48px.
   ===================================================================== */

.fld{
  --fld-h:44px; --fld-px:14px;
  --fld-ring:rgba(16,34,64,.2);
  --fld-ring-hover:rgba(16,34,64,.32);
  --fld-xs:0 1px 2px rgba(16,34,64,.05);
  --fld-rose:var(--accent-rose, #e31b54);
  --fld-rose-ink:var(--accent-rose-ink, #da1a51);
  display:grid; grid-template-columns:minmax(0, 1fr); gap:8px; min-width:0;
  /* label and box stay on top when a row is taller: an error under the
     field beside this one must not push this box down (2026-11-03) */
  align-content:start;
}
.fld-sm{--fld-h:40px; --fld-px:12px}
.fld-lg{--fld-h:48px; --fld-px:16px}

.fld-label{font-size:14px; font-weight:500; line-height:20px; letter-spacing:-.005em; color:rgba(16,34,64,.82)}

/* The ring is drawn by ::after, on top of the contents, so nothing inside
   the box (the browser's autofill fill, a child's background) can cover it.
   The box keeps only the outer halo and the faint drop shadow. States change
   the --fld-ring-* and --fld-halo values, never the shadows themselves. */
.fld-box{--fld-bg:#fff; --fld-ring-w:1px; --fld-ring-c:var(--fld-ring); --fld-halo:0 0 0 0 transparent;
  position:relative; display:flex; align-items:center; gap:8px; height:var(--fld-h); padding:0 var(--fld-px);
  border-radius:8px; background:var(--fld-bg); cursor:text;
  box-shadow:var(--fld-halo), var(--fld-xs);
  transition:box-shadow .1s linear, background .1s linear}
.fld-box::after{content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  box-shadow:inset 0 0 0 var(--fld-ring-w) var(--fld-ring-c); transition:box-shadow .1s linear}
.fld-box:hover{--fld-ring-c:var(--fld-ring-hover)}
.fld-box:focus-within{--fld-ring-w:2px; --fld-ring-c:var(--blue, #3070B6); --fld-halo:0 0 0 4px rgba(48,112,182,.12)}

.fld-ico{flex:none; width:20px; height:20px; color:rgba(16,34,64,.42); transition:color .1s linear}
.fld-box:focus-within .fld-ico{color:var(--blue, #3070B6)}

.fld-in{flex:1; min-width:0; height:100%; margin:0; padding:0; border:0; outline:0; background:transparent;
  font:inherit; font-size:16px; line-height:24px; color:var(--navy, #102240)}
/* the ring belongs to the box, so the product-wide input ring stays off */
.fld-in:focus-visible{box-shadow:none}
.fld-in::placeholder{color:rgba(16,34,64,.5); opacity:1}
/* browser autofill tints the bare input only, a strip inside the box; fill
   it with the box's own colour and keep the ink (the ring sits above it) */
.fld-in:-webkit-autofill, .fld-in:-webkit-autofill:hover, .fld-in:-webkit-autofill:focus{
  -webkit-box-shadow:0 0 0 1000px var(--fld-bg) inset; -webkit-text-fill-color:var(--navy, #102240);
  caret-color:var(--navy, #102240); transition:background-color 9999s ease-out}
.fld-in:autofill{box-shadow:0 0 0 1000px var(--fld-bg) inset}

/* a select reads as the same box, with a chevron at the end */
select.fld-in{appearance:none; -webkit-appearance:none; cursor:pointer; padding-right:28px}
select.fld-in:invalid{color:rgba(16,34,64,.5)}
select.fld-in option{color:var(--navy, #102240)}
.fld-chev{position:absolute; right:var(--fld-px); width:20px; height:20px; color:rgba(16,34,64,.42); pointer-events:none}

/* a trailing icon button: Show / Hide on a password */
.fld-btn{flex:none; display:grid; place-items:center; width:32px; height:32px; margin-right:calc(-1 * (var(--fld-px) - 6px));
  padding:0; border:0; border-radius:6px; background:transparent; color:rgba(16,34,64,.42); cursor:pointer; transition:color .15s, background .15s}
.fld-btn:hover{color:var(--navy, #102240); background:rgba(16,34,64,.05)}
.fld-btn svg{width:20px; height:20px}
.fld-btn .off, .fld-btn[aria-pressed="true"] .on{display:none}
.fld-btn[aria-pressed="true"] .off{display:block}

/* error: rose ring, the icon, the message under the field */
.fld-err{display:none; flex:none; width:16px; height:16px; color:var(--fld-rose)}
.fld-hint{margin:0; font-size:14px; line-height:20px; color:rgba(16,34,64,.64)}
.fld[data-invalid] .fld-box{--fld-ring-c:var(--fld-rose)}
.fld[data-invalid] .fld-box:focus-within{--fld-halo:0 0 0 4px rgba(227,27,84,.12)}
.fld[data-invalid] .fld-err{display:block}
.fld[data-invalid] .fld-box:focus-within .fld-ico{color:rgba(16,34,64,.42)}
.fld[data-invalid] .fld-hint{color:var(--fld-rose-ink)}
.fld[data-invalid] .fld-chev{display:none}

/* disabled */
.fld-box:has(.fld-in:disabled){--fld-bg:rgba(16,34,64,.03); --fld-ring-c:rgba(16,34,64,.14); box-shadow:none; cursor:not-allowed}
.fld-in:disabled{color:rgba(16,34,64,.5); cursor:not-allowed}
.fld-box:has(.fld-in:disabled) .fld-ico{color:rgba(16,34,64,.3)}

/* the checkbox beside a form: blue when ticked, a blue ring on focus */
.check:focus-visible{outline:none; box-shadow:0 0 0 2px #fff, 0 0 0 4px var(--blue, #3070B6)}
.check[aria-invalid="true"]{border-color:var(--fld-rose)}
