/* ==========================================================================
   Dynamo Report Cards -- design tokens & site styles
   Palette is derived from the existing Angular app's Material theme
   (primary #558b2f / accent #cddc39) so the two front ends still read as
   one product, extended into a fuller token set for this page.
   ========================================================================== */

:root {
  /* -- color: chalk & ink (neutrals) -- */
  --chalk: #faf8f2;
  --chalk-line: #e6e1d2;
  --ink: #1c2117;
  --ink-soft: #4b5245;

  /* -- color: green (brand primary family) -- */
  --green-900: #16260e;
  --green-700: #33691e;
  --green-600: #558b2f; /* brand primary, matches legacy .mat-primary */
  --green-500: #6f9e45;
  --green-100: #e7efdc;

  /* -- color: lime (brand accent, used sparingly) -- */
  --lime-400: #cddc39; /* matches legacy .mat-accent */

  /* -- color: status -- */
  --amber-500: #dd9a2b;
  --warn-500: #f44336; /* matches legacy .mat-warn */

  /* -- type -- */
  --font-display: "Oswald", "Roboto Condensed", sans-serif;
  --font-body: "Roboto", "Helvetica Neue", sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;

  /* -- layout -- */
  --content-width: 1120px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-700);
}

/* Visible keyboard focus everywhere, not just on links we style by hand */
a:focus-visible,
button:focus-visible,
.card:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--chalk-line);
  background: var(--chalk);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  height: 34px;
  width: auto;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.brand-word span {
  color: var(--green-600);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.primary-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: 6px;
}

.primary-nav a:hover {
  background: var(--green-100);
  color: var(--green-700);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--green-700);
}

.btn-ghost {
  border-color: var(--chalk-line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--green-600);
  color: var(--green-700);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 72px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  margin: 14px 0 18px;
  color: var(--ink);
}

.hero h1 em {
  font-style: normal;
  color: var(--green-600);
}

.hero p.lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

/* -- the beam: signature element, built from the real level-group
   progression (Kinder -> Mens -> Tumbling -> Womens -> Advanced) -- */

.beam-figure {
  margin: 0;
}

.beam-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-700), var(--green-600) 55%, var(--lime-400));
  box-shadow: 0 10px 24px -12px rgba(22, 38, 14, 0.45);
}

.beam-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--chalk);
  border: 3px solid var(--green-700);
  transform: translate(-50%, -50%);
}

.beam-chalk {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
  animation: chalk-travel 9s ease-in-out infinite;
}

@keyframes chalk-travel {
  0% { left: 0%; }
  50% { left: 100%; }
  100% { left: 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .beam-chalk {
    animation: none;
    left: 62%; /* parks roughly where a mid-session cohort sits */
  }
}

.beam-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 14px;
}

.beam-labels li {
  list-style: none;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.beam-labels li:first-child { text-align: left; }
.beam-labels li:last-child { text-align: right; }

/* --------------------------------------------------------------------------
   Workflow strip -- real, ordered process, so numbering is earned here
   -------------------------------------------------------------------------- */

.workflow {
  background: var(--green-900);
  color: #fff;
  padding: 40px 0;
}

.workflow .eyebrow {
  color: var(--lime-400);
}

.workflow h2 {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 22px;
  letter-spacing: 0.02em;
  margin: 6px 0 24px;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.workflow-steps li {
  position: relative;
  padding: 0 18px 0 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 18px;
}

.workflow-steps li:first-child {
  border-left: none;
  padding-left: 0;
}

.step-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--lime-400);
  margin-bottom: 6px;
}

.step-name {
  display: block;
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 4px;
}

.step-detail {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Quick links grid
   -------------------------------------------------------------------------- */

.section {
  padding: 56px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 22px;
  letter-spacing: 0.02em;
  margin: 6px 0 0;
  color: var(--ink);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--chalk-line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--green-600);
  box-shadow: 0 14px 28px -20px rgba(22, 38, 14, 0.5);
}

.card .material-icons {
  color: var(--green-600);
  font-size: 26px;
  margin-bottom: 12px;
}

.card h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 6px;
}

.card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Stats strip
   -------------------------------------------------------------------------- */

.stats {
  background: var(--green-100);
  border-top: 1px solid var(--chalk-line);
  border-bottom: 1px solid var(--chalk-line);
  padding: 32px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 32px;
  color: var(--green-700);
  display: block;
}

.stat-label {
  font-size: 13px;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--green-900);
  color: rgba(255, 255, 255, 0.75);
  padding: 28px 0;
  font-size: 13px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .card-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .workflow-steps {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 20px;
  }

  .workflow-steps li {
    border-left: none;
    padding-left: 0;
  }

  .primary-nav {
    display: none;
  }
}

@media (max-width: 560px) {
  .card-grid,
  .stats-grid,
  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .beam-labels li,
  .beam-labels li:first-child,
  .beam-labels li:last-child {
    text-align: left;
  }

  .hero {
    padding: 48px 0 32px;
  }
}

/* -------------------------------------------------------------------- */
/* Feedback messages (global)                                           */
/*                                                                      */
/* Same rules as the .messages block in athletes.css / report_cards.css, */
/* promoted here so pages that don't load those stylesheets (e.g. home, */
/* where non-admins are redirected with a notice) still render them.    */
/* -------------------------------------------------------------------- */

.messages {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.messages li {
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid transparent;
}

.messages li.success {
  background: var(--green-100);
  border-color: var(--green-600);
  color: var(--green-700);
}

.messages li.error {
  background: #fdecea;
  border-color: var(--warn-500);
  color: #a12a20;
}

.messages li.info {
  background: var(--chalk);
  border-color: var(--chalk-line);
  color: var(--ink-soft);
}

/* -------------------------------------------------------------------- */
/* Print                                                                */
/*                                                                      */
/* Drop the site chrome (brand header with its nav and "Site Admin"     */
/* button, and the footer with its "Site Admin" link) from every        */
/* printed page -- only the page content itself should print.           */
/* -------------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer {
    display: none !important;
  }
}

/* ---------------------------------------------------------------------- */
/* Shared athlete autocomplete picker (templates/partials/athlete_search.html */
/* + static/js/athlete_search.js). Used on the testing-sheet render page      */
/* (~!ATHLETE!~-family tokens), the New Report Card wizard (Step 1), and the  */
/* report-cards list search. With 5k+ active athletes the options come from   */
/* the athlete-search JSON endpoint as you type instead of <option> tags.     */
/* ---------------------------------------------------------------------- */

.rc-athlete-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}

.rc-athlete-picker .material-icons {
  font-size: 20px;
}

.rc-athlete-input {
  width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--chalk-line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}

.rc-athlete-input:focus {
  outline: 2px solid var(--green-600);
  outline-offset: -1px;
}

.rc-athlete-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 26px; /* clears the person_search icon */
  z-index: 30;
  min-width: 240px;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--chalk-line);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px -12px rgba(22, 38, 14, 0.4);
}

.rc-athlete-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.rc-athlete-option:hover,
.rc-athlete-option.rc-athlete-active {
  background: var(--green-100);
}

.rc-athlete-empty {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-soft);
}
