/* Freedom Net portal. Mobile first, one column of cards. */

:root {
  --navy: #0e2238;
  --navy-2: #16314d;
  --blue: #1459c7;
  --blue-dark: #0e3f8f;
  --blue-soft: #e6effc;
  --bg: #f4f7fa;
  --card: #ffffff;
  --line: #d9e1ea;
  --line-2: #c5d0dc;
  --ink: #0e2238;
  --muted: #55657a;
  --good: #0b5a32;
  --good-bg: #e3f4ea;
  --good-line: #9fd4b3;
  --warn: #5a3700;
  --warn-bg: #fff1d6;
  --warn-line: #c27a00;
  --warn-soft: #fff8e8;
  --bad: #8a1c1c;
  --bad-bg: #fde8e8;
  --radius: 14px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; font-size: 16px; line-height: 1.45; }

/* Header */
.topbar { background: var(--navy); color: #fff; padding: 16px 16px 14px; padding-top: max(16px, env(safe-area-inset-top)); }
.topbar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 720px; margin: 0 auto; }
.brand { font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { border-radius: 8px; }
.topbar-btn { min-height: 44px; padding: 0 12px; background: none; border: 1px solid #4a6683; border-radius: 8px; color: #fff; font-weight: 500; font-size: 14px; font-family: inherit; }
.screen-title { margin: 6px auto 0; max-width: 720px; font-size: 24px; line-height: 1.2; }
.screen-sub { margin: 4px auto 0; max-width: 720px; color: #bfd6f5; font-size: 14px; }
.tabs { display: flex; gap: 4px; max-width: 720px; margin: 10px auto 0; overflow-x: auto; }
.tabs button { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: #bfd6f5; font-weight: 600; font-size: 15px; font-family: inherit; white-space: nowrap; }
.tabs button[aria-current="true"] { color: #fff; border-bottom-color: #6fb0ff; }

/* Layout: one column, full width, one card per line */
.page { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: 1fr; gap: 14px; align-content: start; }
.stack, .stack-tight { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stack-tight { gap: 4px; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; padding: 0; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 1fr; gap: 10px; }
.card h2, .card h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-strong { border: 2px solid var(--blue); }
.card-good { background: var(--good-bg); border-color: var(--good-line); color: #16402a; }
.card-warn { border: 2px solid var(--warn-line); }
.card-muted { opacity: 0.8; }
.card[hidden], [hidden] { display: none !important; }
.row-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #e6ecf2; padding-top: 10px; }
.job-line { border-top: 1px solid #e6ecf2; padding-top: 8px; }
.signin { text-align: center; justify-items: center; }
.signin .stack { width: 100%; }
.logo { border-radius: 16px; }

/* Text */
h1 { font-size: 24px; margin: 4px 0; }
h2 { font-size: 18px; margin: 8px 0 0; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.meta { color: var(--muted); font-size: 13px; }
.strong { font-weight: 600; }
.center { text-align: center; }
.statement { font-size: 16px; line-height: 1.55; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; background: var(--blue-soft); color: var(--blue-dark); border-radius: 999px; padding: 2px 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Notices and badges */
.notice { border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.45; font-weight: 500; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-warn { background: var(--warn-bg); color: var(--warn); }
.notice-bad { background: var(--bad-bg); color: var(--bad); }
.badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--blue-soft); color: var(--blue-dark); }
.badge-muted { background: #e9eef3; color: var(--muted); }

/* Buttons */
.btn { min-height: 48px; border-radius: 12px; border: 0; padding: 0 16px; font-weight: 700; font-size: 15px; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; width: 100%; }
.btn:disabled { background: #b8c3d0 !important; color: #3a4756 !important; border-color: #b8c3d0 !important; cursor: not-allowed; }
.btn-big { min-height: 56px; font-size: 17px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-secondary { background: #fff; color: var(--blue-dark); border: 2px solid var(--blue); }
.btn-warn { background: var(--warn-soft); color: var(--warn); border: 2px solid var(--warn-line); }
.btn-warn-outline { background: var(--warn-soft); color: var(--warn); border: 2px dashed var(--warn-line); width: auto; font-size: 14px; min-height: 44px; }
.btn-danger { background: #fff; color: var(--bad); border: 2px solid var(--bad); }
.btn-quiet { background: none; color: var(--blue-dark); font-weight: 600; }
.link { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--blue); font-weight: 600; font-size: 14px; font-family: inherit; text-align: left; cursor: pointer; }
.file-btn { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, label:focus-within { outline: 3px solid #6fb0ff; outline-offset: 2px; }

/* Forms */
label { font-size: 14px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px;
  font-weight: 400; font-size: 16px; font-family: inherit; color: var(--ink); background: #fff;
}
input[readonly] { background: var(--bg); }
textarea { resize: vertical; }
.field { display: grid; gap: 4px; border-top: 1px solid #e6ecf2; padding-top: 10px; }
.field.inline { border: 0; padding: 0; }
.label { font-size: 14px; font-weight: 600; }
.choice { display: flex; gap: 12px; align-items: center; min-height: 44px; font-weight: 400; font-size: 15px; }
.choice input { width: 22px; height: 22px; flex-shrink: 0; }
.choice.locked { color: #7a8899; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; background: #fff; color: var(--ink); border: 1px solid var(--line-2); font-weight: 600; font-size: 15px; font-family: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue-dark); border: 2px solid var(--blue); font-weight: 700; }

/* Closeout */
.sticky-progress { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; display: flex; justify-content: space-between; }
.script { margin: 0; background: var(--navy); color: #e6effc; border-radius: 10px; padding: 12px 14px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.photo-row { border-top: 1px solid #e6ecf2; padding-top: 10px; display: grid; gap: 8px; }
.photo-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; }
.thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #c9d6e4; display: block; }
.thumb-x { position: absolute; top: -8px; right: -8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.sigpad { width: 100%; height: 160px; border: 2px dashed #8a9aad; border-radius: 12px; background: #fff; touch-action: none; display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.tick { font-weight: 700; }

/* Owner */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.stat-n { font-size: 26px; }
.shot { width: 120px; height: auto; border-radius: 8px; border: 1px solid var(--line); }

/* Footer, dialogs, toast */
.footer { max-width: 720px; width: 100%; margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; color: var(--muted); font-size: 13px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.modal { width: min(680px, calc(100vw - 24px)); max-height: 85vh; border: 0; border-radius: 16px; padding: 16px; background: var(--bg); }
.modal::backdrop { background: rgba(14, 34, 56, 0.5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal-head .btn { width: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); transition: transform 0.2s; z-index: 10; }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Contractors */
.count { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: #8a1c1c; color: #fff; font-size: 12px; font-weight: 700; margin-left: 4px; }
.kv { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #e6ecf2; padding: 8px 0; font-size: 15px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.steps { display: grid; gap: 12px; }
.step { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid #e6ecf2; padding-top: 12px; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.step-n.done { background: #0b6b3a; }
.step-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.btn-inline { width: auto; justify-self: start; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions .btn { width: auto; }
.linkbox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-grid img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #c9d6e4; }
.upload-row { display: grid; gap: 6px; border-top: 1px solid #e6ecf2; padding-top: 10px; }
.upload-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.upload-head .btn { width: auto; }
.btn-good { background: #fff; color: var(--good); border: 2px solid #0b6b3a; }
details.card summary { cursor: pointer; min-height: 32px; }

/* Contractor photo previews and the full-size viewer */
.photo-list { display: flex; flex-direction: column; }
.photo-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.photo-row:first-child { border-top: 0; }
.thumb-btn { padding: 0; width: 132px; height: 96px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--bg); cursor: zoom-in; flex-shrink: 0; }
.thumb-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.thumb-btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-info { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(14, 34, 56, 0.85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox-inner { background: var(--card); border-radius: var(--radius); padding: 14px; width: min(960px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.lightbox-head { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.lightbox-inner img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; object-fit: contain; }


/* Footage check helper under Drop Length */
.footage-help { margin-top: 8px; }
.notice-good { background: var(--good-bg); color: var(--good); }
.footage-help .btn-inline { margin-top: 8px; }
