:root {
  color-scheme: light;
  --bg: #eef3ed;
  --panel: #ffffff;
  --text: #17221b;
  --muted: #5f6f64;
  --line: #d9e2da;
  --brand: #2f6b3f;
  --brand-dark: #1f4f2e;
  --assist: #ff982a;
  --danger: #b42318;
  --warn: #b45309;
  --soft: #f8faf7;
  --surface-rail: #101820;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(16, 24, 32, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #f8faf7 0, var(--bg) 100%);
  background-size: 40px 40px, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.portal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(24, 41, 28, 0.08);
  padding: 30px;
}

.portal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.portal-logo {
  align-items: center;
  background: var(--surface-rail);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  color: #ffffff;
  display: inline-flex;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  letter-spacing: 0.02em;
  padding: 0 14px;
}

.portal-header p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.15;
}

.intro {
  color: var(--muted);
  max-width: 680px;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

.button {
  justify-self: start;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand-dark);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 44px;
  padding: 0 20px;
}

.button:hover {
  background: var(--brand-dark);
}

.button.secondary {
  align-items: center;
  background: #eef5f0;
  color: var(--brand-dark);
  display: inline-flex;
  text-decoration: none;
}

.button.secondary:hover {
  background: #dcebe1;
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.message {
  border-radius: var(--radius);
  margin: 16px 0;
  padding: 12px 14px;
  background: #e9f5ec;
  color: var(--brand-dark);
  font-weight: 700;
}

.message.error {
  background: #fff0ed;
  color: var(--danger);
}

.message.success {
  background: #e9f5ec;
  color: var(--brand-dark);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.pack-card {
  display: grid;
  gap: 18px;
}

.pack-content {
  display: grid;
  gap: 18px;
}

.pack-hero,
.pack-section,
.pack-item,
.evidence-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pack-hero {
  align-items: start;
  background: #ffffff;
  border-left: 4px solid var(--brand);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px;
}

.pack-hero h2,
.pack-section h3,
.evidence-card h4,
.structured-block h4 {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.status-pill {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  padding: 8px 10px;
  white-space: nowrap;
}

.status-pill.ok {
  background: #e9f5ec;
  border-color: #b7d7c0;
  color: var(--brand-dark);
}

.status-pill.pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: var(--warn);
}

.pack-section {
  background: #ffffff;
  padding: 18px;
}

.pack-list,
.structured-block,
.fact-grid,
.evidence-grid {
  display: grid;
  gap: 12px;
}

.pack-list,
.evidence-grid {
  margin-top: 14px;
}

.pack-item {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}

.pack-item p,
.evidence-card p {
  color: var(--muted);
  margin: 4px 0 0;
}

.pack-item.stacked {
  align-items: stretch;
  display: grid;
}

.fact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0 0;
}

.fact-grid.mini {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fact-grid div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.fact-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fact-grid dd {
  margin: 4px 0 0;
  word-break: break-word;
}

.evidence-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.evidence-card {
  padding: 14px;
}

.thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thumb-row img {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
  object-fit: cover;
  width: 124px;
}

.checkbox-row {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  font-weight: 700;
}

.checkbox-row input {
  margin-top: 4px;
  width: auto;
}

.final-note {
  background: var(--soft);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  margin: 14px 0 0;
  padding: 12px;
}

@media (max-width: 720px) {
  .portal-shell {
    width: min(100% - 20px, 920px);
    padding: 10px 0;
  }

  .portal-card {
    padding: 18px;
  }

  .portal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .pack-hero,
  .pack-item {
    align-items: stretch;
    flex-direction: column;
  }

  .fact-grid,
  .fact-grid.mini {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .portal-shell {
    padding: 0;
    width: 100%;
  }

  .portal-card,
  .pack-section,
  .pack-hero,
  .pack-item,
  .evidence-card {
    box-shadow: none;
  }

  .button,
  #completion-pack-signoff-form {
    display: none !important;
  }
}

/* Honeypot: hidden from people (and screen readers); bots tend to fill it. */
.hp-field {
  height: 1px;
  left: -10000px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.signature-image {
  margin: 0 0 12px;
  padding: 8px;
  max-width: 360px;
  background: #fff;
  border: 1px solid #e9eae7;
  border-radius: 12px;
}

.signature-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Batch Z3: footer with the privacy notice. */
.portal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 24px 16px 32px;
  font-size: 13px;
  color: var(--muted);
}

.portal-footer a {
  color: var(--muted);
}
