:root {
  --bg: #eef5f1;
  --panel: rgba(255, 255, 255, 0.82);
  --ink: #10211f;
  --muted: #5f706c;
  --brand: #0f766e;
  --brand-dark: #0a4e49;
  --brand-soft: #d8f3ee;
  --danger: #b91c1c;
  --radius: 22px;
  --shadow: 0 22px 60px rgba(18, 34, 31, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 118, 110, 0.16) 0%, transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(29, 78, 216, 0.12) 0%, transparent 26%),
    linear-gradient(140deg, #f7fbf9 0%, #edf4ef 45%, #f9fafb 100%);
}

.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 34px 18px 60px;
}

.hero {
  margin-bottom: 18px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

h1 {
  margin: 0 0 10px;
  line-height: 1.08;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}

.lead {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

label {
  font-size: 14px;
  color: #25403b;
  font-weight: 600;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.status-card {
  border-radius: 16px;
  border: 1px solid #dbe7e2;
  background: linear-gradient(180deg, rgba(216, 243, 238, 0.72), rgba(255, 255, 255, 0.94));
  padding: 14px 16px;
}

.status-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.status-text {
  margin: 0;
  font-size: 14px;
  color: #166534;
  font-weight: 700;
  line-height: 1.4;
}

.hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.upload-shell {
  display: grid;
  gap: 6px;
}

.upload-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d2ddd8;
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(251, 255, 253, 0.96);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.camera-shell {
  border: 1px solid #d2ddd8;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 252, 250, 0.98), rgba(241, 248, 246, 0.92));
  padding: 12px;
  display: grid;
  gap: 10px;
}

#cameraPreview {
  width: 100%;
  border-radius: 14px;
  background: linear-gradient(180deg, #0f172a, #111827);
  min-height: 250px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.camera-actions,
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.camera-actions button {
  background: #0b7a75;
}

.camera-actions button:nth-child(2) {
  background: #c2410c;
}

.camera-actions button:nth-child(3) {
  background: #334155;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.24);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-action {
  min-width: 220px;
  background: linear-gradient(135deg, #0f766e 0%, #0a4e49 100%);
}

.result {
  margin: 0;
  min-height: 180px;
  border-radius: 16px;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e2e8f0;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .primary-action {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 18px 12px 28px;
  }

  .card {
    padding: 16px;
    gap: 12px;
    border-radius: 18px;
  }

  h1 {
    font-size: clamp(1.7rem, 8vw, 2.3rem);
  }

  #cameraPreview {
    min-height: 210px;
  }

  .camera-actions button,
  button {
    width: 100%;
    justify-content: center;
  }
}