/* ==========================================================================
   NBA MEMBERSHIP PORTAL — ROOT STYLE FILE
   Every page (public site, member portal, branch panel, admin panel) pulls
   from this file only. To rebrand or retheme the entire portal, edit the
   custom properties below — never hardcode a color, font, radius, or shadow
   value anywhere else in the codebase.

   DESIGN DIRECTION
   The Bar is a body of record — call to bar, seal, standing, are all things
   that are certified, dated, and stamped. The design should feel like a
   well-kept institutional register, not a SaaS product: quiet authority,
   generous whitespace, a single gold rule used the way a seal or ribbon
   would be used on a certificate, rather than as decoration everywhere.

   COLOR — NBA brand marks, assigned roles below:
     --nba-green     #008000  primary — authority, action, the Bar's own color
     --nba-honeydew  #F0FFF0  base page background (never stark white)
     --nba-white     #FFFFFF  card/surface background, sits ON the honeydew
     --nba-gold      #FFD700  the "seal" accent — status marks, dividers,
                               official/certified moments ONLY (used sparingly)
     --nba-lime      #7CFC00  reserved for live/active state only (e.g. an
                               in-progress tracker step) — never decorative

   TYPE — Montserrat (display, bold, set wide) carries institutional weight
   for headings and numerals; Poppins (light/regular) carries body copy for
   warmth and legibility. Never mix a third family in.

   LAYOUT — left-aligned, document-like column widths (max 720px body copy),
   asymmetric section entries (content off-center against a full-bleed
   honeydew/green field), a thin gold rule as the one recurring structural
   device — used only where something is being certified/confirmed, echoing
   a physical seal or ribbon, not as a generic divider.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Poppins:wght@300;400;500;600&display=swap');

:root {
  /* ---- Brand colors (do not add new hexes elsewhere — extend here) ---- */
  --nba-green: #008000;
  --nba-green-deep: #045c2b;   /* derived: hover/active state for green */
  --nba-honeydew: #F0FFF0;
  --nba-white: #FFFFFF;
  --nba-gold: #FFD700;
  --nba-gold-deep: #C9A600;    /* derived: text-on-light gold, AA-safe */
  --nba-lime: #7CFC00;

  /* ---- Neutrals (derived only — never introduce a new grey ad hoc) ---- */
  --ink: #14231A;              /* near-black with a green undertone, for body text */
  --ink-soft: #4B5B52;         /* secondary text */
  --line: #D8E8DC;             /* hairline borders on honeydew/white */

  /* ---- Type ---- */
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Poppins', sans-serif;

  /* ---- Scale (Elements of Typographic Style-ish ratio ~1.25) ---- */
  --step-00: 1rem;       /* 16px body */
  --step-01: 1.25rem;    /* 20px */
  --step-02: 1.563rem;   /* 25px */
  --step-03: 1.953rem;   /* 31px */
  --step-04: 2.441rem;   /* 39px */
  --step-05: 3.052rem;   /* 49px */
  --step-06: 3.815rem;   /* 61px — hero only */

  /* ---- Spacing (8px base) ---- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;

  /* ---- Structure ---- */
  --radius-card: 4px;          /* deliberately restrained — a register, not a bubble */
  --radius-pill: 999px;        /* status chips only */
  --content-max: 1180px;
  --prose-max: 720px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------------------------------------------------------------------- */
/* Reset & base                                                          */
/* ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--nba-honeydew);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--step-00);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* belt-and-braces: nothing on the site should be able to force horizontal scroll on a phone */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--nba-green);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 { font-size: var(--step-05); }
h2 { font-size: var(--step-04); }
h3 { font-size: var(--step-03); }
h4 { font-size: var(--step-02); font-weight: 600; }

p { margin: 0 0 var(--space-2); max-width: var(--prose-max); }
.lede { font-size: var(--step-01); color: var(--ink-soft); font-weight: 300; }

/* ---------------------------------------------------------------------- */
/* Layout primitives                                                     */
/* ---------------------------------------------------------------------- */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}
.section { padding-block: var(--space-6); }
.section--green {
  background: var(--nba-green);
  color: var(--nba-honeydew);
}
.section--green h1, .section--green h2, .section--green h3 { color: var(--nba-white); }

/* The one recurring structural device: a thin gold rule marking something
   official/confirmed. Use sparingly — under a certified figure, above a
   receipt, beside an issued document — never as a generic section divider. */
.seal-rule {
  width: 64px;
  height: 3px;
  background: var(--nba-gold);
  border: none;
  margin: var(--space-2) 0 var(--space-3);
}

/* ---------------------------------------------------------------------- */
/* Navigation                                                            */
/* ---------------------------------------------------------------------- */
.nav {
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--line);
  background: var(--nba-honeydew);
}
.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: var(--space-4);
  position: relative; /* anchors the mobile dropdown below */
}

.nav__links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: var(--space-3);   /* was var(--space-4) — one more link now needs the room */
  font-weight: 500;
}
.nav__links a:not(.btn) { color: var(--ink-soft); transition: color .15s var(--ease); }
.nav__links a:not(.btn):hover { color: var(--nba-green); }
.nav__brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

/* Hamburger toggle — hidden on desktop, shown only under the mobile
   breakpoint below. A plain button so it works with no JS framework. */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--nba-white);
  cursor: pointer;
  flex: 0 0 auto;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: background-color .15s var(--ease);
}
.nav__toggle span::before,
.nav__toggle span::after { content: ""; position: absolute; left: 0; }
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }

/* ---------------------------------------------------------------------- */
/* Buttons                                                               */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.btn--primary { background: var(--nba-green); color: var(--nba-white); }
.btn--primary:hover { background: var(--nba-green-deep); }
.btn--ghost { background: transparent; border-color: var(--nba-green); color: var(--nba-green); }
.btn--ghost:hover { background: var(--nba-green); color: var(--nba-white); }
.btn--gold { background: var(--nba-gold); color: var(--ink); }
.btn--gold:hover { background: var(--nba-gold-deep); color: var(--nba-white); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* Cards & surfaces                                                      */
/* ---------------------------------------------------------------------- */
.card {
  background: var(--nba-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}
.card--stat {
  border-left: 3px solid var(--nba-green);
}

/* Status chips — one shape, color communicates state (not shape/size) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
}
.chip--pending { background: #FFF6D6; color: #8A6D00; }
.chip--active  { background: #EFFFE0; color: #3E7A00; }
.chip--good    { background: #E3F5E7; color: var(--nba-green-deep); }
.chip--issue   { background: #FDE8E8; color: #A32828; }

/* ---------------------------------------------------------------------- */
/* Stamp & Seal tracker — the signature interaction of the member portal */
/* ---------------------------------------------------------------------- */
.tracker { list-style: none; margin: var(--space-4) 0; padding: 0; }
.tracker__step {
  position: relative;
  padding: 0 0 var(--space-4) var(--space-4);
  border-left: 2px solid var(--line);
}
.tracker__step:last-child { border-left-color: transparent; padding-bottom: 0; }
.tracker__dot {
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--nba-white);
  border: 2px solid var(--line);
}
.tracker__step.is-done .tracker__dot { background: var(--nba-green); border-color: var(--nba-green); }
.tracker__step.is-current .tracker__dot {
  background: var(--nba-lime);
  border-color: var(--nba-lime);
  box-shadow: 0 0 0 4px rgba(124, 252, 0, 0.25);
}
.tracker__label { font-family: var(--font-display); font-weight: 600; font-size: var(--step-00); }
.tracker__meta { color: var(--ink-soft); font-size: 0.875rem; margin-top: 2px; }

/* ---------------------------------------------------------------------- */
/* Forms                                                                 */
/* ---------------------------------------------------------------------- */
label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.4rem; }
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--nba-white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--nba-green);
  box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.12);
}

input:disabled, select:disabled, textarea:disabled {
  color: var(--nba-gold);
  -webkit-text-fill-color: var(--nba-gold); /* Safari/iOS overrides plain color on disabled fields otherwise */
  opacity: 1;
  background: #FAFAF0;
  cursor: not-allowed;
}
.field { margin-bottom: var(--space-3); }
.field-error { color: #A32828; font-size: 0.85rem; margin-top: 0.3rem; }

/* ---------------------------------------------------------------------- */
/* Table (SCN roster validation, dispatch lists, etc.)                   */
/* ---------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.925rem; }
th { font-family: var(--font-display); font-weight: 600; color: var(--ink-soft); font-size: 0.8rem; }
tr.is-flagged td { background: #FDF3F3; }

/* ---------------------------------------------------------------------- */
/* Utility                                                               */
/* ---------------------------------------------------------------------- */
.text-soft { color: var(--ink-soft); }
.text-gold { color: var(--nba-gold-deep); }
.mt-0 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }

/* Any table meant to scroll rather than crush on a phone — wrap the
   <table> in <div class="table-scroll"> where a page has a wide one
   (roster lists, dispatch lists, admin queues). Doesn't require touching
   every table markup at once; add the wrapper page-by-page as needed. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------------- */
/* Mobile breakpoint                                                     */
/* ---------------------------------------------------------------------- */
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: var(--step-04); }

  /* Public nav: a real hamburger + dropdown, not a vanished menu. The
     toggle is shown, .nav__links collapses into an absolutely-positioned
     panel under the bar, and JS (in the layout) flips .is-open on click. */
  .nav__toggle { display: inline-flex; }
  .nav__links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--nba-white);
    border: 1px solid var(--line);
    border-top: none;
    padding: var(--space-2) var(--space-3);
    box-shadow: 0 12px 24px rgba(20, 35, 26, .12);
    z-index: 100;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .75rem 0; border-bottom: 1px solid var(--line); white-space: normal; }
  .nav__links a:last-child { border-bottom: none; }
  .nav__links a.btn { margin-top: .5rem; justify-content: center; }

  /* Member / Admin / Branch portal shell: on desktop this is a fixed
     240px sidebar + content grid (defined per-layout). Below 860px it
     becomes a slide-in drawer over the content instead of a full-width
     block stacked above it — the sidebar no longer eats the top of every
     page before the actual content appears. */
  .portal-shell { grid-template-columns: 1fr !important; }
  .portal-side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform .25s var(--ease);
    z-index: 210;
    overflow-y: auto;
  }
  .portal-side.is-open { transform: translateX(0); box-shadow: 6px 0 28px rgba(0,0,0,.28); }
  .portal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 15, .5);
    z-index: 205;
  }
  .portal-overlay.is-open { display: block; }
  .portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--nba-white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 150;
  }
  .portal-topbar__brand { font-family: var(--font-display); font-weight: 800; color: var(--ink); font-size: 1rem; }
  .portal-main { padding: var(--space-3); }
}

@media (min-width: 861px) {
  .portal-topbar { display: none; }
  .portal-overlay { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}