body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: #0f172a;
  line-height: 1.45;
}

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.brand-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.brand-logo:hover {
  transform: translateY(-1px);
}

.brand-logo.logo-red {
  /* Strong red tint so change is clearly visible */
  filter: grayscale(1) sepia(1) saturate(10000%) hue-rotate(-50deg)
    brightness(0.85) contrast(1.4);
  outline: 3px solid #ef4444;
  outline-offset: 6px;
  border-radius: 12px;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.18);
}

.card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.35rem;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.login-card {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.muted-text {
  margin: 0 0 1rem 0;
  color: #64748b;
  font-size: 0.92rem;
}

input,
select,
button {
  font: inherit;
}

.field {
  margin-bottom: 0.75rem;
}

.field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #334155;
}

.field input,
.field select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.62rem 0.72rem;
  border-radius: 0.65rem;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.26);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.btn:disabled {
  background: #d1d5db;
  color: #6b7280;
  opacity: 1;
  cursor: default;
}

.error {
  color: #b91c1c;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 0.55rem;
  padding: 0.5rem 0.6rem;
}

.success {
  color: #15803d;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 0.55rem;
  padding: 0.55rem 0.65rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.row > .col {
  flex: 1 1 200px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f8fafc;
}

.camera {
  margin-top: 0.75rem;
}

.camera video,
.camera canvas {
  width: 100%;
  max-height: 260px;
  border-radius: 0.75rem;
  background: #000;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e5e7eb;
}

.camera-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.camera-modal {
  width: min(560px, 100%);
  background: white;
  border-radius: 1rem;
  padding: 1rem;
}

.camera-modal h3 {
  margin: 0 0 0.75rem 0;
}

.camera-modal video {
  width: 100%;
  border-radius: 0.75rem;
  background: #000;
}

.camera-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.signature-credit {
  text-align: right;
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 0.35rem;
  letter-spacing: 0.2px;
  font-family: "Brush Script MT", "Snell Roundhand", "Apple Chancery", cursive;
}

@media (max-width: 720px) {
  #app {
    padding: 0.85rem;
  }

  .card {
    padding: 1rem;
    border-radius: 0.85rem;
  }

  .row {
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
  }

  .camera-modal {
    padding: 0.8rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

