/* Participant Portal: wizard chrome layered on top of palette.css (kept verbatim from PublicSite). */

body { margin-bottom: 60px; }

/* Shared site header (top bar + navbar + mega menu) — markup mirrors PublicSite's _Layout.cshtml.
   PublicSite lays it out with Bootstrap utilities and Bootstrap's collapse; the portal doesn't
   load Bootstrap (it would restyle the wizard's forms/tables), so these few rules and the
   toggler script in site.js reproduce the same layout and mobile behaviour. */
.wad-navbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; flex-wrap: wrap; }
.wad-nav-collapse { display: flex; align-items: center; justify-content: flex-end; flex-grow: 1; gap: 0.5rem 1rem; }
@media (min-width: 992px) {
  .wad-navbar-inner { flex-wrap: nowrap; }
  .wad-nav-toggler { display: none; }
}
@media (max-width: 991.98px) {
  .wad-nav-collapse { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 0.75rem; }
  .wad-nav-collapse.is-open { display: flex; }
  .wad-nav-collapse > .btn-wad { align-self: flex-start; }
}

.wad-footer-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .wad-footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Wizard progress strip, directly under the sticky navbar. */
.wad-wizard-header {
  background: var(--wad-white);
  border-bottom: 1px solid var(--wad-gray);
  padding: 0 0 0.75rem;
}

/* ---------- Step progress bar ---------- */
.wad-progress { list-style: none; display: flex; gap: 0.35rem; margin: 1rem 0 0; padding: 0; }
.wad-progress li {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8a8685;
  padding-bottom: 0.6rem;
  border-bottom: 4px solid var(--wad-gray);
}
.wad-progress li.is-complete { color: var(--wad-green-dark); border-bottom-color: var(--wad-green); }
.wad-progress li.is-active { color: var(--wad-charcoal); border-bottom-color: var(--wad-green); }

/* ---------- Forms ---------- */
.wad-field { margin-bottom: 1.1rem; }
.wad-field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.wad-field .hint { display: block; font-size: 0.8rem; color: #6b6867; margin-top: 0.25rem; }
.wad-field input[type=text],
.wad-field input[type=email],
.wad-field input[type=tel],
.wad-field input[type=date],
.wad-field input[type=datetime-local],
.wad-field input[type=number],
.wad-field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--wad-gray);
  font-size: 1rem;
  font-family: inherit;
  background: var(--wad-white);
  color: var(--wad-charcoal);
}
.wad-field input:focus, .wad-field select:focus {
  outline: none;
  border-color: var(--wad-green);
  box-shadow: 0 0 0 3px rgba(0, 166, 79, 0.18);
}

.wad-merch-item { margin-bottom: 1.5rem; }
.wad-merch-item h3 { margin-bottom: 0.6rem; }
.wad-merch-item h3 .sub { font-size: 0.85rem; font-weight: 500; color: #6b6867; }
.wad-merch-item .wad-choice-grid { margin-bottom: 0; }

.wad-choice-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.5rem; }
.wad-choice {
  display: block;
  cursor: pointer;
  border: 2px solid var(--wad-gray);
  border-radius: var(--wad-radius);
  padding: 1.1rem;
  background: var(--wad-white);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wad-choice input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.wad-choice input[type="number"] { position: relative; cursor: text; }
.wad-choice .wad-variant-photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 0.6rem; }
.wad-choice .title { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.25rem; }
.wad-choice .sub { display: block; font-size: 0.8rem; color: #6b6867; }
.wad-choice:has(input:checked) { border-color: var(--wad-green); background: rgba(0, 166, 79, 0.08); }
.wad-choice:has(input[type="number"]:not([value="0"])) { border-color: var(--wad-green); background: rgba(0, 166, 79, 0.08); }

.wad-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.wad-stock-badge { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 0.2rem 0.65rem; display: inline-block; }
.wad-stock-in { background: rgba(0, 166, 79, 0.12); color: var(--wad-green-dark); }
.wad-stock-low { background: rgba(236, 32, 39, 0.12); color: var(--wad-red); }
.wad-stock-out { background: var(--wad-gray); color: #6b6867; }

.wad-summary-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--wad-gray); gap: 1rem; }
.wad-summary-row dt { font-weight: 600; color: #6b6867; }
.wad-summary-row dd { margin: 0; text-align: right; }

.wad-alert {
  border-radius: var(--wad-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.wad-alert-error { background: rgba(236, 32, 39, 0.1); color: var(--wad-red); border: 1px solid rgba(236, 32, 39, 0.25); }
.wad-alert-success { background: rgba(0, 166, 79, 0.1); color: var(--wad-green-dark); border: 1px solid rgba(0, 166, 79, 0.25); }
.wad-alert-pending { background: rgba(236, 32, 39, 0.06); color: var(--wad-charcoal); border: 1px solid var(--wad-gray); }

/* ---------- Dark mode additions ---------- */
body.wad-dark .wad-wizard-header { background: #2c2929; border-color: #3a3636; }
body.wad-dark .wad-progress li.is-active { color: var(--wad-white); }
body.wad-dark .wad-field input, body.wad-dark .wad-field select { background: #221f1f; color: var(--wad-white); border-color: #3a3636; }
body.wad-dark .wad-choice { background: #2c2929; border-color: #3a3636; }
body.wad-dark .wad-choice:has(input:checked) { background: rgba(0, 166, 79, 0.18); }
body.wad-dark .wad-summary-row { border-color: #3a3636; }

@media (max-width: 640px) {
  .wad-progress li { font-size: 0.6rem; }
}

/* ---------- Invoice ---------- */
.wad-invoice { position: relative; overflow: hidden; }

.wad-invoice-watermark {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(236, 32, 39, 0.06);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
}

.wad-invoice-band {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 3px solid var(--wad-green);
}
.wad-invoice-brand { display: flex; align-items: flex-start; gap: 0.75rem; }
.wad-invoice-brand img { height: 44px; width: auto; border-radius: 4px; }
.wad-invoice-brand h1 { margin: 0; font-size: 1.3rem; }
.wad-invoice-brand p { margin: 0; color: #6b6867; font-size: 0.85rem; }

.wad-invoice-meta { text-align: right; }
.wad-invoice-meta h2 { margin: 0 0 0.5rem; font-size: 1.5rem; color: var(--wad-green-dark); }
.wad-invoice-meta dl { margin: 0 0 0.6rem; }
.wad-invoice-meta dl div { display: flex; justify-content: flex-end; gap: 0.5rem; font-size: 0.85rem; }
.wad-invoice-meta dt { color: #6b6867; font-weight: 600; }
.wad-invoice-meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.wad-invoice-billto {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  border-top: 1px solid var(--wad-gray);
  border-bottom: 1px solid var(--wad-gray);
  padding: 1rem 0;
  margin-bottom: 1.25rem;
}
.wad-invoice-billto h3 { margin: 0 0 0.3rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b6867; }
.wad-invoice-billto p { margin: 0; }

.wad-invoice-table { position: relative; z-index: 1; width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.wad-invoice-table th, .wad-invoice-table td { padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--wad-gray); text-align: left; font-size: 0.92rem; }
.wad-invoice-table thead th { font-weight: 700; color: var(--wad-white); background: var(--wad-charcoal); }
.wad-invoice-table thead th:first-child { border-top-left-radius: 8px; }
.wad-invoice-table thead th:last-child { border-top-right-radius: 8px; }
.wad-invoice-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.025); }
.wad-invoice-table td.num, .wad-invoice-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.wad-invoice-table td.center, .wad-invoice-table th.center { text-align: center; }
.wad-invoice-table tfoot td { border-bottom: none; border-top: 2px solid var(--wad-charcoal); padding-top: 0.75rem; }

.wad-invoice-footnote { position: relative; z-index: 1; font-size: 0.85rem; color: #6b6867; margin-top: 1.5rem; }

body.wad-dark .wad-invoice-band,
body.wad-dark .wad-invoice-billto { border-color: #3a3636; }
body.wad-dark .wad-invoice-brand p,
body.wad-dark .wad-invoice-footnote { color: var(--wad-gray); }
body.wad-dark .wad-invoice-table th,
body.wad-dark .wad-invoice-table td { border-color: #3a3636; }
body.wad-dark .wad-invoice-table thead th { background: #3a3636; }
body.wad-dark .wad-invoice-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
body.wad-dark .wad-invoice-table tfoot td { border-top-color: var(--wad-white); }

@media (max-width: 640px) {
  .wad-invoice-band { flex-direction: column; }
  .wad-invoice-meta { text-align: left; }
  .wad-invoice-meta dl div { justify-content: flex-start; }
  .wad-invoice-billto { grid-template-columns: 1fr; }
  .wad-invoice-watermark { font-size: 3rem; }
}

@media print {
  .wad-topbar, .wad-navbar, .wad-wizard-header, .wad-footer, .no-print { display: none !important; }
  body { margin-bottom: 0; }
  .wad-card.wad-invoice { box-shadow: none; border: none; padding: 0; }
  .wad-invoice-watermark { color: rgba(236, 32, 39, 0.09); }
}
