/* Design tokens */
:root {
  --color-bg:             #0b0f1a;
  --color-surface:        #ffffff;
  --color-surface-alt:    #f9fafb;
  --color-blue:           #0562ff;
  --color-blue-light:     #eff6ff;
  --color-blue-border:    #bfdbfe;
  --color-green:          #16a34a;
  --color-red:            #dc2626;
  --color-red-light:      #fef2f2;
  --color-red-border:     #fecaca;
  --color-text:           #111827;
  --color-text-muted:     #6b7280;
  --color-border:         #e5e7eb;
  --radius-card:          16px;
  --radius-inner:         10px;
  --radius-sm:            8px;
  --shadow-card:          0 8px 32px rgba(0, 0, 0, 0.28);
}

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

/* Page */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 16px 64px;
}

/* Brand header */
.brand {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

.brand__logo {
  height: 44px;
  width: auto;
}

/* Card */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card__body {
  padding: 28px 24px;
}

/* Steps */
.step { display: none; }
.step--active { display: block; }

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 48px auto;
}

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

/* Expired */
.expired {
  text-align: center;
  padding: 44px 24px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.expired__title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

/* Verification hero — shown when seal is intact (pre-confirmation) */
.verify-hero {
  text-align: center;
  padding: 32px 24px 20px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.verify-hero__badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  display: block;
}

.verify-hero__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-blue);
  margin-bottom: 4px;
}

.verify-hero__body {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Tamper warning hero — shown when seal is broken */
.tamper-hero {
  background: var(--color-red-light);
  border-bottom: 1px solid var(--color-red-border);
  padding: 32px 24px 20px;
  text-align: center;
  margin-bottom: 0;
}

.tamper-hero__badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  display: block;
}

.tamper-hero__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-red);
  margin-bottom: 4px;
}

.tamper-hero__body {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Seal count band — sits flush between hero and card body */
.seal-band {
  border-bottom: 1px solid var(--color-border);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface-alt);
}

.seal-band__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
}

.seal-band__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-blue);
}

.seal-band--ok  { background: var(--color-blue-light); border-color: var(--color-blue-border); }
.seal-band--ok  .seal-band__count { color: var(--color-blue); }
.seal-band--warn .seal-band__count { color: #d97706; }

/* Post-confirmation check banner */
/* Seal ID display — prominent, above tamper hero and on check page */
.seal-id {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-inner);
  padding: 18px 20px 14px;
  margin-bottom: 16px;
  text-align: center;
}

.seal-id__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.seal-id__value {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-text);
  margin-bottom: 8px;
}

.seal-id__hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Tag info row */
.tag-info {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-inner);
  padding: 14px 16px;
  font-size: 13px;
}

.tag-info__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag-info__row + .tag-info__row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.tag-info__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
}

.tag-info__value {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 13px;
  color: var(--color-text);
  letter-spacing: 0.04em;
}

.tag-info__progress {
  font-weight: 600;
  color: var(--color-blue);
}

.tag-info__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* Manifest */
.manifest {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-inner);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
}

.manifest__heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.manifest__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--color-border);
}

.manifest__row:last-of-type { border-bottom: none; }

.manifest__name { color: var(--color-text); }

.manifest__detail { color: var(--color-text-muted); }

.manifest__qty {
  font-weight: 600;
  color: var(--color-blue);
  white-space: nowrap;
  margin-left: 12px;
}

.manifest__total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

/* Multi-seal hint */
.seal-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Form section */
.form-section {
  padding: 24px;
  border-top: 1px solid var(--color-border);
}

.form-section__title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Fields */
.field {
  margin-bottom: 16px;
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
}

.field__req {
  color: var(--color-red);
  margin-left: 2px;
}

.field__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.field__input:focus { border-color: var(--color-blue); }

.field__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 5px;
}

.field__textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
}

.field__textarea:focus { border-color: var(--color-blue); }

.field--hidden { display: none; }

/* Code input — uppercase monospace for activation code */
.field__input--code {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 17px;
}

/* Radio group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}

.radio-option:has(input:checked) {
  border-color: var(--color-blue);
  background: var(--color-blue-light);
}

.radio-option input { accent-color: var(--color-blue); }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}

.btn--primary {
  background: var(--color-blue);
  color: #fff;
}

.btn--ghost {
  background: #fff;
  color: var(--color-blue);
  border: 1.5px solid var(--color-blue);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):active { opacity: 0.8; }

/* Error messages */
.error {
  color: var(--color-red);
  font-size: 13px;
  margin-top: 10px;
  display: none;
}

.error--visible { display: block; }

/* Done screen */
.done {
  text-align: center;
  padding: 16px 24px 32px;
}

.done__badge {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: block;
}

.done__icon {
  font-size: 52px;
  margin-bottom: 14px;
  display: block;
}

.done__title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}

.done__body {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Product tag verification */
.field__inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field__inline .field__input {
  flex: 1;
  margin-bottom: 0;
}

.btn--sm {
  padding: 10px 14px;
  font-size: 13px;
}

.field__input--error {
  border-color: var(--color-red);
  outline-color: var(--color-red);
}

.verify-result {
  font-size: 13px;
  font-family: monospace;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.verify-result--ok {
  background: #f0fdf4;
  color: var(--color-green);
  border: 1px solid #bbf7d0;
}

.verify-result--fail {
  background: var(--color-red-light);
  color: var(--color-red);
  border: 1px solid var(--color-red-border);
}
