/* ============================================================
   Practice benchmark report — FTA editorial instrument.
   Warm paper, hairline rules, gold accents, a per-metric
   deviation meter. Extends tokens from styles.css.
   ============================================================ */

body.report-page {
  overflow: auto;
  min-height: 100%;
  height: auto;
}

.report-bg { background: var(--paper); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Sticky nav ---------- */
.report-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.05) blur(8px);
  backdrop-filter: saturate(1.05) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.report-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.report-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-nav-cta {
  padding: 10px 18px;
  font-size: 14px;
  text-decoration: none;
}

/* ---------- Shell ---------- */
.report-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px 80px;
  min-height: calc(var(--vh) - 72px);
  display: flex;
  flex-direction: column;
}

/* ---------- Intro ---------- */
.report-intro {
  padding: clamp(40px, 6vw, 64px) 0 0;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 30px;
  animation: report-fade-up 480ms var(--ease-out) both;
}

.report-title {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.06;
  letter-spacing: var(--tracking-tight);
  color: var(--fg-1);
  text-wrap: balance;
}

.report-lede {
  margin: 16px 0 0;
  max-width: 42rem;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-2);
}

.report-steps-hint {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}

.report-steps-hint li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg-2);
}

.report-steps-hint li span {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--gold);
  color: var(--gold-deep);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Form panel ---------- */
.report-panel {
  margin-top: 30px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--ink);
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: report-fade-up 560ms var(--ease-out) 80ms both;
}

.report-form {
  margin: 0;
  padding: 0;
}

.report-form-section {
  padding: 30px 32px 28px;
  border-bottom: 1px solid var(--rule);
}

.report-form-section:last-of-type {
  border-bottom: none;
}

.report-form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.report-step-num {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
}

.report-step-num--done {
  background: var(--gold);
  color: var(--ink);
}

.report-form-section-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
  color: var(--fg-1);
}

.report-form-section-hint {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--fg-3);
}

.report-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 22px;
}

@media (max-width: 640px) {
  .report-form-section { padding: 24px 20px; }
  .report-form-grid { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.field-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.3;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--ring-gold);
}

/* ---------- Email gate ---------- */
.report-gate,
.report-sent {
  margin-top: 28px;
  animation: report-fade-up 420ms var(--ease-out) both;
}

.report-gate-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.report-gate-card--sent {
  text-align: center;
}

.report-gate-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold-deep);
}

.report-gate-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 800;
  color: var(--fg-1);
  line-height: 1.2;
}

.report-gate-lede {
  margin: 12px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--fg-2);
}

.report-gate-form {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.report-gate-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.report-sent-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--gold-tint);
  color: var(--gold-deep);
  border: 1px solid var(--gold-tint-2);
}

.report-sent-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--fg-3);
}

/* ---------- Custom dropdown ---------- */
.dd { position: relative; }

.dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.dd-trigger:hover { border-color: var(--gold-deep); background: var(--surface); }

.dd-trigger:focus,
.dd.is-open .dd-trigger {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--ring-gold);
  background: var(--surface);
}

.dd-trigger:disabled { opacity: 0.55; cursor: not-allowed; }

.dd-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-placeholder { color: var(--fg-4); font-weight: 500; }

.dd-chevron {
  flex: none;
  color: var(--fg-3);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}

.dd.is-open .dd-chevron { transform: rotate(180deg); color: var(--gold-deep); }

.dd-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: report-fade-up 150ms var(--ease-out) both;
}

.dd-search-wrap {
  padding: 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.dd-search {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 14px;
}

.dd-search:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring-gold); }

.dd-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 244px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-tint-2) transparent;
}

.dd-list::-webkit-scrollbar { width: 8px; }
.dd-list::-webkit-scrollbar-thumb {
  background: var(--gold-tint-2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.dd-list::-webkit-scrollbar-track { background: transparent; }

.dd-option {
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg-1);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.dd-option:hover,
.dd-option:focus-visible {
  background: var(--gold-tint);
  color: var(--ink);
  outline: none;
}

.dd-option.is-selected {
  background: var(--ink);
  color: var(--gold);
  font-weight: 700;
}

.dd-empty {
  margin: 0;
  padding: 16px 14px;
  font-size: 14px;
  color: var(--fg-3);
  text-align: center;
}

/* ---------- Metrics ---------- */
.metric-fieldset { margin: 0; padding: 0; border: none; }

.metric-groups {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.metric-group-title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold-ink);
}

.metric-list {
  display: flex;
  flex-direction: column;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
  gap: 14px;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur) var(--ease);
}

.metric-row:last-child { border-bottom: none; }

.metric-row.is-active { background: var(--gold-tint); }
.metric-row.is-active { box-shadow: inset 2px 0 0 var(--gold); padding-left: 12px; }

.metric-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  color: var(--fg-1);
  font-size: 15px;
  font-weight: 600;
}

.metric-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-deep);
  flex: none;
}

.metric-value {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-1);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.metric-value:disabled {
  opacity: 0.5;
  background: var(--surface-3);
  cursor: not-allowed;
}

.metric-value:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring-gold); }

@media (max-width: 560px) {
  .metric-row { grid-template-columns: 1fr; }
}

/* ---------- Actions ---------- */
.report-form-actions {
  padding: 22px 32px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  background: var(--paper-edge);
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .report-form-actions { padding: 18px 20px 22px; }
}

.form-error {
  margin: 0;
  flex: 1 1 100%;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.report-submit {
  min-width: 210px;
  justify-content: center;
  position: relative;
  text-decoration: none;
  padding: 15px 26px;
}

.report-submit-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(251, 247, 236, 0.3);
  border-top-color: #FBF7EC;
  border-radius: 50%;
  animation: report-spin 0.7s linear infinite;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* ---------- Output ---------- */
.report-output {
  margin-top: 44px;
  padding-top: 8px;
  animation: report-fade-up 420ms var(--ease-out) both;
}

.report-output-header { margin-bottom: 20px; }

.report-output-head-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.report-output-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  letter-spacing: var(--tracking-snug);
  color: var(--fg-1);
}

.report-output-sub {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--fg-3);
}

.report-output-edit-hint {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--fg-2);
}

.report-output-edit-hint a {
  color: var(--gold-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-output-edit-hint a:hover {
  color: var(--fg-1);
}

.report-form-unlocked-hint {
  margin: 0;
  flex: 1 1 180px;
  font-size: 13.5px;
  color: var(--fg-3);
  line-height: 1.4;
}

.report-cohort-card {
  margin-top: 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-left: 2px solid var(--gold);
  background: var(--gold-tint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.report-cohort-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--gold-deep);
  border: 1px solid var(--gold-tint-2);
}

.report-cohort {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-1);
  font-weight: 600;
}

.report-footnote {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-3);
}

.report-rows {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-row {
  padding: 24px 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  animation: report-fade-up 400ms var(--ease-out) both;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.report-row:hover { box-shadow: var(--shadow-sm); border-color: var(--gold-tint-2); }

.report-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.report-row-label {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: var(--tracking-snug);
  color: var(--fg-1);
}

.report-row-yours {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.report-row-yours strong {
  display: inline-block;
  margin-left: 8px;
  color: var(--fg-1);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 640px) {
  .report-row { padding: 20px 18px 18px; }
}

/* ---------- Position line (your value vs peer medians) ---------- */
.bench { margin-top: 6px; }

.bench-axis {
  position: relative;
  height: 64px;
}

.bench-linebg {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  height: 2px;
  border-radius: 2px;
  background: var(--surface-3);
}

.bench-bar {
  position: absolute;
  top: 35px;
  height: 4px;
  border-radius: 2px;
}

.bench-bar.is-above { background: var(--available-fg); }
.bench-bar.is-below { background: var(--danger); }
.bench-bar.is-flat { background: var(--fg-4); }

.bench-tick {
  position: absolute;
  top: 28px;
  width: 2px;
  height: 16px;
  transform: translateX(-1px);
  background: var(--fg-3);
  border-radius: 1px;
}

.bench-tick.loc { top: 26px; height: 20px; background: var(--fg-1); }

.bench-tlabel {
  position: absolute;
  top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg-3);
  white-space: nowrap;
  transform: translateX(-50%);
}

.bench-tlabel.below { top: 46px; color: var(--fg-1); }

.bench-you {
  position: absolute;
  top: 36px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--surface);
}

.bench-you.is-above { background: var(--available-fg); box-shadow: 0 0 0 1.5px var(--available-fg); }
.bench-you.is-below { background: var(--danger); box-shadow: 0 0 0 1.5px var(--danger); }
.bench-you.is-flat { background: var(--fg-3); box-shadow: 0 0 0 1.5px var(--fg-3); }

.bench-youlab {
  position: absolute;
  top: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-1);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bench-youlab strong { font-weight: 800; }

.bench-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.bench-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bench-chip.is-above { background: color-mix(in srgb, var(--available-fg) 12%, var(--surface)); color: var(--available-fg); }
.bench-chip.is-below { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.bench-chip.is-flat { background: var(--surface-2); color: var(--fg-3); }
.bench-chip.is-muted { background: var(--surface-2); color: var(--fg-3); font-weight: 600; }
.bench-chip .ar { font-size: 11px; }

.bench-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-size: 12.5px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.bench-legend b { color: var(--fg-1); font-weight: 700; }

.bench-key { display: inline-flex; align-items: center; gap: 7px; }
.bench-key i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bench-key i.tick { width: 2px; height: 12px; border-radius: 1px; }

@media (max-width: 560px) {
  .bench-youlab { font-size: 12px; }
}

/* ---------- Footer ---------- */
.report-footer {
  margin-top: auto;
  padding-top: 52px;
}

.report-footer p {
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-3);
  max-width: 44rem;
}

/* ---------- Motion ---------- */
@keyframes report-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 560px) {
  .report-shell { padding: 0 22px 72px; }
  .report-nav-inner { padding: 12px 22px; }
  .brand-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .report-intro,
  .report-panel,
  .report-output,
  .report-row,
  .report-submit-spinner,
  .dd-panel { animation: none; }
}
