/* ============================================================================
   FORMS of the inner layer (Docs/plan-inner-pages.md, Phases 4 and 7)
   Reviews, check-in, contact, sign-in and the other account pages.
   Loads after css/public/inner.css. One narrow column, labels above fields,
   errors in words beside the field they belong to and summed above the form.

   The validation classes are the ones ASP.NET Core writes: .validation-summary-errors,
   .field-validation-error, .input-validation-error. jquery-validation-unobtrusive toggles the
   same classes in the browser, so server and client errors look the same.

   1. column      2. field      3. errors      4. stars      5. choices + files
   6. actions     7. notice
   ============================================================================ */

/* ---------- 1. COLUMN ---------- */
.form-page { max-width: 40rem; padding: 0 var(--gutter) var(--s9); }
.form-page--narrow { max-width: 30rem; }
.form-page > .lead { margin: 0 0 var(--s6); color: var(--ink-2); }
.form { display: grid; gap: var(--s5); }
.form-split { display: grid; gap: var(--s5); }
@media (min-width: 640px) { .form-split { grid-template-columns: 1fr 1fr; } }

/* ---------- 2. FIELD — the label, the control, a hint under it ---------- */
.fld { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.fld > label, .fld > legend, .fld > .row > label { padding: 0; font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.fld > .row > a { font-size: .82rem; text-underline-offset: 4px; }
.fld > label small, .fld > legend small { font-size: inherit; font-weight: 400; color: var(--ink-3); }
.fld input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]),
.fld select,
.fld textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid rgba(23, 20, 15, .55); border-radius: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.4 var(--f-sans); appearance: none; -webkit-appearance: none; }
.fld textarea { min-height: 9rem; resize: vertical; }
.fld select { padding-right: 40px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%2317140F' stroke-width='1.4'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center / 11px; }
.fld input::placeholder, .fld textarea::placeholder { color: var(--ink-3); opacity: 1; }
.fld input:hover, .fld select:hover, .fld textarea:hover { border-color: var(--ink); }
.fld input:focus-visible, .fld select:focus-visible, .fld textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-color: var(--ink); }
.fld .hint { margin: 0; font-size: .82rem; color: var(--ink-3); }
.fld .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.fld .count { font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
/* a field with a button inside its right edge (show password) */
.fld .with-btn { position: relative; }
.fld .with-btn input { padding-right: 76px; }
.fld .with-btn button { position: absolute; right: 2px; top: 2px; bottom: 2px; min-width: 64px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font: 700 .68rem/1 var(--f-sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.fld .with-btn button:hover { color: var(--ink); }

/* ---------- 3. ERRORS ---------- */
.validation-summary-errors, .form-errors { margin: 0; padding: 14px 0 14px 18px; border-left: 3px solid var(--red); color: var(--red-ink); font-size: .95rem; }
.validation-summary-errors ul { margin: 0; padding: 0; list-style: none; }
.validation-summary-errors li + li { margin-top: 4px; }
.validation-summary-valid { display: none; }
.field-validation-error { display: block; font-size: .85rem; font-weight: 600; color: var(--red-ink); }
.field-validation-valid { display: none; }
.fld .input-validation-error { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }

/* ---------- 4. STARS — five radios drawn as glyphs. Rendered 5 to 1 and laid out in reverse,
   so "this one and the ones before it" is one sibling selector. Keyboard: arrow keys, as radios. ---------- */
.stars-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.stars-input label { display: grid; place-items: center; width: 44px; height: 44px; font-size: 2rem; line-height: 1; color: rgba(23, 20, 15, .22); cursor: pointer; }
.stars-input label:hover, .stars-input label:hover ~ label,
.stars-input input:checked ~ label { color: var(--ink); }
.stars-input input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- 5. CHOICES + FILES ---------- */
.pick { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: .95rem; cursor: pointer; }
.pick input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.fld input[type="file"] { width: 100%; min-height: 48px; padding: 10px 0; font: inherit; color: var(--ink-2); }
.fld input[type="file"]::file-selector-button { margin-right: 14px; min-height: 40px; padding: 0 16px; border: 0; background: var(--ink); color: var(--paper); font: 700 .68rem/1 var(--f-sans); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.thumbs li { width: 104px; }
.thumbs .ph { aspect-ratio: 1; }
.thumbs .pick { min-height: 36px; font-size: .8rem; gap: 8px; }

/* ---------- 6. ACTIONS ---------- */
.form-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: var(--s3); }
.form-acts .quiet { min-height: 44px; display: inline-flex; align-items: center; font-size: .9rem; text-underline-offset: 4px; }
.btn-del { box-shadow: inset 0 0 0 1px var(--red); color: var(--red-ink); background: transparent; }
.btn-del:hover { background: var(--red); color: #fff; }
.form-aside { margin: var(--s7) 0 0; padding-top: var(--s5); border-top: 1px solid var(--rule); font-size: .92rem; color: var(--ink-2); }
.form-aside a { text-underline-offset: 4px; }

/* ---------- 7. NOTICE — what happened, in a sentence, above the form ---------- */
.notice { margin: 0 0 var(--s5); padding: 14px 0 14px 18px; border-left: 3px solid var(--ink); font-size: .95rem; }
.notice--ok { border-color: var(--green); }
.notice--bad { border-color: var(--red); color: var(--red-ink); }
.notice p { margin: 0 0 8px; }
.notice ul { margin: 0 0 8px; padding-left: 1.2em; }
.notice > :last-child { margin-bottom: 0; }
.notice .btn { margin-top: 4px; }
.form-page > .lead { max-width: 34rem; }
.form-aside form + form, .form-aside p + form { margin-top: 10px; }
.pick > span { min-width: 0; }
.pick a { text-underline-offset: 3px; }

/* ---------- 8. PROFILE — the small pieces beside the form ---------- */
.label--gap { margin-top: var(--s8); }
.sec h2.label { margin-bottom: var(--s4); color: var(--ink-3); }
.visit { display: grid; gap: 2px; padding: 14px 0; }
.visit a { font-weight: 600; text-underline-offset: 3px; }
.visit span { font-size: .85rem; color: var(--ink-3); }
.panel .linkrow { margin-top: var(--s5); }
.cols-2 .lead + .form { margin-top: var(--s6); }
/* A link that stands alone beside a label or under a form gets a finger-sized hit area without
   moving the line it sits on. */
.fld > .row > a, .form-aside a { display: inline-block; padding: 12px 0; margin: -12px 0; }
