/* 4R Wilmer safety portal: 4R Contractors brand layer. Loaded after style.css.
   4R blue #2A2B7C (logo), near-black #161616 and cream #F9EBC8 (4rcontractors.com), League Spartan headings. */
@font-face { font-family: "League Spartan"; src: url(/fonts/league-spartan.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
:root {
  --brand-blue: #2a2b7c;
  --brand-blue-ink: #2a2b7c;
  --brand-blue-deep: #1e1f5c;
  --brand-cream: #f9ebc8;
  --brand-tint: #ededf6;
  --brand-charcoal: #1b1b1b;
  --brand-night: #161616;
  --brand-muted: #636a66;
}
:focus-visible { outline-color: var(--brand-blue); }
a { color: #2a2b7c; }

/* Sidebar */
.sidebar { background: linear-gradient(180deg, #1b1b1b 0%, var(--brand-night) 100%); }
.sidebar .brand { width: 112px; background: transparent; padding: 0; border-radius: 0; margin: 2px 0 10px 8px; display: block; }
.brand-caption { color: #a9bbb2; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 700; margin: 0 0 6px 8px; }
.sidebar .nav-label { color: #8fa59a; margin: 16px 0 4px 10px; }
.sidebar .nav button:hover { background: rgba(255, 255, 255, 0.07); }
.sidebar .nav button.active { background: rgba(249, 235, 200, 0.14); box-shadow: inset 3px 0 var(--brand-cream); color: #fff; }
.sidebar .nav button.active .icon { color: var(--brand-cream); }
.sidebar .avatar { background: var(--brand-blue-deep); }

/* Hero and buttons */
.hero { background: #1b1b1b; box-shadow: inset 0 4px 0 var(--brand-cream); }
.hero .eyebrow, .login-story .eyebrow { color: var(--brand-cream); }
.hero-side strong { color: #fff; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero .actions .btn { margin-top: 0; }
.btn.primary { background: var(--brand-blue-ink); border-color: var(--brand-blue-ink); color: #fff; }
.btn.primary:hover { background: var(--brand-blue-deep); border-color: var(--brand-blue-deep); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.panel .btn.ghost, .reg-filters .btn.ghost { color: var(--brand-charcoal); border-color: #cbd3ce; }

/* Clickable metrics */
button.metric { font: inherit; text-align: left; width: 100%; cursor: pointer; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
button.metric:hover { border-color: var(--brand-blue); box-shadow: 0 2px 10px rgba(42, 43, 124, 0.12); }
.metric > strong { color: var(--brand-charcoal); }

/* Login */
.login-story { background: linear-gradient(160deg, #1b1b1b 0%, var(--brand-night) 70%); box-shadow: inset 6px 0 var(--brand-blue); }
.login-story .line { background: var(--brand-blue); }
.login-mark { width: 128px; display: block; margin-bottom: 26px; }
.login-box img { width: 132px; height: auto; }

/* Compliance register */
.reg-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.reg-chip.gap { background: #fdecec; color: #a31923; }
.reg-chip.progress { background: #fff4d6; color: #795600; }
.reg-chip.done { background: #e3f5ec; color: var(--brand-blue-deep); }
.reg-chip.pending { background: #eef1ef; color: #4f5652; }
.reg-chip.na { background: #f2f2f2; color: #666; }
.reg-bar { display: flex; gap: 2px; height: 10px; width: 180px; max-width: 100%; }
.reg-bar span { display: block; flex: 1; height: 100%; border-radius: 2px; }
.reg-bar .done { background: var(--brand-blue); }
.reg-bar .progress { background: #f2b705; }
.reg-bar .gap { background: #d8252c; }
.reg-bar .pending { background: #b8c2bc; }
.reg-bar .na { background: #dadada; }
.reg-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 4px 0 16px; }
.reg-filters .field { margin: 0; min-width: 200px; }
.reg-filters .grow { flex: 1; }
.reg-area .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.reg-table td { vertical-align: top; }
.reg-table td:first-child { min-width: 280px; }
.reg-table td strong { font-weight: 600; }
.reg-evidence { display: block; margin-top: 4px; color: var(--brand-muted); }
.reg-link { display: flex; width: fit-content; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; }
.reg-link .icon { width: 14px; height: 14px; }
.reg-cite { font-size: 12px; max-width: 220px; }
.reg-late { display: block; color: #a31923; font-weight: 700; font-size: 11px; margin-top: 2px; }
.reg-table tr.overdue td { background: #fffafa; }
.reg-edit { display: block; margin-top: 6px; padding: 3px 8px; font-size: 12px; }
.reg-note { color: var(--brand-muted); font-size: 12px; max-width: 900px; }
.muted { color: var(--brand-muted); }
.reg-hero h2 { max-width: 640px; }

/* Overview snapshot */
.panel-body.tight { padding-top: 6px; }
.finding-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; background: none; border: 0; border-bottom: 1px solid #e0e6e2; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.finding-row:hover { background: var(--brand-tint); }
.finding-no { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--brand-blue-ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.finding-main { flex: 1; min-width: 0; }
.finding-main strong { display: block; font-weight: 600; }
.finding-main small { color: var(--brand-muted); }
.area-table td, .area-table th { padding: 8px 12px; }
.area-table .num { text-align: right; width: 84px; white-space: nowrap; }

@media (max-width: 900px) {
  .sidebar .brand { width: 66px; margin: 0 0 6px 4px; }
  .reg-table td:first-child { min-width: 220px; }
  .reg-filters .field { min-width: 100%; }
}
@media print {
  .reg-edit, .reg-link, .reg-filters { display: none !important; }
  .hero { box-shadow: none; }
}

/* ===== Release 1.2.1: 4R photography, motion and visual cues =====
   Photos are 4R Contractors' own project photos from 4rcontractors.com. None is the Wilmer site.
   Motion is subtle, replays only on page change (motion.js) and is removed for prefers-reduced-motion. */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes ux-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-2%, -1%); } }
@keyframes ux-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ux-seg { from { opacity: 0; transform: scaleY(0.1); } to { opacity: 1; transform: none; } }
@keyframes ux-pulse { 0% { box-shadow: 0 0 0 0 rgba(163, 25, 35, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(163, 25, 35, 0); } 100% { box-shadow: 0 0 0 0 rgba(163, 25, 35, 0); } }

.page-head .eyebrow { color: var(--brand-blue-ink); }

/* Photo heroes (overview, register). The border sits outside the clipped padding box, so the green line stays on top. */
.hero.photo { isolation: isolate; min-height: 200px; background: var(--brand-night); box-shadow: none; border-top: 4px solid var(--brand-cream); }
.hero.photo::before { content: ""; position: absolute; inset: -3%; z-index: -2; background-position: center; background-size: cover; background-repeat: no-repeat; animation: ux-drift 26s ease-in-out infinite alternate; will-change: transform; }
.hero.photo::after { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; z-index: -1; background: linear-gradient(100deg, rgba(22, 22, 22, 0.97) 0%, rgba(22, 22, 22, 0.9) 40%, rgba(22, 22, 22, 0.55) 74%, rgba(22, 22, 22, 0.35) 100%); }
.photo-grader::before { background-image: url(/photos/grader.jpg); background-position: center 60%; }
.photo-aerial::before { background-image: url(/photos/pad-aerial.jpg); }
.hero.photo .hero-side { background: rgba(22, 22, 22, 0.6); border-left: 3px solid var(--brand-cream); border-radius: 8px; padding: 14px 18px; }

/* Page header bands over 4R facility photos */
.page-head.band { position: relative; isolation: isolate; overflow: hidden; color: #fff; padding: 24px 28px; min-height: 120px; border-radius: 10px; border-top: 4px solid var(--brand-cream); background: var(--brand-night); }
.page-head.band::before { content: ""; position: absolute; inset: -3%; z-index: -2; background-position: center; background-size: cover; background-repeat: no-repeat; animation: ux-drift 28s ease-in-out infinite alternate; will-change: transform; }
.page-head.band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(22, 22, 22, 0.96) 0%, rgba(22, 22, 22, 0.86) 46%, rgba(22, 22, 22, 0.42) 100%); }
.page-head.band h1 { color: #fff; }
.page-head.band p { color: #d6ddd9; }
.page-head.band .eyebrow { color: var(--brand-cream); }
.band-pad::before { background-image: url(/photos/pad-aerial-wide.jpg); }
.band-grade::before { background-image: url(/photos/grade-wide.jpg); }
.band-excavator::before { background-image: url(/photos/excavator.jpg); background-position: center 40%; }
.band-earthwork::before { background-image: url(/photos/earthwork.jpg); }
.band-aerial::before { background-image: url(/photos/pad-aerial.jpg); }

/* Sign-in story over the 4R plant */
.login-story.photo { isolation: isolate; overflow: hidden; box-shadow: none; border-left: 6px solid var(--brand-cream); }
.login-story.photo::before { content: ""; position: absolute; inset: -3%; z-index: -2; background: url(/photos/grader.jpg) center / cover no-repeat; animation: ux-drift 30s ease-in-out infinite alternate; will-change: transform; }
.login-story.photo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, rgba(27, 27, 27, 0.94) 0%, rgba(22, 22, 22, 0.86) 55%, rgba(42, 43, 124, 0.5) 100%); }

/* Entrance: sections rise in sequence on page change */
.ux-enter > .page-head, .ux-enter > section, .ux-enter > .metrics, .ux-enter > .panel, .ux-enter > .grid, .ux-enter > .filters, .ux-enter > .notice, .ux-enter > .reg-note { animation: ux-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.ux-enter > :nth-child(3) { animation-delay: 0.05s; }
.ux-enter > :nth-child(4) { animation-delay: 0.1s; }
.ux-enter > :nth-child(5) { animation-delay: 0.15s; }
.ux-enter > :nth-child(6) { animation-delay: 0.2s; }
.ux-enter > :nth-child(7) { animation-delay: 0.25s; }
.ux-enter > :nth-child(n + 8) { animation-delay: 0.3s; }
.ux-enter .metrics > * { animation: ux-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.ux-enter .metrics > :nth-child(2) { animation-delay: 0.16s; }
.ux-enter .metrics > :nth-child(3) { animation-delay: 0.22s; }
.ux-enter .metrics > :nth-child(4) { animation-delay: 0.28s; }
.ux-enter .reg-bar span { animation: ux-seg 0.35s ease-out backwards; animation-delay: calc(var(--i, 0) * 14ms + 0.25s); transform-origin: bottom; }

/* Hover cues */
.sidebar .nav button { transition: background 0.2s, box-shadow 0.2s, color 0.2s; }
button.metric { transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
button.metric:hover { transform: translateY(-2px); }
.reg-table tbody tr td { transition: background 0.15s; }
.reg-table tbody tr:hover td { background: #f6f6fb; }

/* Register: status edge on each requirement */
.reg-table tr.st-gap td:first-child { box-shadow: inset 4px 0 #d8252c; }
.reg-table tr.st-progress td:first-child { box-shadow: inset 4px 0 #f2b705; }
.reg-table tr.st-done td:first-child { box-shadow: inset 4px 0 var(--brand-blue); }
.reg-table tr.st-pending td:first-child { box-shadow: inset 4px 0 #b8c2bc; }
.reg-table tr.st-na td:first-child { box-shadow: inset 4px 0 #dadada; }

/* Findings: priority edge and due countdown */
.finding-row { border-left: 4px solid transparent; padding-left: 10px; transition: background 0.15s, transform 0.15s; }
.finding-row:hover { transform: translateX(3px); }
.finding-row.pri-urgent { border-left-color: #d8252c; }
.finding-row.pri-high { border-left-color: #f2b705; }
.finding-row.pri-routine { border-left-color: var(--brand-blue); }
.due-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; margin-right: 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.due-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.due-chip.late { background: #fdecec; color: #a31923; }
.due-chip.late::before { animation: ux-pulse 1.6s ease-out infinite; }
.due-chip.soon { background: #fff4d6; color: #795600; }
.due-chip.later { background: var(--brand-tint); color: var(--brand-blue-deep); }

/* Program progress rings */
.progress-panel .panel-head small { font-size: 12px; }
.ring-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; padding: 4px 20px 20px; }
.ring-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e0e6e2; border-radius: 10px; background: linear-gradient(180deg, #fff, #f6faf8); }
.ring { --p: 0; position: relative; display: grid; place-items: center; width: 74px; height: 74px; flex: 0 0 74px; border-radius: 50%; background: conic-gradient(var(--brand-blue) calc(var(--p) * 1%), #e3e9e5 0); transition: --p 1.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.ring > span { position: relative; font-size: 18px; font-weight: 750; color: var(--brand-charcoal); }
.ring > span small { font-size: 11px; color: var(--brand-muted); }
.ring-card > div > strong { display: block; font-size: 17px; }
.ring-card > div > span { display: block; font-weight: 600; }
.ring-card > div > small { color: var(--brand-muted); }

/* Evidence photos on a work item (assessment photos and uploads) */
.evidence-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.evidence-thumb { display: block; overflow: hidden; border: 1px solid #dfe5e1; border-radius: 8px; background: #f6f8f7; color: inherit; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.evidence-thumb img { display: block; width: 100%; height: 112px; object-fit: cover; }
.evidence-thumb span { display: block; padding: 6px 8px; overflow: hidden; color: var(--brand-muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.evidence-thumb:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); }

@media (max-width: 900px) {
  .page-head.band { padding: 18px; min-height: 0; }
  .finding-row { flex-wrap: wrap; }
  .finding-row .finding-main { flex-basis: calc(100% - 44px); }
  .ring-row { padding: 4px 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero.photo::before, .page-head.band::before, .login-story.photo::before, .due-chip.late::before { animation: none; }
  .ux-enter > *, .ux-enter .metrics > *, .ux-enter .reg-bar span { animation: none !important; }
  .ring { transition: none; }
  .finding-row:hover, button.metric:hover, .evidence-thumb:hover { transform: none; }
}
@media print {
  .hero.photo::before, .hero.photo::after, .page-head.band::before, .page-head.band::after { display: none; }
  .page-head.band { color: inherit; background: none; border-top: 0; padding: 0; min-height: 0; }
  .page-head.band h1, .page-head.band p { color: inherit; }
  .evidence-gallery { display: none; }
}

/* File rows: put size and date under the file name */
.row-main > a + small { display: block; margin-top: 2px; }

/* ===== Release 1.2.2: sign-in help and access requests ===== */
.login-alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 6px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; color: #2a2b7c; font: inherit; font-size: 13px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--brand-blue-deep); }
.link-btn .icon { width: 14px; height: 14px; transform: scaleX(-1); }
.login-box .btn.request-btn { width: auto; min-height: 38px; margin: 0; background: #fff; color: var(--brand-blue-ink); border: 1px solid #c5c6e3; }
.login-box .btn.request-btn:hover { background: var(--brand-tint); }
.login-box .support a { color: #2a2b7c; }
.login-box .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.login-box textarea { width: 100%; }
.login-done { display: grid; place-items: center; width: 48px; height: 48px; margin: -18px 0 14px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-blue-ink); }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--brand-blue); color: #fff; font-size: 11px; font-weight: 750; text-align: center; }
.access-reminder { display: flex; align-items: center; gap: 12px; margin: -6px 0 20px; }
.access-reminder span { flex: 1; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.access-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid #dfe5e1; border-left: 4px solid #f2b705; border-radius: 10px; background: #fff; }
.access-who { display: flex; gap: 12px; align-items: flex-start; }
.access-who .avatar { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-blue-deep); color: #fff; font-weight: 700; }
.access-who strong, .access-who small { display: block; }
.access-note { margin: 0; padding: 10px 12px; border-radius: 8px; background: #f6f8f7; color: #4f5652; font-size: 13px; }
.access-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.access-locs { border: 0; padding: 0; margin: 0 0 12px; }
.access-locs legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.access-locs .check { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 400; }
@media (max-width: 900px) {
  .login-box .form-grid { grid-template-columns: 1fr; }
  .access-grid { grid-template-columns: 1fr; }
}

/* ===== Release 1.4.0: request training or services ===== */
.sr-form [hidden] { display: none !important; }
.sr-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; margin: 0 0 16px; }
.sr-kind legend { padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 650; }
.sr-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #dfe5e1; border-radius: 10px; background: #fff; cursor: pointer; }
.sr-option input { width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--brand-blue-ink); }
.sr-option strong, .sr-option small { display: block; }
.sr-option small { color: var(--brand-muted); font-size: 12px; }
.sr-option:has(input:checked) { border-color: var(--brand-blue-ink); box-shadow: inset 0 0 0 1px var(--brand-blue-ink); background: #f3f3fa; }
.sr-option:has(input:focus-visible) { outline: 2px solid var(--brand-blue-ink); outline-offset: 2px; }
.sr-summary { margin: 8px 0 16px; }
.sr-summary strong { font-size: 15px; }
.sr-summary small { display: block; color: var(--brand-muted); }
@media (max-width: 900px) {
  .sr-kind { grid-template-columns: 1fr; }
}

/* ===== 4R brand details ===== */
h1, h2, .hero h2, .login-story h1, .page-head h1, .panel-head h2, .login-box h2 { font-family: "League Spartan", Workspace, "Segoe UI", Arial, sans-serif; letter-spacing: 0; }
.hero h2, .login-story h1 { font-weight: 700; line-height: 1.05; }
/* The 4R logo is blue and black on transparent. On dark surfaces show it as a white knockout. */
.sidebar .brand, .login-mark { filter: brightness(0) invert(1); }
.sidebar .brand { width: 124px; }
.login-mark { width: 168px; }
.login-box img { width: 150px; }
.login-story .line { background: var(--brand-cream); }
/* Primary buttons on dark photo surfaces use 4R's cream so they read against near-black. */
.hero .btn.primary { background: var(--brand-cream); border-color: var(--brand-cream); color: #161616; }
.hero .btn.primary:hover { background: #fff; border-color: #fff; color: #161616; }
