:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-lighter: #334155;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --white: #ffffff;
  --gray: #94a3b8;
  --green: #22c55e;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--white);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  min-height: 48px;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Header ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 16px;
}

.top-bar h1 {
  font-size: 20px;
  margin: 0;
}

.refresh-indicator {
  font-size: 12px;
  color: var(--gray);
}

/* ---------- Order cards ---------- */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.order-card {
  background: var(--navy-light);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 88px;
  border: 1px solid var(--navy-lighter);
  transition: transform 0.15s ease, background 0.15s ease;
}

.order-card:active {
  transform: scale(0.98);
  background: var(--navy-lighter);
}

.order-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.order-card-info .order-number {
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.order-card-info .product-name {
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--navy-lighter);
  flex-shrink: 0;
}

/* ---------- Empty state ---------- */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  color: var(--gray);
  padding: 40px 20px;
}

.empty-state svg {
  width: 120px;
  height: 120px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 16px;
  margin: 0;
}

/* ---------- Confirmation screen ---------- */
.confirm-screen {
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 24px;
}

.confirm-image {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  background: var(--navy-light);
}

.confirm-screen h2 {
  font-size: 24px;
  margin: 0;
}

.confirm-screen .order-tag {
  color: var(--orange);
  font-weight: 600;
  font-size: 14px;
}

.confirm-question {
  font-size: 17px;
  color: var(--gray);
  margin: 8px 0 0;
}

.confirm-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  margin-top: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  padding: 14px 20px;
  min-height: 52px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-secondary {
  background: var(--navy-light);
  color: var(--white);
  border: 1px solid var(--navy-lighter);
}

.btn-danger {
  background: transparent;
  color: var(--gray);
  border: 1px solid var(--navy-lighter);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-block {
  width: 100%;
}

/* ---------- Progress bar ---------- */
.progress-wrap {
  margin-bottom: 20px;
}

.progress-label {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 8px;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--navy-light);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ---------- Step screen ---------- */
.step-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 16px;
}

.step-card {
  background: var(--navy-light);
  border-radius: 16px;
  padding: 18px;
  font-size: 16px;
  line-height: 1.5;
  color: #e2e8f0;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.step-media {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 16px;
  background: var(--navy-light);
  max-height: 280px;
  object-fit: cover;
}

.step-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
}

/* ---------- Camera ---------- */
.camera-section {
  margin-bottom: 16px;
}

.camera-preview-wrap {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3/4;
}

.camera-preview-wrap video,
.camera-preview-wrap canvas,
.camera-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-capture-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--orange);
}

.camera-capture-btn:active {
  transform: translateX(-50%) scale(0.92);
}

.photo-review-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.photo-review-buttons .btn {
  flex: 1;
}

.photo-confirmed-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
  margin-top: 10px;
}

/* ---------- Loading / success ---------- */
.center-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  padding: 40px 20px;
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid var(--navy-lighter);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.success-check {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-check svg {
  width: 52px;
  height: 52px;
}

.center-screen h2 {
  font-size: 22px;
  margin: 0;
}

.center-screen p {
  color: var(--gray);
  margin: 0;
  font-size: 15px;
}

.error-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--red);
  color: #fca5a5;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
}

/* Scrollbars for step content */
.screen {
  overflow-y: auto;
}
