/* ─── /check page styles ─── */

/* Ensure the [hidden] attribute beats display: flex on these flex
   elements. Without this, `el.hidden = true` from JS has no visual
   effect because the class rule (display:flex) wins by source order. */
.check-status[hidden],
.upload-zone__preview[hidden] {
  display: none;
}


/* Hero */
.check-hero {
  background: var(--cream-light);
  padding-top: calc(64px + var(--s-12)); /* nav 64px + breathing room */
  padding-bottom: var(--s-8);
}

.check-hero__inner {
  text-align: center;
  max-width: 720px;
}

.check-hero__heading {
  font-family: var(--font-sans);
  font-size: clamp(1.875rem, 4.5vw, 2.75rem);
  font-weight: 700;
  color: var(--dark-frame);
  margin-bottom: var(--s-4);
  line-height: 1.15;
}

.check-hero__sub {
  margin-inline: auto;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.5;
  max-width: 560px;
}

/* Stage toggle */
.stage-toggle {
  display: flex;
  gap: var(--s-2);
  max-width: 640px;
  margin: 0 auto var(--s-8);
  background: var(--cream-light);
  padding: var(--s-1);
  border-radius: var(--r-md);
}

.stage-toggle__btn {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: var(--s-3) var(--s-4);
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
}

.stage-toggle__btn--active {
  background: var(--cream);
  color: var(--dark-frame);
  box-shadow: var(--shadow-card);
}

.stage-toggle__btn--disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.stage-toggle__badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 2px 6px;
  background: var(--tan);
  color: var(--dark-frame);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Form */
.check-form {
  max-width: 640px;
  margin: 0 auto;
  background: var(--cream);
  padding: var(--s-8);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.check-form__help {
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: var(--s-6);
}

/* Upload zone */
.upload-zone {
  position: relative;
  border: 2px dashed var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-8);
  text-align: center;
  margin-bottom: var(--s-6);
  background: var(--cream-light);
  transition: border-color 0.15s, background-color 0.15s;
}

.upload-zone--drag-over {
  border-color: var(--rust);
  background: rgba(196, 85, 26, 0.05);
}

.upload-zone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  cursor: pointer;
  font-family: var(--font-sans);
}

.upload-zone__icon {
  width: 48px;
  height: 48px;
  color: var(--rust);
}

.upload-zone__primary {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--dark-frame);
}

.upload-zone__secondary {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
  max-width: 420px;
}

.upload-zone__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}

.upload-zone__preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.upload-zone__clear {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rust);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: var(--s-2);
}

/* Form fields */
.check-form__fieldset {
  border: none;
  margin-bottom: var(--s-4);
}

.check-form__legend {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark-frame);
  margin-bottom: var(--s-3);
}

.check-form__row {
  margin-bottom: var(--s-4);
}

.check-form__label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--s-2);
}

.check-form__req {
  color: var(--rust);
}

.check-form__input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: var(--s-3) var(--s-4);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--cream);
  color: var(--ink);
  transition: border-color 0.15s;
}

.check-form__input:focus {
  border-color: var(--rust);
  outline: none;
}

.check-form__radio-group {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.check-form__radio {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  cursor: pointer;
  padding: var(--s-3) var(--s-4);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, background-color 0.15s;
  flex: 1 1 200px;
}

.check-form__radio:has(input:checked) {
  border-color: var(--rust);
  background: rgba(196, 85, 26, 0.05);
}

.check-form__radio input {
  accent-color: var(--rust);
}

.check-form__optional {
  margin-bottom: var(--s-6);
  border-top: 1px solid var(--rule);
  padding-top: var(--s-4);
}

.check-form__optional summary {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: var(--s-2) 0;
}

.check-form__optional summary:hover {
  color: var(--rust);
}

.check-form__optional-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

@media (min-width: 560px) {
  .check-form__optional-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.check-form__submit {
  width: 100%;
  margin-top: var(--s-2);
}

.check-form__limit {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: var(--s-3);
}

/* Status / loading */
.check-status {
  max-width: 640px;
  margin: var(--s-8) auto;
  padding: var(--s-8);
  background: var(--cream);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
}

.check-status__spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--rule);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.check-status__text {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--muted);
}

/* Verdict */
.verdict {
  max-width: 640px;
  margin: var(--s-8) auto;
  padding: var(--s-8);
  background: var(--cream);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border-left: 6px solid var(--muted);
}

.verdict--ready { border-left-color: var(--pos); }
.verdict--wait { border-left-color: var(--wheat-gold); }
.verdict--borderline { border-left-color: var(--rust); }
.verdict--overproofed { border-left-color: var(--neg); }

.verdict__verdict-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--s-1) var(--s-3);
  border-radius: 4px;
  background: var(--cream-light);
  color: var(--dark-frame);
  margin-bottom: var(--s-3);
}

.verdict__heading {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-frame);
  margin-bottom: var(--s-4);
}

.verdict__action {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
  padding: var(--s-4);
  background: var(--cream-light);
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
}

.verdict__evidence-title {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--s-2);
}

.verdict__evidence {
  list-style: disc;
  padding-left: var(--s-6);
  color: var(--ink);
}

.verdict__evidence li {
  margin-bottom: var(--s-1);
}

.verdict__meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

/* Error / bounce */
.check-error {
  max-width: 640px;
  margin: var(--s-8) auto;
  padding: var(--s-6);
  background: var(--cream);
  border-radius: var(--r-md);
  border-left: 4px solid var(--neg);
}

.check-error__heading {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--dark-frame);
  margin-bottom: var(--s-2);
}

.check-error__body {
  color: var(--ink);
}

/* Install CTA */
.install-cta {
  max-width: 640px;
  margin: var(--s-6) auto var(--s-8);
  padding: var(--s-8);
  background: var(--dark-frame);
  color: var(--cream);
  border-radius: var(--r-lg);
  text-align: center;
}

.install-cta__heading {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: var(--s-3);
}

.install-cta__sub {
  color: rgba(250, 250, 245, 0.85);
  margin: 0 auto var(--s-4);
  max-width: 480px;
  font-size: 0.9375rem;
}

.install-cta__placeholder {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--cream-light);
  font-style: italic;
}

/* QR section (desktop only) */
.qr-section {
  display: none;
  background: var(--cream-light);
  padding-block: var(--s-12);
}

.qr-section__inner {
  display: flex;
  align-items: center;
  gap: var(--s-8);
  justify-content: center;
}

.qr-section__copy {
  max-width: 380px;
}

.qr-section__copy h2 {
  margin-bottom: var(--s-3);
}

.qr-section__copy p {
  color: var(--muted);
}

.qr-section__code {
  background: var(--cream);
  padding: var(--s-4);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.qr-section__code canvas,
.qr-section__code img {
  display: block;
}

/* Show QR section only on desktop (no touch + wide viewport) */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .qr-section {
    display: block;
  }
}

/* Product cards (Amazon Associates) */
.product-card {
  max-width: 640px;
  margin: var(--s-6) auto;
}

.product-card--top {
  margin-top: var(--s-4);
}

.product-card__link {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.product-card__link:hover,
.product-card__link:focus-visible {
  border-color: var(--tan);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.product-card__image-wrap {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-light);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.product-card__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.product-card__body {
  flex: 1;
  min-width: 0;
}

.product-card__label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--saddle);
  background: var(--cream-light);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: var(--s-2);
}

.product-card__name {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--dark-frame);
  margin-bottom: var(--s-1);
  line-height: 1.3;
}

.product-card__copy {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: var(--s-2);
  max-width: none;
}

.product-card__cta {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rust);
}

.product-card__disclosure {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: var(--s-2);
  max-width: none;
}

@media (max-width: 480px) {
  .product-card__link {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .product-card__image-wrap {
    width: 140px;
    height: 140px;
  }
}
