/* =========================================================
   Injury Watch — Phase 6 styles
   Depends on pb-tokens.css for design tokens
   ========================================================= */

/* --- Shared app shell overrides for IW pages --- */
.pb-iw {
  min-height: 100vh;
  background: var(--pb-bg);
  color: var(--pb-ink);
  font-family: 'Archivo', sans-serif;
}

/* Nav styles live in pb-tokens.css — no duplication here */

/* ---- Hero ---- */
.pb-iw-hero {
  padding: 64px 24px 48px;
}

.pb-iw-hero__inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.pb-iw-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--pb-mute);
  margin-bottom: 20px;
}

.pb-iw-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pb-good);
  display: inline-block;
  animation: pb-pulse 2s ease-in-out infinite;
}

@keyframes pb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.pb-iw-hero__title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.05;
  margin: 0 0 16px;
}

.pb-iw-hero__sub {
  font-size: 16px;
  color: var(--pb-mute);
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.pb-iw-report-cta {
  margin-top: 20px;
  display: inline-block;
}

/* ---- Search wrap (shared by hero + report form) ---- */
.pb-iw-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-pill);
  padding: 0 16px;
  gap: 10px;
  transition: border-color 0.15s;
}

.pb-iw-search-wrap:focus-within {
  border-color: var(--pb-accent);
}

.pb-iw-search-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--pb-ink);
  font-size: 15px;
  font-family: 'Archivo', sans-serif;
  padding: 14px 0;
}

.pb-iw-search-wrap input::placeholder {
  color: var(--pb-faint);
}

.pb-iw-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-md);
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.pb-iw-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--pb-surface2);
}

.pb-iw-result-item:last-child {
  border-bottom: none;
}

.pb-iw-result-item:hover {
  background: var(--pb-surface2);
}

.pb-iw-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--pb-ink);
}

.pb-iw-result-meta {
  font-size: 12px;
  color: var(--pb-faint);
}

.pb-iw-result-irs {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--pb-r-xs);
}

/* ---- Leaderboard ---- */
.pb-iw-section {
  padding: 48px 24px;
  border-top: 1px solid var(--pb-surface2);
}

.pb-iw-section__inner {
  max-width: 760px;
  margin: 0 auto;
}

.pb-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.pb-iw-section__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}

.pb-section-more {
  font-size: 13px;
  color: var(--pb-accent);
  text-decoration: none;
  font-weight: 600;
}

.pb-section-more:hover {
  text-decoration: underline;
}

/* Leaderboard rows */
.pb-iw-lb-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-md);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.pb-iw-lb-row:hover {
  background: var(--pb-surface2);
  border-color: rgba(244,245,247,0.12);
}

.pb-iw-lb-rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--pb-faint);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.pb-iw-lb-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

.pb-iw-lb-meta {
  font-size: 12px;
  color: var(--pb-mute);
  margin-top: 2px;
  font-weight: 400;
}

.pb-iw-lb-bar-wrap {
  width: 80px;
  flex-shrink: 0;
}

.pb-iw-lb-bar-track {
  height: 4px;
  background: var(--pb-surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.pb-iw-lb-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.pb-iw-lb-irs {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
  width: 52px;
  text-align: right;
  flex-shrink: 0;
}

.pb-iw-lb-spike {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: var(--pb-bad);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--pb-r-xs);
  flex-shrink: 0;
}

/* ---- How it works ---- */
.pb-iw-how {
  padding: 48px 24px;
  background: var(--pb-surface);
  border-top: 1px solid var(--pb-surface2);
  border-bottom: 1px solid var(--pb-surface2);
}

.pb-iw-how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.pb-iw-how-step__num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pb-accent);
  color: var(--pb-accent-ink);
  font-weight: 900;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.pb-iw-how-step h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
}

.pb-iw-how-step p {
  font-size: 13px;
  color: var(--pb-mute);
  line-height: 1.6;
  margin: 0;
}

/* ---- Footer ---- */
.pb-iw-footer {
  padding: 32px 24px;
}

.pb-iw-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.pb-iw-footer__links a {
  font-size: 13px;
  color: var(--pb-mute);
  text-decoration: none;
}

.pb-iw-footer__links a:hover {
  color: var(--pb-ink);
}

.pb-iw-footer__legal {
  font-size: 12px;
  color: var(--pb-faint);
  line-height: 1.6;
  margin: 0;
  max-width: 580px;
}

/* ---- Loading ring ---- */
.pb-loading {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.pb-loading__ring {
  width: 32px;
  height: 32px;
  border: 3px solid var(--pb-surface2);
  border-top-color: var(--pb-accent);
  border-radius: 50%;
  animation: pb-spin 0.7s linear infinite;
}

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

/* ---- Report form ---- */
.pb-iw-form-wrap {
  max-width: 520px;
  margin: 40px auto;
  padding: 0 24px 80px;
}

.pb-iw-form-header {
  margin-bottom: 32px;
}

.pb-iw-form-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  margin: 0 0 6px;
}

.pb-iw-form-sub {
  font-size: 14px;
  color: var(--pb-mute);
  margin: 0 0 24px;
}

/* Step dots */
.pb-iw-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.pb-iw-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pb-surface);
  border: 2px solid var(--pb-surface2);
  color: var(--pb-faint);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.pb-iw-step--active {
  background: var(--pb-accent);
  border-color: var(--pb-accent);
  color: var(--pb-accent-ink);
}

.pb-iw-step--done {
  background: var(--pb-surface2);
  border-color: var(--pb-surface2);
  color: var(--pb-good);
}

.pb-iw-step-line {
  flex: 1;
  height: 2px;
  background: var(--pb-surface2);
  min-width: 20px;
}

/* Step panels */
.pb-iw-step-panel {
  animation: pb-fadein 0.2s ease;
}

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

.pb-iw-step-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 20px;
}

/* Chips */
.pb-iw-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--pb-mute);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.pb-iw-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pb-iw-chip {
  padding: 8px 16px;
  border-radius: var(--pb-r-pill);
  border: 1px solid var(--pb-surface2);
  background: var(--pb-surface);
  color: var(--pb-mute);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Archivo', sans-serif;
  cursor: pointer;
  transition: all 0.12s;
}

.pb-iw-chip:hover {
  border-color: rgba(244,245,247,0.2);
  color: var(--pb-ink);
}

.pb-iw-chip--active {
  background: var(--pb-accent);
  border-color: var(--pb-accent);
  color: var(--pb-accent-ink);
}

/* Severity grid */
.pb-iw-sev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pb-iw-sev-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px;
  border-radius: var(--pb-r-md);
  border: 2px solid var(--pb-surface2);
  background: var(--pb-surface);
  color: var(--pb-ink);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Archivo', sans-serif;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}

.pb-iw-sev-btn small {
  font-size: 11px;
  font-weight: 400;
  color: var(--pb-mute);
  line-height: 1.3;
}

.pb-iw-sev-btn:hover {
  background: var(--pb-surface2);
}

.pb-iw-sev-btn--active {
  border-width: 2px;
}

.pb-iw-sev-btn--minor.pb-iw-sev-btn--active { border-color: var(--pb-good); }
.pb-iw-sev-btn--moderate.pb-iw-sev-btn--active { border-color: var(--pb-warn); }
.pb-iw-sev-btn--severe.pb-iw-sev-btn--active { border-color: var(--pb-bad); }

.pb-iw-sev-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Selected racket card */
.pb-iw-selected-racket {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-md);
}

.pb-iw-selected-racket__name {
  font-size: 14px;
  font-weight: 700;
}

.pb-iw-selected-racket__change {
  margin-left: auto;
  font-size: 12px;
  color: var(--pb-accent);
  cursor: pointer;
  font-weight: 600;
}

.pb-iw-selected-racket__change:hover {
  text-decoration: underline;
}

/* Email input */
.pb-iw-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-md);
  color: var(--pb-ink);
  font-size: 14px;
  font-family: 'Archivo', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.pb-iw-input:focus {
  border-color: var(--pb-accent);
}

.pb-iw-input::placeholder {
  color: var(--pb-faint);
}

/* Disclaimer */
.pb-iw-disclaimer {
  font-size: 12px;
  color: var(--pb-faint);
  line-height: 1.6;
  margin-top: 10px;
}

.pb-iw-disclaimer a {
  color: var(--pb-mute);
  text-decoration: underline;
}

/* Success icon */
.pb-sess-done-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--pb-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ---- Racket profile page ---- */
.pb-rp-hero {
  padding: 40px 24px 32px;
  max-width: 760px;
  margin: 0 auto;
}

.pb-rp-back {
  font-size: 13px;
  color: var(--pb-mute);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
}

.pb-rp-back:hover { color: var(--pb-ink); }

.pb-rp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.pb-rp-name {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  letter-spacing: -1px;
  margin: 0 0 6px;
}

.pb-rp-meta {
  font-size: 13px;
  color: var(--pb-mute);
}

/* IRS badge — big */
.pb-irs-badge {
  text-align: center;
  flex-shrink: 0;
}

.pb-irs-badge__score {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
}

.pb-irs-badge__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--pb-mute);
  margin-top: 4px;
}

.pb-irs-badge__sub {
  font-size: 11px;
  color: var(--pb-faint);
  margin-top: 2px;
}

/* Trend sparkline */
.pb-rp-sparkline {
  padding: 24px;
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-md);
  margin-bottom: 16px;
}

.pb-rp-sparkline__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--pb-mute);
  margin-bottom: 12px;
}

.pb-rp-spark-svg {
  width: 100%;
  overflow: visible;
}

/* Breakdown cards */
.pb-rp-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .pb-rp-breakdown { grid-template-columns: 1fr; }
  .pb-iw-sev-grid { grid-template-columns: 1fr; }
  .pb-rp-header { flex-direction: column; }
}

.pb-rp-breakdown-card {
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-md);
  padding: 16px;
}

.pb-rp-breakdown-card__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--pb-mute);
  margin-bottom: 12px;
}

.pb-rp-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.pb-rp-bar-row:last-child { margin-bottom: 0; }

.pb-rp-bar-label {
  width: 80px;
  flex-shrink: 0;
  font-weight: 500;
  text-transform: capitalize;
}

.pb-rp-bar-track {
  flex: 1;
  height: 6px;
  background: var(--pb-surface2);
  border-radius: 3px;
  overflow: hidden;
}

.pb-rp-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.pb-rp-bar-count {
  width: 24px;
  text-align: right;
  color: var(--pb-faint);
  font-size: 12px;
}

/* Subscribe card */
.pb-rp-subscribe {
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.pb-rp-subscribe__title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 6px;
}

.pb-rp-subscribe__sub {
  font-size: 13px;
  color: var(--pb-mute);
  margin: 0 0 16px;
  line-height: 1.5;
}

.pb-rp-subscribe__row {
  display: flex;
  gap: 8px;
}

.pb-rp-subscribe__row .pb-iw-input {
  flex: 1;
}

/* Spike badge */
.pb-rp-spike-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 91, 91, 0.1);
  border: 1px solid rgba(255, 91, 91, 0.3);
  border-radius: var(--pb-r-md);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pb-bad);
}

/* ---- Methodology page ---- */
.pb-method-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.pb-method-wrap h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1.5px;
  margin: 0 0 8px;
}

.pb-method-wrap .pb-method-sub {
  font-size: 16px;
  color: var(--pb-mute);
  margin: 0 0 40px;
  line-height: 1.6;
}

.pb-method-section {
  margin-bottom: 40px;
}

.pb-method-section h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 12px;
}

.pb-method-section p {
  font-size: 14px;
  color: var(--pb-mute);
  line-height: 1.7;
  margin: 0 0 12px;
}

.pb-method-formula {
  background: var(--pb-surface);
  border: 1px solid var(--pb-surface2);
  border-radius: var(--pb-r-md);
  padding: 16px 20px;
  font-family: monospace;
  font-size: 13px;
  color: var(--pb-accent);
  line-height: 1.8;
  margin: 12px 0;
}

.pb-method-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}

.pb-method-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--pb-surface2);
  color: var(--pb-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.pb-method-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--pb-surface2);
  color: var(--pb-ink);
}

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

/* Empty state */
.pb-iw-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--pb-mute);
  font-size: 14px;
}

.pb-iw-empty svg {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.3;
}
