/* Government-style design system for the Department of Approvals demo.
   Navy/blue palette, official layout shell, WCAG 2.1 AA focus and contrast. */
:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #1b1b1b;
  --muted: #565c65;
  --line: #c9d2dd;

  --navy-900: #0b1f3a;
  --navy-800: #162e51; /* header masthead */
  --navy-700: #1a4480; /* primary brand */
  --blue-600: #005ea2; /* links / primary buttons */
  --blue-500: #2672de;
  --blue-100: #e7f0fb;
  --focus: #2491ff;

  --ok: #1a7f47;
  --ok-bg: #ecf3ec;
  --warn: #8c6c00;
  --warn-bg: #faf3d1;
  --err: #b50909;
  --err-bg: #f8eff0;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.08), 0 4px 12px rgba(11, 31, 58, 0.06);
  --content-max: 960px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- accessibility utilities ---- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy-800);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

a { color: var(--blue-600); }
a:hover { color: var(--navy-700); }

/* ---- header / layout shell ---- */
.utility-bar {
  background: var(--navy-900);
  color: #dfe6ef;
  font-size: 0.8rem;
}
.utility-inner, .masthead-inner, .footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.35rem 1.25rem;
}
.utility-note { display: inline-flex; align-items: center; gap: 0.4rem; }
.flag { color: #f0c419; }

.masthead { background: var(--navy-800); color: #fff; }
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}
.seal {
  display: inline-grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  background: #fff;
  color: var(--navy-800);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border: 2px solid #f0c419;
}
.seal-sm { width: 2rem; height: 2rem; font-size: 0.7rem; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark-title { font-weight: 700; font-size: 1.1rem; }
.wordmark-sub { font-size: 0.8rem; color: #c7d3e2; }

.user-bar { display: flex; align-items: center; gap: 0.85rem; }
.user-meta { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-name { font-weight: 600; }
.user-role { font-size: 0.78rem; color: #c7d3e2; text-transform: uppercase; letter-spacing: 0.04em; }
.sign-out { color: #fff; border-color: #ffffff66; background: transparent; }
.sign-out:hover { background: #ffffff1a; }

/* primary nav */
.gov-nav { background: var(--navy-700); }
.nav-list {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.nav-list a {
  display: block;
  padding: 0.75rem 1rem;
  color: #eaf1fb;
  text-decoration: none;
  border-bottom: 4px solid transparent;
  font-weight: 600;
}
.nav-list a:hover { background: #ffffff14; color: #fff; }
.nav-list a.active { border-bottom-color: #f0c419; background: #ffffff1a; color: #fff; }

/* breadcrumbs */
.breadcrumbs { background: #fff; border-bottom: 1px solid var(--line); }
.crumbs {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.crumbs li + li::before { content: "›"; margin-right: 0.4rem; color: var(--muted); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* main content */
.content { flex: 1 0 auto; }
.view { max-width: var(--content-max); margin: 0 auto; padding: 1.5rem 1.25rem; }

/* footer */
.gov-footer { background: var(--navy-900); color: #cdd6e2; margin-top: 2rem; }
.footer-inner { padding-top: 1.25rem; padding-bottom: 1.5rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: #fff; margin-bottom: 0.4rem; }
.footer-note { margin: 0; font-size: 0.85rem; max-width: 52ch; }

/* When on login/register, hide the app chrome. */
.auth-mode .gov-nav,
.auth-mode .breadcrumbs,
.auth-mode .user-bar { display: none; }

/* ---- panels, headings, forms ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
h1 { font-size: 1.6rem; margin: 0 0 1rem; color: var(--navy-800); }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }

label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; }
.req { color: var(--err); }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid #6b7785;
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--err);
  outline: 2px solid var(--err);
  outline-offset: 0;
}
textarea { min-height: 6rem; resize: vertical; }

.hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.field-error { color: var(--err); font-size: 0.85rem; margin-top: 0.25rem; font-weight: 600; min-height: 0; }
.field-error:empty { margin: 0; }

button.primary {
  background: var(--blue-600); color: #fff; border: 1px solid var(--blue-600);
  padding: 0.6rem 1.1rem; border-radius: var(--radius); cursor: pointer; font: inherit; font-weight: 700;
}
button.primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
button.ghost { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.65rem; cursor: pointer; font: inherit; }
button.ghost:hover { background: var(--blue-100); }
button.approve { background: var(--ok); color: #fff; border: none; border-radius: var(--radius); padding: 0.5rem 0.9rem; cursor: pointer; font: inherit; font-weight: 600; }
button.reject { background: var(--err); color: #fff; border: none; border-radius: var(--radius); padding: 0.5rem 0.9rem; cursor: pointer; font: inherit; font-weight: 600; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.actions { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; align-items: flex-start; }
.actions textarea { min-height: 3rem; }

/* ---- banners ---- */
.banner { padding: 0.7rem 0.9rem; border-radius: var(--radius); margin-bottom: 0.9rem; border-left: 5px solid; }
.banner.ok { background: var(--ok-bg); color: #14532d; border-left-color: var(--ok); }
.banner.err { background: var(--err-bg); color: #7a0606; border-left-color: var(--err); }
.banner ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* ---- status badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  border: 1px solid transparent;
}
.badge-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; }
.badge.pending { background: var(--warn-bg); color: var(--warn); border-color: #e4cf7a; }
.badge.approved { background: var(--ok-bg); color: var(--ok); border-color: #a7cbb1; }
.badge.rejected { background: var(--err-bg); color: var(--err); border-color: #e0a3a3; }

/* ---- cards ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue-600);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.card-title { margin: 0; font-size: 1.1rem; }
.meta { color: var(--muted); font-size: 0.88rem; margin-top: 0.3rem; }
.attachment-row { margin-top: 0.4rem; }
a.attachment { color: var(--blue-600); font-weight: 600; }
.empty { color: var(--muted); }
ol.history { margin: 0.6rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }
ol.history li { margin-bottom: 0.2rem; }

/* ---- step progress indicator ---- */
.stepper { margin: 0.85rem 0; }
.stepper ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0;
}
.stepper .step {
  position: relative;
  flex: 1 1 0;
  min-width: 8rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem 0.35rem 0;
}
.stepper .step-marker {
  flex: 0 0 auto;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700;
  background: #fff; color: var(--muted);
  border: 2px solid var(--line);
}
.stepper .step-name { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.85rem; }
.stepper .step-note { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.stepper .step.complete .step-marker { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .step.current .step-marker { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.stepper .step.current .step-name > span:first-child { font-weight: 700; }
.stepper .step.rejected .step-marker { background: var(--err); border-color: var(--err); color: #fff; }

/* ---- accessible drag-and-drop upload ---- */
.upload-field { margin-top: 0.3rem; }
.dropzone {
  border: 2px dashed #6b7785;
  border-radius: var(--radius);
  background: #f7f9fc;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
}
.dropzone:hover { background: var(--blue-100); border-color: var(--blue-500); }
.dropzone.is-dragover { background: var(--blue-100); border-color: var(--blue-600); color: var(--navy-800); }
.dz-icon { font-size: 1.5rem; color: var(--blue-600); }
.dz-primary { font-weight: 600; color: var(--ink); }
.dz-link { color: var(--blue-600); font-weight: 600; text-decoration: underline; }
.dz-feedback { margin-top: 0.4rem; font-size: 0.88rem; color: var(--muted); }
.dz-feedback.ok { color: var(--ok); font-weight: 600; }

/* ---- workflow admin ---- */
.step-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.step-row .idx { width: 1.5rem; color: var(--muted); font-weight: 700; }
.step-row .name { flex: 1; font-weight: 600; }
.step-row select { width: auto; min-width: 12rem; }

/* ---- auth screens ---- */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy-700);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 2rem;
  width: 100%;
  max-width: 26rem;
}
.auth-brand { display: flex; justify-content: center; margin-bottom: 0.75rem; }
.auth-brand .seal { width: 3.25rem; height: 3.25rem; font-size: 1rem; color: var(--navy-800); }
.auth-card h1 { text-align: center; font-size: 1.4rem; margin-bottom: 0.25rem; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 1rem; }
.auth-actions { margin-top: 1.25rem; }
.auth-actions .primary { width: 100%; }
.auth-alt { text-align: center; margin: 1rem 0 0; font-size: 0.92rem; }
.demo-hint {
  margin-top: 1.25rem;
  padding: 0.75rem 0.9rem;
  background: var(--blue-100);
  border: 1px solid #b9d3f0;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--navy-800);
}
.demo-hint ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.demo-hint li { margin-bottom: 0.15rem; }

@media (max-width: 560px) {
  .masthead-inner { flex-direction: column; align-items: flex-start; }
  .user-meta { align-items: flex-start; }
  .stepper ol { flex-direction: column; }
}
