/* Rolling Precision — technician job app. Same brand tokens/fonts as the
   marketing site; layout here is purpose-built for a phone in one hand. */

@font-face {
  font-family: 'Syncopate';
  src: url('assets/syncopate-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('assets/montserrat-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0D0D0D;
  --panel: #1A1A1A;
  --accent: #C9A24B;
  --accent-hover: #E8C97A;
  --text: #F5F1E8;
  --text-dim: rgba(245, 241, 232, 0.62);
  --hair: rgba(245, 241, 232, 0.12);
  --radius: 6px;
  --display: 'Syncopate', sans-serif;
  --sans: 'Montserrat', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--sans);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
/* Syncopate is a display face meant for caps — never render it lowercase/mixed. */
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0; text-transform: uppercase; }
h1 { font-size: 1.5rem; }
h2.section-label { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 1.75rem 0 0.75rem; }
p { margin: 0.5rem 0; }
a { color: var(--accent); }
.muted { color: var(--text-dim); }
.small { font-size: 0.8125rem; }
.error { color: #E88A6A; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1rem; padding-top: calc(0.75rem + env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--hair);
}
.topbar__logo { border-radius: 50%; }
.topbar__title { font-family: var(--display); font-weight: 700; font-size: 0.9375rem; text-transform: uppercase; }
.sync-status { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; color: var(--text-dim); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.sync-dot--synced { background: #7BC48B; }
.sync-dot--pending { background: var(--accent); }
.sync-dot--offline { background: #E88A6A; }

/* ---------- travel banner ----------
   Persistent across every screen while a trip is active, so "Arrived" is
   always one tap away without navigating back into that specific job. */
.travel-banner {
  position: sticky; top: 0; z-index: 9;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem; background: rgba(201,162,75,.14);
  border-bottom: 1px solid rgba(201,162,75,.35);
}
.travel-banner__info {
  flex: 1 1 auto; text-align: left; background: none; border: none; padding: 0;
  color: var(--text); font: 400 0.875rem/1.3 var(--sans); cursor: pointer;
}
.travel-banner__info span { color: var(--text-dim); }

/* ---------- layout ---------- */
.screen { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.screen__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.screen__head h1 { flex: 1 1 auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.65rem 1.1rem;
  font: 600 0.9375rem/1.2 var(--sans);
  border-radius: var(--radius); border: 1px solid var(--hair);
  background: transparent; color: var(--text);
  cursor: pointer; text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.btn--primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn--primary:disabled { background: var(--panel); color: var(--text-dim); border-color: var(--hair); cursor: not-allowed; }
.btn--ghost { background: transparent; border-color: var(--hair); }
.btn--small { min-height: 36px; padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.btn--block { display: flex; width: 100%; margin-top: 1.5rem; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; font-weight: 600; }
.form input, .form select, .form textarea {
  min-height: 44px; padding: 0.65rem 0.8rem; font: 400 1rem/1.4 var(--sans);
  background: var(--panel); color: var(--text); border: 1px solid var(--hair); border-radius: var(--radius);
}
.form textarea { min-height: 88px; resize: vertical; }
.form fieldset { border: 1px solid var(--hair); border-radius: var(--radius); padding: 0.6rem 0.75rem; }
.form legend { padding: 0 0.4rem; font-size: 0.8125rem; color: var(--text-dim); }
/* Compact table — checkbox column right against its label column, two such
   pairs per row (half the vertical space of one-per-row), label text
   unbolded so it doesn't compete with the checkbox. */
.check-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.check-table tr { border-bottom: 1px solid var(--hair); }
.check-table tr:last-child { border-bottom: none; }
.check-table td { padding: 0.4rem 0; font-size: 0.875rem; }
.check-table td.check-cell { width: 28px; padding-right: 0.5rem; }
.check-table td.check-label { padding-right: 1rem; }
.check-table input[type="checkbox"] { width: 18px; height: 18px; display: block; }
.check-table label { font-weight: 400; display: block; }

/* ---------- panels / cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 1rem; margin-top: 0.75rem; }
.panel__title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 0 0 0.6rem; }
.job-header__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.job-number { color: var(--accent); font-weight: 700; font-size: 0.8125rem; }

/* ---------- travel panel ---------- */
.travel-panel { display: flex; flex-direction: column; gap: 0.6rem; }
.travel-timer { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.travel-field { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.travel-field input { width: 90px; min-height: 36px; padding: 0.3rem 0.5rem; background: var(--bg); color: var(--text); border: 1px solid var(--hair); border-radius: var(--radius); font-weight: 400; }
.dashboard-controls { display: flex; gap: 0.6rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.dashboard-controls input[type="search"] {
  flex: 1 1 200px; min-height: 44px; padding: 0.6rem 0.8rem; font: 400 0.9375rem/1.3 var(--sans);
  background: var(--panel); color: var(--text); border: 1px solid var(--hair); border-radius: var(--radius);
}
.dashboard-controls select {
  flex: 0 1 170px; min-height: 44px; padding: 0.6rem 0.8rem; font: 400 0.875rem/1.3 var(--sans);
  background: var(--panel); color: var(--text); border: 1px solid var(--hair); border-radius: var(--radius);
}
.job-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 0.9rem 1rem; margin-bottom: 0.6rem; cursor: pointer; min-height: 44px;
}
.job-row__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex-shrink: 0; }
.badge { font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.badge--pre_inspection { background: rgba(201,162,75,.18); color: var(--accent); }
.badge--checklist { background: rgba(201,162,75,.3); color: var(--accent-hover); }
.badge--walkthrough { background: rgba(232,138,106,.2); color: #E88A6A; }
.badge--complete { background: rgba(123,196,139,.2); color: #7BC48B; }

/* ---------- pre-inspection entries ---------- */
.entry-card { display: flex; flex-direction: column; gap: 0.5rem; }
.entry-card__head { display: flex; flex-direction: column; gap: 0.35rem; }
.tag { align-self: flex-start; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.55rem; border-radius: 999px; background: var(--hair); color: var(--text); }
.suggestion { background: rgba(201,162,75,.1); border: 1px solid rgba(201,162,75,.3); border-radius: var(--radius); padding: 0.6rem 0.75rem; font-size: 0.875rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.add-entry { margin-top: 1rem; }
.add-entry summary { list-style: none; }
.add-entry summary::-webkit-details-marker { display: none; }

/* ---------- checklist ----------
   One flex-wrap row: checkbox, label, note, photo button all flow inline and
   only wrap onto a second line when a long label actually forces it — no
   fixed second row, no indent, so most tasks stay a single compact line. */
.checklist-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; border-bottom: 1px solid var(--hair); padding: 0.6rem 0; }
.checklist-row input[type="checkbox"] { width: 22px; height: 22px; flex-shrink: 0; min-height: 0; }
.checklist-row__label { flex: 1 1 140px; min-height: 44px; display: flex; align-items: center; }
.checklist-row__note {
  flex: 1 1 120px; min-width: 0; min-height: 36px;
  padding: 0.4rem 0.6rem; font-size: 0.8125rem;
  background: var(--panel); color: var(--text); border: 1px solid var(--hair); border-radius: var(--radius);
}
.checklist-row__note-readout { flex: 1 1 120px; font-size: 0.8125rem; }
.photo-btn { position: relative; flex-shrink: 0; }
.checklist-row .thumb-strip { flex-basis: 100%; padding-left: 1.9rem; margin-top: 0; }

/* ---------- photos ---------- */
.thumb-strip { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; padding-left: 2.1rem; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--hair); }
.thumb--pending { opacity: 0.55; }
.entry-card .thumb-strip { padding-left: 0; }

/* ---------- walkthrough ---------- */
.walkthrough-steps { padding-left: 1.25rem; margin: 1rem 0; }
.walkthrough-steps li { margin-bottom: 0.5rem; }
.signature-pad { width: 100%; height: 180px; background: var(--panel); border: 1px dashed var(--hair); border-radius: var(--radius); touch-action: none; margin-top: 0.5rem; }
.signature-preview { max-width: 240px; background: var(--panel); border-radius: var(--radius); margin-top: 0.5rem; display: block; }
/* Printed name under the signature line, like a paper sign-off block. */
.signature-name { margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px solid var(--hair); text-align: center; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--accent); color: var(--bg); font-weight: 600; font-size: 0.875rem;
  padding: 0.75rem 1.1rem; border-radius: var(--radius); z-index: 100; max-width: 90vw; text-align: center;
}

/* ---------- login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-card { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 2rem 1.5rem; max-width: 360px; width: 100%; text-align: center; }
.login-card img { border-radius: 50%; margin-bottom: 0.75rem; }
.login-card .form { text-align: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
