/* main.css — self-contained styles for the standalone Punch List
   Generator. Shares the same design tokens and component classes as the
   Daily Report Generator (landing/tools/daily-report-generator/styles/
   main.css) for visual consistency, but is its own file — nothing here
   imports or references that tool's CSS, and editing this file never
   touches it. */

:root {
  --paper: #f4f6f5;
  --panel: #ffffff;
  --ink: #1a2b33;
  --mute: #52666c;
  --line: #d7dedc;
  --accent: #2b5c7a;
  --accent-dark: #1f4a63;
  --accent-contrast: #ffffff;
  --danger: #a3372b;
  --danger-bg: #fbeceA;
  --focus-ring: #2b5c7a;
  --radius: 8px;
  --max-width: 1180px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;

  /* Done/not-done accents — semantic colors, deliberately distinct from
     --accent (the brand hue) so item state reads at a glance. */
  --done-color: #1f6f4a;
  --done-bg: #e6f3ec;
  --not-done-color: #52666c;
  --not-done-bg: #eef1f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a1e;
    --panel: #182229;
    --ink: #e7eeec;
    --mute: #93a6ab;
    --line: #28363c;
    --accent: #76b6db;
    --accent-dark: #5b9bc2;
    --accent-contrast: #0c1418;
    --danger: #e2958a;
    --danger-bg: #2a1a18;

    --done-color: #7fcba3;
    --done-bg: #15261c;
    --not-done-color: #93a6ab;
    --not-done-bg: #1c262a;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
}

.shell { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- header / footer --------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 16px; flex-wrap: wrap; }
.wordmark { font-family: var(--font-ui); font-weight: 800; font-size: 18px; margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.wordmark-link { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.wordmark-link:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.logo-mark { width: 30px; height: 29px; border-radius: 6px; flex-shrink: 0; display: block; }
.wordmark-tool { font-weight: 500; color: var(--mute); }

.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Same badge-crop technique as the Daily Report Generator and
   construdo.com's own nav (scripts/resources/partials.js's badgeBox()) —
   background-image sized by scale (targetHeight / contentHeight) inside a
   box matching the badge's own content aspect ratio, since both PNGs bake
   in non-uniform transparent padding. */
.badge-crop { display: block; background-repeat: no-repeat; background-position: center center; border-radius: 4px; }
.badge-appstore { width: 95.67px; height: 32px; background-image: url(../assets/img/app-store-badge.png); background-size: auto 82.9px; }
.badge-playstore { width: 107.43px; height: 32px; background-image: url(../assets/img/google-play-badge.png); background-size: auto 47.62px; }

@media (max-width: 560px) {
  .header-row { padding: 12px 16px; gap: 10px; }
  .logo-mark { width: 24px; height: 23px; }
  .wordmark { font-size: 15px; }
  .header-actions { gap: 8px; }
  .badge-appstore { width: 77.73px; height: 26px; background-size: auto 67.36px; }
  .badge-playstore { width: 87.29px; height: 26px; background-size: auto 38.69px; }
  .header-actions .btn-ghost { padding: 7px 12px; font-size: 12.5px; }
}

.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 0 40px; color: var(--mute); font-size: 13px; }

/* ---- buttons ------------------------------------------------------------ */

.btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  border-radius: 100px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  min-height: 40px;
}
.btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-add { background: var(--panel); color: var(--ink); border-color: var(--line); font-size: 13.5px; padding: 8px 14px; min-height: 36px; }
.btn-add:hover { border-color: var(--accent); color: var(--accent); }
.btn-remove { background: transparent; color: var(--danger); border: none; font-size: 13px; padding: 6px 10px; }
.btn-danger { background: var(--danger); color: #fff; }

/* ---- hero --------------------------------------------------------------- */

.hero { padding: 40px 20px 20px; }
.hero h1 { font-family: var(--font-ui); font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin: 0 0 10px; text-wrap: balance; }
.hero-dek { max-width: 62ch; color: var(--mute); font-size: 16.5px; margin: 0 0 6px; }
.hero-meta { font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 10px 0 0; }

/* ---- workspace (form + preview) ----------------------------------------- */

.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; padding: 20px 20px 0; }
@media (max-width: 920px) {
  .workspace { grid-template-columns: 1fr; padding-left: 8px; padding-right: 8px; }
}

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.preview-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
@media (max-width: 920px) { .preview-panel { position: static; max-height: none; } }

.preview-heading { margin: 0 0 12px; font-family: var(--font-ui); font-size: 15px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mute); }
.preview-root h3 { margin: 0 0 10px; font-size: 19px; }
.preview-root h4 { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); border-top: 1px solid var(--line); padding-top: 14px; }
.pv-line { margin: 2px 0; font-size: 13.5px; }
.pv-label { color: var(--mute); }
.pv-summary { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 4px; }
.pv-summary-stat { font-size: 13px; }
.pv-summary-stat b { font-variant-numeric: tabular-nums; }
.pv-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin: 6px 0 0; }
.pv-photo-grid img { width: 100%; height: 64px; object-fit: cover; border-radius: 4px; }
.pv-item { border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 10px; }
.pv-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.pv-item-title { font-weight: 700; font-size: 13.5px; }

/* ---- form ----------------------------------------------------------------- */

fieldset.field-section { border: none; border-top: 1px solid var(--line); margin: 0; padding: 20px 0; }
fieldset.field-section:first-of-type { border-top: none; padding-top: 0; }
legend {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  padding: 0;
  margin-bottom: 10px;
}
.section-help { color: var(--mute); font-size: 13px; margin: -4px 0 12px; }
.totals-line { font-weight: 700; font-size: 13px; margin: 0 0 12px; }

.field-grid { display: grid; gap: 14px; }
.field-grid.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .field-grid.two-col { grid-template-columns: 1fr; } }
.field-span-2 { grid-column: span 2; }
@media (max-width: 560px) { .field-span-2 { grid-column: span 1; } }

.field label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--mute); }
.field .req { color: var(--danger); }
.field-hint { font-size: 12px; color: var(--mute); margin: 4px 0 0; }
.field-error { font-size: 12.5px; color: var(--danger); margin: 4px 0 0; font-weight: 600; }

input[type="text"], input[type="date"], input[type="number"], select {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  min-height: 44px; /* touch target */
  width: 100%;
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }

/* ---- punch list item cards --------------------------------------------- */

.item-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
}
.item-card-head { display: flex; justify-content: space-between; align-items: center; }
.item-number { font-family: var(--font-ui); font-weight: 800; color: var(--mute); font-size: 13px; letter-spacing: 0.03em; }

/* A plain checkbox + label — this IS the entire status model now (done /
   not done), replacing what used to be a 4-state select + a separate
   "completed/verified by" field. */
.done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--not-done-bg);
  color: var(--not-done-color);
}
.done-toggle input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--done-color); cursor: pointer; }
.done-toggle:has(input:checked) { background: var(--done-bg); color: var(--done-color); }

.done-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}
.done-badge[data-done="true"] { color: var(--done-color); background: var(--done-bg); }
.done-badge[data-done="false"] { color: var(--not-done-color); background: var(--not-done-bg); }

.row-grid { display: grid; gap: 10px; }
.row-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .row-grid-3 { grid-template-columns: 1fr; } }
.item-card .btn-remove { align-self: flex-end; }
.empty-state { color: var(--mute); font-size: 13.5px; font-style: italic; margin: 0 0 10px; }

/* ---- photos (per item) ---------------------------------------------------- */

.item-photos { border-top: 1px dashed var(--line); padding-top: 10px; }
.photo-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.photo-upload-label { cursor: pointer; }
.photo-upload-status { font-size: 13px; color: var(--mute); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 4px; background: var(--paper); }
.photo-card input { font-size: 13px; padding: 7px 9px; min-height: 36px; }
.photo-meta { font-size: 11.5px; color: var(--mute); margin: 0; font-variant-numeric: tabular-nums; }

/* ---- actions / status --------------------------------------------------- */

.action-row { display: flex; gap: 12px; align-items: center; padding-top: 16px; flex-wrap: wrap; }
.reset-confirm { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reset-confirm-text { font-size: 13.5px; color: var(--mute); }
.download-status { min-height: 1.4em; font-size: 13.5px; color: var(--accent); font-weight: 600; margin: 8px 0 0; }
.form-errors { background: var(--danger-bg); border: 1px solid var(--danger); border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; }
.form-errors p { margin: 0 0 4px; font-weight: 700; }
.form-errors ul { margin: 0; padding-left: 18px; }

/* ---- CTA / about / FAQ bands -------------------------------------------- */

.cta-band, .about-band, .faq-band { padding: 36px 20px; border-top: 1px solid var(--line); max-width: var(--max-width); margin: 0 auto; }
.cta-band h2, .about-band h2, .faq-band h2 { font-family: var(--font-ui); font-size: 22px; margin: 0 0 10px; }
.cta-band p, .about-band p { max-width: 68ch; color: var(--mute); }
.cta-band .btn { margin-top: 12px; }
.faq-list { margin: 0; }
.faq-item { margin-bottom: 16px; max-width: 68ch; }
.faq-item dt { font-weight: 700; margin-bottom: 4px; }
.faq-item dd { margin: 0; color: var(--mute); }

a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
