/*
 * Growth Partner — gp- component classes (UX overhaul phase 0)
 *
 * The shared building blocks of the Airclima redesign, ported from the
 * mock-up's app.css (docs/ux-overhaul/mockup/) under a `gp-` prefix:
 * .card -> .gp-card, .eb -> .gp-eyebrow, .sc -> .gp-score, .chip -> .gp-chip,
 * .btn.p -> .gp-btn-primary, .seg -> .gp-seg, .kpi -> .gp-kpi, …
 *
 * Every colour comes from the :root tokens in application.css (served first,
 * Propshaft `stylesheet_link_tag :app` links every file in this folder).
 * Text colours are guarded by test/assets/color_contrast_test.rb.
 *
 * Rules: classes only (CSP: no inline style=). Page-specific CSS does NOT go
 * here — it lives in ux_<area>.css, one file per area. Phone rules at the
 * bottom of the file.
 *
 * Montserrat ships at 600/700 only (public/fonts/), so the mock-up's 800
 * headings render at 700 until montserrat-800.woff2 is committed.
 */

/* ── Card ── */
.gp-card {
  background: #fff; border: 1px solid var(--gp-line); border-radius: 14px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
  color: var(--gp-ink); min-width: 0;
}
.gp-card-flush { padding: 0; gap: 0; overflow: hidden; }
.gp-card-navy { background: var(--gp-navy); border-color: var(--gp-navy); color: var(--gp-on-navy-body); }
.gp-card-navy .gp-eyebrow { color: var(--gp-green); }
.gp-card-navy h2, .gp-card-navy h3, .gp-card-navy strong { color: #fff; }

/* ── Eyebrow: green square + uppercase navy label ── */
.gp-eyebrow {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--gp-font-heading); font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--gp-navy);
}
.gp-eyebrow::before { content: ""; width: 9px; height: 9px; background: var(--gp-green); flex: none; }

/* ── Page title: plain, one line, no slogan ── */
.gp-page-title {
  margin: 0; font-family: var(--gp-font-heading); font-weight: 800;
  font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; color: var(--gp-navy);
}

/* ── Score badge ── hi = green fill navy text, md = amber tint, lo = grey */
.gp-score {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  font-family: var(--gp-font-heading); font-weight: 700; font-size: 1.2rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.gp-score-hi { background: var(--gp-green); color: var(--gp-navy); border-color: var(--gp-green); }
.gp-score-md { background: var(--gp-amber-tint); color: var(--gp-amber-ink); border-color: var(--gp-amber); }
.gp-score-lo { background: var(--gp-surface); color: var(--gp-body); border-color: var(--gp-line); }
.gp-score-s { width: 34px; height: 34px; border-radius: 9px; font-size: 0.95rem; }
.gp-score-xl { width: 76px; height: 76px; border-radius: 18px; font-size: 2.1rem; }

/* ── Chips ── each *-ink on its own *-tint */
.gp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  background: var(--gp-surface); color: var(--gp-body); border: 1px solid var(--gp-line);
}
.gp-chip-green { background: var(--gp-green-tint); color: var(--gp-green-ink); border-color: var(--gp-green-border); }
.gp-chip-amber { background: var(--gp-amber-tint); color: var(--gp-amber-ink); border-color: var(--gp-amber-border); }
.gp-chip-red { background: var(--gp-red-tint); color: var(--gp-red-ink); border-color: var(--gp-red-border); }
.gp-chip-violet { background: var(--gp-violet-tint); color: var(--gp-violet-ink); border-color: var(--gp-violet-border); }
.gp-chip-navy { background: var(--gp-navy); color: #fff; border-color: var(--gp-navy); }
.gp-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--gp-body); flex: none; display: inline-block; }
.gp-dot-green { background: var(--gp-green); }
.gp-dot-amber { background: var(--gp-amber); }
.gp-dot-red { background: var(--gp-red-ink); }
.gp-dot-navy { background: var(--gp-navy); }

/* ── Buttons ──
   Default = white with navy outline. Primary = THE one action per surface:
   green fill, navy text. Pico styles <button>/[role=button] too, so width,
   margin and colours are restated here. */
.gp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; height: 36px; margin: 0; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--gp-navy);
  background: #fff; color: var(--gp-navy);
  font-family: inherit; font-weight: 700; font-size: 0.85rem; line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.gp-btn:hover { background: var(--gp-surface); color: var(--gp-navy); }
.gp-btn-primary {
  background: var(--gp-green); border-color: var(--gp-green); color: var(--gp-navy);
  font-family: var(--gp-font-heading);
}
.gp-btn-primary:hover { background: var(--gp-green-hover); border-color: var(--gp-green-hover); color: var(--gp-navy); }
.gp-btn-navy { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }
.gp-btn-navy:hover { background: var(--gp-navy-raised); border-color: var(--gp-navy-raised); color: #fff; }
.gp-btn-quiet { background: #fff; border-color: var(--gp-line); color: var(--gp-ink); font-weight: 600; }
.gp-btn-quiet:hover { background: var(--gp-surface); color: var(--gp-ink); }
.gp-btn-sm { height: 30px; padding: 0 10px; font-size: 0.8rem; border-radius: 8px; }
.gp-btn-lg { height: 48px; padding: 0 20px; font-size: 1rem; border-radius: 12px; }
.gp-btn:focus-visible { outline: 2px solid var(--gp-navy); outline-offset: 2px; }

/* ── Segmented control ──
   The current segment: .active / aria-current / aria-pressed / aria-selected. */
.gp-seg {
  display: inline-flex; max-width: 100%; overflow-x: auto;
  background: #fff; border: 1px solid var(--gp-line); border-radius: 10px;
  padding: 3px; gap: 3px;
}
.gp-seg > a, .gp-seg > button, .gp-seg > label {
  width: auto; margin: 0; border: 0; background: transparent;
  padding: 5px 12px; border-radius: 7px; white-space: nowrap;
  color: var(--gp-body); font-weight: 600; font-size: 0.85rem; text-decoration: none;
}
.gp-seg > .active, .gp-seg > [aria-current="page"], .gp-seg > [aria-pressed="true"], .gp-seg > [aria-selected="true"] {
  background: var(--gp-navy); color: #fff;
}

/* ── Tabs ── navy label, decorative green underline on the current tab */
.gp-tabs {
  display: flex; gap: 26px; border-bottom: 1px solid var(--gp-line);
  overflow-x: auto; scrollbar-width: thin;
}
.gp-tabs > a, .gp-tabs > button {
  width: auto; margin: 0 0 -1px; padding: 10px 0; white-space: nowrap;
  background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  color: var(--gp-body); font-weight: 700; text-decoration: none;
}
.gp-tabs > .active, .gp-tabs > [aria-current="page"], .gp-tabs > [aria-selected="true"] {
  color: var(--gp-navy); border-bottom-color: var(--gp-green);
}

/* ── Avatar (initials) ── */
.gp-avatar {
  flex: none; width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gp-navy); color: #fff;
  font-family: var(--gp-font-heading); font-weight: 700; font-size: 0.7rem;
}
.gp-avatar-green { background: var(--gp-green); color: var(--gp-navy); }
.gp-avatar-grey { background: var(--gp-body); color: #fff; }
.gp-avatar-lg { width: 40px; height: 40px; font-size: 0.85rem; }

/* ── Timeline ── a vertical rail joining the avatars of each entry */
.gp-timeline { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.gp-timeline-item { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.gp-timeline-item::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 2px; background: var(--gp-line);
}
.gp-timeline-item:last-child::before { display: none; }

/* ── Steps ── done = navy, now = green fill with navy number */
.gp-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.gp-step { display: flex; align-items: center; gap: 8px; color: var(--gp-body); font-weight: 700; font-size: 0.85rem; }
.gp-step-dot {
  width: 22px; height: 22px; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--gp-line); background: #fff; color: var(--gp-body);
  font-family: var(--gp-font-heading); font-weight: 700; font-size: 0.7rem; font-style: normal;
}
.gp-step-done, .gp-step-now { color: var(--gp-navy); }
.gp-step-done .gp-step-dot { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }
.gp-step-now .gp-step-dot { background: var(--gp-green); border-color: var(--gp-green); color: var(--gp-navy); }
.gp-step-bar { flex: 1 1 24px; height: 2px; min-width: 16px; background: var(--gp-line); }

/* ── Meter ── on a native <progress value max>: the fill comes from the
   attribute, so no inline width style is needed (CSP). */
progress.gp-meter, .gp-meter {
  display: block; width: 100%; height: 6px; margin: 0;
  appearance: none; -webkit-appearance: none;
  border: 0; border-radius: 999px; overflow: hidden;
  background: var(--gp-surface);
}
.gp-meter::-webkit-progress-bar { background: var(--gp-surface); border-radius: 999px; }
.gp-meter::-webkit-progress-value { background: var(--gp-green); border-radius: 999px; }
.gp-meter::-moz-progress-bar { background: var(--gp-green); border-radius: 999px; }

/* ── KPI tile ── */
.gp-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.gp-kpi {
  background: #fff; border: 1px solid var(--gp-line); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
  color: var(--gp-ink); text-decoration: none;
}
.gp-kpi-value {
  font-family: var(--gp-font-heading); font-weight: 700; font-size: 2.1rem; line-height: 1.1;
  color: var(--gp-navy); font-variant-numeric: lining-nums tabular-nums;
}
.gp-kpi-label { color: var(--gp-body); font-size: 0.85rem; }
.gp-kpi-navy { background: var(--gp-navy); border-color: var(--gp-navy); color: var(--gp-on-navy-body); }
.gp-kpi-navy .gp-kpi-value { color: var(--gp-green); }
.gp-kpi-navy .gp-kpi-label { color: var(--gp-on-navy-body); }

/* ── List item ── row inside a flush card */
.gp-list { margin: 0; padding: 0; list-style: none; }
.gp-list-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 20px; border-top: 1px solid var(--gp-line); min-width: 0;
}
.gp-list-item:first-child { border-top: 0; }
.gp-list-item-selected { background: var(--gp-green-tint); box-shadow: inset 3px 0 0 var(--gp-green); }
.gp-grow { flex: 1 1 0; min-width: 0; }

/* ── Split layout: wide column + rail ── */
.gp-split { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.gp-split-wide { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.gp-split-rail { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ── Banner ("punch"): green fill, navy text ── */
.gp-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 14px;
  background: var(--gp-green); color: var(--gp-navy);
  font-family: var(--gp-font-heading); font-weight: 700; font-size: 1rem;
}

/* ── Toasts ── top-right stack (#gp-toasts in the layout, shared/_toast).
   The container ignores the pointer so it never blocks the page under it. */
.gp-toasts {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.gp-toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px; background: #fff;
  border: 1px solid var(--gp-line); border-left: 4px solid var(--gp-green); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
.gp-toast-warn { border-left-color: var(--gp-amber); }
.gp-toast-alert { border-left-color: var(--gp-danger); }
.gp-toast-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gp-toast-title { color: var(--gp-ink); font-size: 0.9rem; overflow-wrap: anywhere; }
.gp-toast-text { margin: 0; color: var(--gp-body); font-size: 0.85rem; }
.gp-toast-link { align-self: flex-start; margin-top: 4px; font-weight: 700; font-size: 0.85rem; }
.gp-toast-close {
  flex: none; width: auto; margin: 0; padding: 2px 6px; line-height: 1;
  background: none; border: 0; color: var(--gp-body); font-size: 1.2rem; cursor: pointer;
}
.gp-toast-close:hover { color: var(--gp-ink); background: none; }

/* ── Phone rules ── (kept last: same specificity as the rules above, so
   source order decides) */
@media (max-width: 768px) {
  .gp-card { padding: 14px; }
  .gp-page-title { font-size: 1.4rem; }
  .gp-score-xl { width: 56px; height: 56px; border-radius: 14px; font-size: 1.6rem; }
  .gp-split-wide, .gp-split-rail { flex-basis: 100%; }
  .gp-list-item { flex-wrap: wrap; padding: 12px 14px; }
  .gp-list-item > .gp-grow { flex-basis: 180px; }
  .gp-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gp-tabs { gap: 22px; flex-wrap: nowrap; }
  /* Touch targets >= 40px. */
  .gp-btn, .gp-btn-sm { min-height: 40px; }
  .gp-btn-lg { min-height: 48px; }
  .gp-toasts { top: 12px; right: 12px; left: 12px; width: auto; }
  .gp-toast-close { min-width: 40px; min-height: 40px; }
  .gp-seg > a, .gp-seg > button, .gp-seg > label { min-height: 40px; display: inline-flex; align-items: center; }
  .gp-tabs > a, .gp-tabs > button { min-height: 40px; display: inline-flex; align-items: center; }
}

@media (hover: none) and (pointer: coarse) {
  .gp-btn, .gp-btn-sm { min-height: 40px; }
}
