/* Mr. Handyman — Employee Portal
   Matches the gated ops/csr/tech sites: brand red #c8102e, warm off-white
   background #f4f4f2, white cards, 10px radius, clean system type. */

:root {
  --red: #c8102e;
  --red-dark: #a50d26;
  --red-bright: #e5323e;
  --ink: #1a1a1a;
  --muted: #666;
  --faint: #777;
  --bg: #f4f4f2;
  --line: #e2e2de;
  --teal: #1f4e5f;
  --green: #2e7d32;
  --amber: #b97d0a;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a { color: var(--red-dark); }
img { max-width: 100%; }

/* ---------- Header band ---------- */

.site-header {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.site-header .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-header .logo-pill {
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.site-header .logo-pill img { height: 46px; width: auto; display: block; }
.site-header .site-title { line-height: 1.15; }
.site-header .site-title .brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .01em;
  color: #fff;
  text-decoration: none;
}
.site-header .site-title .sub {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  color: #fff;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 7px;
}
.site-nav a:hover { background: rgba(255, 255, 255, .16); }
.site-nav a[aria-current="page"] { background: rgba(0, 0, 0, .22); }
.site-nav a.nav-office { font-size: .82rem; font-weight: 500; opacity: .85; }

/* ---------- Layout ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 20px 56px;
}

.page-head { margin: 4px 0 18px; }
.page-head h1 { font-size: 1.7rem; margin: 0 0 4px; font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); max-width: 46rem; }

h2.section-title {
  font-size: 1.02rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #444;
  margin: 30px 0 12px;
}
h2.section-title:first-child { margin-top: 6px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: .85rem;
}
.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 20px 30px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* ---------- Hero & banners ---------- */

.hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #7d0a1e center / cover no-repeat;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow);
}
.hero .hero-copy {
  position: relative;
  width: 100%;
  padding: 64px 28px 26px;
  color: #fff;
  background: linear-gradient(to top, rgba(90, 4, 18, .88) 0%, rgba(90, 4, 18, .45) 55%, rgba(90, 4, 18, 0) 100%);
}
.hero h1 { margin: 0 0 6px; font-size: 2.1rem; font-weight: 800; line-height: 1.15; }
.hero p { margin: 0; max-width: 38rem; font-size: 1.02rem; color: rgba(255, 255, 255, .94); }

.banner {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  background: #ddd;
}
.banner img { display: block; width: 100%; height: 210px; object-fit: cover; }
@media (max-width: 640px) { .banner img { height: 140px; } .hero h1 { font-size: 1.6rem; } }

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.cards.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0 0 8px; color: #333; }
.card p:last-child { margin-bottom: 0; }
.card .small, .small { font-size: .88rem; color: var(--muted); }
.card ul { margin: 6px 0 0; padding-left: 1.15rem; }
.card li { margin: 4px 0; }
.card .icon { font-size: 1.5rem; line-height: 1; display: block; margin-bottom: 10px; }

a.card { text-decoration: none; color: inherit; display: block; transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease; }
a.card:hover { border-color: var(--red); box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 8px 22px rgba(200,16,46,.12); transform: translateY(-1px); }
a.card .go { color: var(--red); font-weight: 700; font-size: .92rem; }
a.card.secondary { box-shadow: none; background: #fafaf8; }
a.card.secondary h3 { font-size: .98rem; }

.card.feature {
  border: 2px solid var(--red);
  background: linear-gradient(180deg, #fff 0%, #fdf3f4 100%);
}
.card.feature h3 { font-size: 1.2rem; }

.btn {
  display: inline-block;
  background: var(--red);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--red-dark); }
.btn.secondary {
  background: #fff;
  color: var(--ink) !important;
  border: 1px solid #c9c9c4;
}
.btn.secondary:hover { background: #f0f0ec; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Lists / handbook ---------- */

.policy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.policy-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.policy-list li b { display: block; margin-bottom: 2px; }
.policy-list li span { color: #444; font-size: .95rem; }

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.link-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.link-list a:hover { border-color: var(--red); }
.link-list a b { display: block; }
.link-list a span { color: var(--muted); font-size: .9rem; }
.link-list a .go { color: var(--red); font-weight: 700; white-space: nowrap; }

/* ---------- Forms ---------- */

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 5px; }
.field label .req { color: var(--red); }
.field label .opt { color: var(--faint); font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="date"], .field input[type="number"], .field input[type="password"],
.field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9c9c4;
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 74px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(200, 16, 46, .35);
  border-color: var(--red);
}
.field .hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); background: #fdf6f6; }
.field .field-error { display: none; color: var(--red-dark); font-size: .85rem; margin-top: 4px; font-weight: 600; }
.field.invalid .field-error { display: block; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.check, .radio {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; font-size: .97rem; cursor: pointer;
}
.check input, .radio input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--red); flex: 0 0 auto; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px 14px; margin: 0 0 16px; }
legend { font-weight: 700; font-size: .95rem; padding: 0 6px; }

input[type="file"] { font: inherit; font-size: .95rem; }
.file-field {
  border: 1.5px dashed #c9c9c4; border-radius: 8px; padding: 14px 16px; background: #fafaf8;
}
.file-field.invalid { border-color: var(--red); background: #fdf6f6; }

.notice {
  border-radius: 8px; padding: 12px 16px; font-size: .95rem; margin: 0 0 16px;
  background: #f0f4f9; border-left: 5px solid #5b7fa6;
}
.notice.warn { background: #fdf8ec; border-left-color: #e6a817; }

.result { display: none; border-radius: 8px; padding: 14px 16px; margin-top: 16px; font-size: .97rem; }
.result.show { display: block; }
.result.ok { background: #eef7ee; border: 1px solid var(--green); }
.result.err { background: #fdf1f2; border: 1px solid var(--red); }

/* ---------- Onboarding wizard ---------- */

.progress { margin: 0 0 20px; }
.progress ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.progress li {
  text-align: center; font-size: .78rem; font-weight: 600; color: var(--faint);
  padding-top: 10px; position: relative;
}
.progress li::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  border-radius: 3px; background: #e4e4e0;
}
.progress li.done { color: var(--green); }
.progress li.done::before { background: var(--green); }
.progress li.current { color: var(--red-dark); }
.progress li.current::before { background: var(--red); }
@media (max-width: 640px) { .progress li span { display: none; } .progress li.current span { display: inline; } }

.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-step h2 { margin: 0 0 4px; font-size: 1.3rem; }
.wizard-step .step-sub { color: var(--muted); margin: 0 0 18px; }
.wizard-nav {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.conditional { display: none; }
.conditional.show { display: block; }

/* ---------- Office queue ---------- */

.badge {
  display: inline-block; font-size: .78rem; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.badge.kind-packet { background: #fde8eb; color: var(--red-dark); }
.badge.kind-upload { background: #e8eef4; color: var(--teal); }
.badge.drive-ok { background: #e6f2e6; color: var(--green); }
.badge.drive-pending { background: #fdf3d7; color: var(--amber); }
.badge.drive-failed, .badge.drive-error { background: #fde8eb; color: var(--red-dark); }
.badge.drive-other { background: #eee; color: #555; }

.queue-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table.queue { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); min-width: 640px; }
table.queue th, table.queue td { padding: 10px 14px; text-align: left; font-size: .93rem; vertical-align: top; }
table.queue thead th { background: var(--teal); color: #fff; font-weight: 600; }
table.queue tbody tr:nth-child(even) { background: #f8f8f6; }
table.queue ul.file-links { list-style: none; margin: 0; padding: 0; }
table.queue ul.file-links li { margin: 2px 0; }

.empty-state, .error-state {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 22px; text-align: center; color: var(--muted); box-shadow: var(--shadow);
}
.error-state { border-color: var(--red); background: #fdf6f6; color: var(--ink); }
