/* ─── Sprout Track Receipt Verification ───
   Dark olive theme, mobile-first, zero dependencies
   Colors:
     Background: #1a1f16
     Cards:      #2a3024
     Green:      #7a8f5c
     Gold:       #d4a85a
     White:      #f0f0e8
     Gray:       #9a9a8a
────────────────────────────────────────── */

/* ─── RESET ─────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── BASE ──────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #1a1f16;
  color: #f0f0e8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── TYPOGRAPHY ────────────────────────── */
h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: center;
  color: #f0f0e8;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #f0f0e8;
}

p {
  color: #9a9a8a;
  text-align: center;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

a {
  color: #7a8f5c;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #d4a85a;
}

/* ─── LAYOUT ────────────────────────────── */
.container {
  width: 100%;
  max-width: 420px;
}

/* ─── LOGO ──────────────────────────────── */
.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo svg {
  width: 64px;
  height: 64px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f0f0e8;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
}

.logo-sub {
  font-size: 0.8125rem;
  color: #7a8f5c;
  margin-top: 0.125rem;
}

/* ─── CARDS ─────────────────────────────── */
.card {
  background-color: #2a3024;
  border-radius: 16px;
  padding: 1.5rem;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.card + .card {
  margin-top: 1rem;
}

/* ─── FORM ELEMENTS ─────────────────────── */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scan-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: #9a9a8a;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scan-divider::before,
.scan-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #3a4030;
}

.input-field {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background-color: #1a1f16;
  border: 1.5px solid #3a4030;
  border-radius: 12px;
  color: #f0f0e8;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field::placeholder {
  color: #5a6050;
}

.input-field:focus {
  border-color: #7a8f5c;
  box-shadow: 0 0 0 3px rgba(122, 143, 92, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background-color: #7a8f5c;
  color: #1a1f16;
}

.btn-primary:hover {
  background-color: #8a9f6c;
}

.btn-secondary {
  background-color: #3a4030;
  color: #f0f0e8;
}

.btn-secondary:hover {
  background-color: #4a5040;
}

.scanner {
  position: relative;
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid #3a4030;
  border-radius: 18px;
  background: #1a1f16;
}

.scanner video {
  display: block;
  width: 100%;
  min-height: 260px;
  object-fit: cover;
  background: #1a1f16;
}

.scanner-frame {
  position: absolute;
  inset: 16%;
  border: 2px solid #d4a85a;
  border-radius: 24px;
  box-shadow: 0 0 0 999px rgba(26, 31, 22, 0.38);
  pointer-events: none;
}

.scanner-status {
  margin: 0;
  padding: 0.875rem 1rem;
  color: #f0f0e8;
  font-size: 0.875rem;
}

.scanner .btn {
  width: calc(100% - 2rem);
  margin: 0 1rem 1rem;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.trust-strip span {
  padding: 0.625rem 0.5rem;
  border: 1px solid #3a4030;
  border-radius: 999px;
  color: #7a8f5c;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ─── RECEIPT DETAILS ───────────────────── */
.receipt-header {
  text-align: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #3a4030;
  margin-bottom: 1.25rem;
}

.receipt-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.status-valid {
  background-color: rgba(122, 143, 92, 0.15);
  color: #7a8f5c;
}

.status-invalid {
  background-color: rgba(212, 100, 90, 0.15);
  color: #d4645a;
}

.receipt-id {
  font-size: 0.8125rem;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  color: #9a9a8a;
  word-break: break-all;
}

/* ─── ITEMS TABLE ───────────────────────── */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.items-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9a9a8a;
  padding: 0.5rem 0;
  border-bottom: 1px solid #3a4030;
}

.items-table td {
  padding: 0.625rem 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid #252b1e;
}

.items-table tr:last-child td {
  border-bottom: none;
}

.col-qty {
  text-align: center;
  width: 3rem;
}

.col-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ─── TOTAL ROW ─────────────────────────── */
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 2px solid #7a8f5c;
}

.total-label {
  font-size: 1rem;
  font-weight: 600;
  color: #f0f0e8;
}

.total-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: #d4a85a;
  font-variant-numeric: tabular-nums;
}

/* ─── METADATA ──────────────────────────── */
.meta-list {
  list-style: none;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid #252b1e;
}

.meta-list li:last-child {
  border-bottom: none;
}

.meta-label {
  color: #9a9a8a;
}

.meta-value {
  color: #f0f0e8;
  font-weight: 500;
}

/* ─── MESSAGES ──────────────────────────── */
.message {
  text-align: center;
  padding: 2rem 1rem;
}

.message-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-icon svg {
  width: 28px;
  height: 28px;
}

.message-icon.success {
  background-color: rgba(122, 143, 92, 0.15);
}

.message-icon.success svg {
  stroke: #7a8f5c;
}

.message-icon.error {
  background-color: rgba(212, 100, 90, 0.15);
}

.message-icon.error svg {
  stroke: #d4645a;
}

.message-icon.warning {
  background-color: rgba(212, 168, 90, 0.15);
}

.message-icon.warning svg {
  stroke: #d4a85a;
}

.message-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f0f0e8;
  margin-bottom: 0.375rem;
}

.message-text {
  color: #9a9a8a;
  font-size: 0.9375rem;
  margin-bottom: 0;
}

/* ─── LOADING ───────────────────────────── */
.loading {
  text-align: center;
  padding: 3rem 1rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #3a4030;
  border-top-color: #7a8f5c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ─── FOOTER ────────────────────────────── */
.footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #5a6050;
}

.footer a {
  color: #7a8f5c;
}

/* ─── UTILITY ───────────────────────────── */
.hidden {
  display: none !important;
}

.word-break {
  word-break: break-all;
}

/* ─── PRINT ─────────────────────────────── */
@media print {
  body {
    background-color: #fff;
    color: #000;
  }
  .card {
    background-color: #fff;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  .footer, .btn {
    display: none;
  }
}
