:root {
  --bg: #f4f1e8;
  --panel: #fffdf8;
  --text: #1f2933;
  --muted: #5b6875;
  --line: #d8d2c4;
  --brand: #0f6c5a;
  --brand-dark: #0b5143;
  --success: #0f6c5a;
  --accent: #d9efe9;
  --title: #0f2f5b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(217, 239, 233, 0.95), transparent 28%),
    linear-gradient(180deg, #f6f3eb 0%, var(--bg) 100%);
  color: var(--text);
}

.page-shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px 24px 32px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(28, 39, 49, 0.08);
  padding: 18px;
}

.hidden {
  display: none !important;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 18px;
  text-align: center;
}

.hero-copy {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-lockup {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.brand-lockup img {
  width: min(100%, 430px);
  max-height: 92px;
  height: auto;
  display: block;
  object-fit: contain;
}

.portal-subtitle {
  margin: 0 0 8px;
  text-align: center;
  color: var(--title);
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.55;
  font-size: 15px;
  text-align: center;
}

.actions,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero .actions {
  justify-content: center;
  margin-top: 4px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}

.chip {
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.capture-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.capture-block {
  border: 1px dashed #d9cdb7;
  border-radius: 18px;
  padding: 16px;
  background: #fffaf2;
}

.capture-preview-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.capture-preview {
  width: 140px;
  height: 104px;
  border-radius: 16px;
  border: 1px dashed #ccbda0;
  background: #f7f1e5;
  object-fit: cover;
  display: none;
}

.capture-preview.has-image {
  display: block;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compliance-note {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background: #f6fbf9;
  color: var(--brand-dark);
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.55;
  font-size: 14px;
}

.btn-small {
  padding: 10px 14px;
  min-height: 40px;
  font-size: 12px;
}

.btn,
button,
a.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn:hover,
button:hover,
a.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

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

.btn-secondary {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.span-2 {
  grid-column: span 2;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d9cdb7;
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(15, 108, 90, 0.15);
  border-color: var(--brand);
}

.status-card {
  margin-top: 24px;
  border: 1px solid var(--line);
  background: #f6fbf9;
  border-radius: 14px;
  padding: 20px;
  color: var(--brand-dark);
}

.status-error {
  border-color: #efc5bb;
  background: #fff4f1;
}

.status-card h2 {
  margin: 0 0 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f5fbf9;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

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

.photo-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.84);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 1000;
}

.camera-shell {
  width: min(100%, 720px);
  background: #111827;
  border-radius: 24px;
  padding: 16px;
  color: #fff;
}

.camera-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

#cameraVideo {
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: 18px;
  display: block;
  margin-bottom: 12px;
}

@media (max-width: 800px) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .brand-lockup img {
    width: min(100%, 300px);
    max-height: 86px;
  }

  .portal-subtitle {
    font-size: clamp(28px, 8vw, 40px);
    line-height: 1.04;
    max-width: 340px;
  }

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

  .field.span-2 {
    grid-column: span 1;
  }
}
