:root {
  --brand: #15596a;
  --brand-dark: #0f3f4b;
  --brand-soft: #e7f4f6;
  --accent: #198754;
  --warning: #b7791f;
  --danger: #b42318;
  --ink: #172026;
  --muted: #64717a;
  --surface: #ffffff;
  --page: #eef4f5;
  --border: #d6e0e4;
  --shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
}

* {
  letter-spacing: 0;
}

body {
  background:
    linear-gradient(180deg, #dfeff2 0, var(--page) 220px),
    var(--page);
  color: var(--ink);
  font-size: 16px;
}

.app-nav {
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  box-shadow: 0 6px 20px rgba(15, 63, 75, 0.24);
  min-height: 72px;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 800;
}

.nav-subtitle {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  margin-top: -4px;
}

.nav-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status-pill {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  color: var(--brand-dark);
  font-weight: 800;
  padding: 7px 12px;
}

main {
  padding-bottom: 28px;
}

.step-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.step-panel h1,
.step-panel h2 {
  font-weight: 800;
}

.mode-toggle {
  background: #edf4f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 4px;
}

.mode-toggle label {
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
}

.mode-toggle input:checked + label {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  color: var(--brand-dark);
}

.step-chip {
  background: var(--brand-soft);
  border: 1px solid #b9dbe2;
  border-radius: 999px;
  color: var(--brand-dark);
  font-weight: 800;
  padding: 6px 12px;
}

.scanner-box {
  align-items: center;
  background: #101923;
  border: 4px solid #172536;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  min-height: 270px;
  overflow: hidden;
}

.scanner-help {
  color: #dcebf0;
  font-weight: 700;
  max-width: 270px;
  padding: 18px;
  text-align: center;
}

.status-line {
  background: #eaf8f2;
  border: 1px solid #b9e5d0;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  color: #154734;
  font-weight: 800;
  padding: 12px 14px;
}

.form-label {
  color: #31424c;
  font-weight: 800;
  margin-bottom: 6px;
}

.form-control,
.form-select,
.input-group .btn {
  border-color: #c9d5db;
  border-radius: 8px;
}

.input-group .form-control {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

.input-group .btn {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
  font-weight: 800;
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(21, 89, 106, 0.16);
}

.btn {
  border-radius: 8px;
  font-weight: 800;
  min-height: 46px;
}

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

.btn-primary:active,
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-success {
  background: #147a4b;
  border-color: #147a4b;
}

.list-group-item {
  border-color: var(--border);
  padding: 13px 14px;
}

.list-group-item small {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-top: 2px;
}

.camera-drop {
  align-items: center;
  background: #f6fafb;
  border: 2px dashed #8fb7c2;
  border-radius: 8px;
  color: var(--brand-dark);
  cursor: pointer;
  display: flex;
  font-size: 1.05rem;
  font-weight: 800;
  justify-content: center;
  min-height: 132px;
  padding: 16px;
  text-align: center;
  width: 100%;
}

.camera-drop:active {
  background: var(--brand-soft);
}

.camera-drop input {
  display: none;
}

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

.photo-item {
  aspect-ratio: 1;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  position: relative;
}

.photo-item img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.photo-item button {
  align-items: center;
  background: rgba(15, 23, 42, 0.86);
  border: 0;
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 1.2rem;
  height: 34px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
}

.summary-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.summary-list > div {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 8px;
  grid-template-columns: 132px 1fr;
  padding: 13px 14px;
}

.summary-list > div:last-child {
  border-bottom: 0;
}

.summary-list strong {
  color: #263742;
}

.summary-list span,
.summary-list small {
  overflow-wrap: anywhere;
}

.summary-item {
  align-items: center;
  background: #fbfdfe;
  display: grid !important;
  gap: 7px;
  grid-template-columns: 1fr auto !important;
}

.summary-item span,
.summary-item small {
  color: var(--muted);
  font-weight: 700;
  grid-column: 1 / -1;
}

.summary-item button {
  grid-column: 2;
  grid-row: 1;
  min-height: 34px;
}

.sticky-actions {
  background: linear-gradient(180deg, rgba(238, 244, 245, 0), var(--page) 25%);
  bottom: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin: 18px -18px -18px;
  padding: 22px 18px 18px;
  position: sticky;
}

.wide-action {
  grid-column: 1 / -1;
}

.loading-overlay {
  align-items: center;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  display: flex;
  flex-direction: column;
  font-weight: 800;
  gap: 12px;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 2000;
}

.alert {
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  font-weight: 700;
}

@media (min-width: 768px) {
  main {
    max-width: 720px !important;
  }

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