/* Store Space TPP Claims — www surface (CW-3 leg 4; FR-3 photo slots CW-6).
 * The ONLY stylesheet www loads: the CSP for this surface is
 *   default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'self' https://api.mytppclaim.com
 * so there is no inline style anywhere and no external font/CDN reference.
 *
 * FR-63 (WCAG 2.1 AA) notes that live in here rather than in a comment on a page:
 *  - no state is signalled by colour alone; every colour cue accompanies words or a border;
 *  - focus is always visible (never outline: none);
 *  - the skip link is real, not display:none, and appears when focused;
 *  - text and controls are sized in rem so browser zoom and OS text scaling both work;
 *  - the error summary carries a heavy left border as well as its colour.
 */

:root {
  --ink: #1c1c1c;
  --muted: #4a4a4a;
  --line: #b9b9b9;
  --bg: #ffffff;
  --accent: #14497b;
  --accent-ink: #ffffff;
  --error: #8c1c13;
  --error-bg: #fdf1f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

/* The CW-0 placeholder page (www "/") keeps its centred single-column look. */
.placeholder {
  margin: 15vh auto;
  max-width: 36rem;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  left: -100vw;
  top: 0;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.skip-link:focus { left: 0; z-index: 10; }

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem;
}
.site-title { margin: 0; font-weight: 600; }

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
main:focus { outline: none; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 0.75rem; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 0.5rem; }

section { margin-bottom: 1rem; }

.hint { color: var(--muted); margin: 0 0 0.4rem; font-size: 0.95rem; }

.field { margin: 0 0 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }

.control {
  display: block;
  width: 100%;
  max-width: 26rem;
  padding: 0.5rem 0.6rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 3px;
}
.control:focus,
.control-check:focus,
button:focus,
a:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* A select is a .control too, so it inherits the box above. Only the two things a native
 * select needs differently are set here. */
select.control {
  /* Never shrink below the tap target on a phone, and keep room for the longest street line. */
  min-height: 2.6rem;
}

/* The D-015b cascade disables City until a State is chosen, and Store until a City is. That
 * state is carried by the NATIVE disabled attribute — announced by assistive tech and
 * unfocusable — so this rule is a supplementary visual only, never the signal itself. */
.control[disabled] {
  background: #f1f1f1;
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 0 0 1.1rem;
  padding: 0.6rem 0.9rem 0.9rem;
}
legend { font-weight: 600; padding: 0 0.3rem; }

.check { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.35rem 0; }
.check label { font-weight: 400; }
.control-check { margin-top: 0.35rem; width: 1.15rem; height: 1.15rem; }

button {
  font: inherit;
  padding: 0.55rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  margin: 0 0.5rem 0.5rem 0;
}
button.primary { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); }
button.secondary { background: var(--bg); color: var(--accent); border: 2px solid var(--accent); }
button.destructive { background: var(--bg); color: var(--error); border: 2px solid var(--error); }
button[disabled] { opacity: 0.6; cursor: not-allowed; }

a { color: var(--accent); }
.primary-link { font-weight: 600; }

.error-summary {
  border: 2px solid var(--error);
  border-left-width: 0.5rem;
  background: var(--error-bg);
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
}
.error-summary h2 { margin: 0 0 0.4rem; font-size: 1.05rem; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--error); }

.status-region { margin: 0 0 1rem; font-weight: 600; }
.status-region:empty { margin: 0; }

.claim-list, .item-list, .photo-items, .slot-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.claim-list > li, .item-list > li, .photo-items > li {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
}

/* ------------------------------------------------------------------ FR-3 photo slots (CW-6)
 * FR-63 is the whole design here, not a coat of paint:
 *  - a slot says in words whether it is required and what state it is in; nothing is carried
 *    by a colour, a tick or an icon, so a monochrome or high-contrast render loses nothing;
 *  - the plain file input is a normal .control with a normal <label> above it, sized and
 *    weighted exactly like every other field on the page — the camera button sits BESIDE it,
 *    so no path looks like the lesser one;
 *  - the camera panel is an ordinary block with real buttons; it is hidden with the [hidden]
 *    attribute (below) rather than moved off-screen, so nothing focusable survives closing it.
 */
.slot {
  border: 1px solid var(--line);
  border-left-width: 0.35rem;
  border-radius: 3px;
  padding: 0.6rem 0.9rem;
  margin: 0 0 0.6rem;
}
.slot-name { margin: 0; font-weight: 600; }
.slot-need { margin: 0; color: var(--muted); font-size: 0.95rem; }
.slot-chip { margin: 0.2rem 0 0.6rem; font-weight: 600; }
.slot .field { margin: 0 0 0.6rem; }

/* A file input keeps the .control box so it reads as a first-class field, with the extra
 * vertical room the native button inside it needs on a phone. */
input[type="file"].control { padding: 0.45rem 0.5rem; min-height: 2.6rem; }

.camera {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.6rem;
  margin: 0 0 0.6rem;
}
.camera-view {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
  margin: 0 0 0.6rem;
  background: #000000;
}

/* CW-10 e-sign. The release document is embedded inside a wrapper that is DELIBERATELY
 * shorter than the object it contains: the wrapper is the only scroll position this page can
 * observe (the document is served cross-origin by the api, so its viewer exposes nothing),
 * and reaching the bottom of it is the FR-27 signal that enables the read-to-the-end
 * interlock. Sizes in rem so a renter who has scaled their text keeps a usable viewer. */
.release-viewport {
  height: 30rem;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 0 0 0.8rem;
  background: #ffffff;
}
.release-object {
  display: block;
  width: 100%;
  height: 60rem;
  border: 0;
}
.esign-disclosure { margin: 0 0 1rem; padding-left: 1.2rem; }
.esign-disclosure li { margin: 0 0 0.5rem; }

.summary { margin: 0 0 1rem; }
.summary dt { font-weight: 600; margin-top: 0.5rem; }
.summary dd { margin: 0 0 0 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem;
  max-width: 44rem;
  margin: 0 auto;
}
.disclaimer { margin: 0; color: var(--muted); }

[hidden] { display: none !important; }
