/* =========================================================================
   benefits — member benefits wallet (BRIEF §14 Batch B)
   Owns every .ben-* class. Tokens come from css/app.css, so light and dark
   both follow the shell; the only per-theme values here are the category
   tints and the honesty-note amber, redefined in the dark block below.
   ========================================================================= */

:root {
  --ben-tint-insurance: #e7f0fb;
  --ben-tint-software: #ece9fb;
  --ben-tint-equipment: #e6f3ee;
  --ben-tint-fuel: #fdeee5;
  --ben-tint-hotels: #fbeaf0;
  --ben-tint-compliance: #eef0f6;
  --ben-tint-training: #e9f2e6;
  --ben-tint-other: #eef1f7;

  --ben-ink-insurance: #1f4f8f;
  --ben-ink-software: #4a3d9b;
  --ben-ink-equipment: #146b4c;
  --ben-ink-fuel: #a8500f;
  --ben-ink-hotels: #9c2f57;
  --ben-ink-compliance: #3b4661;
  --ben-ink-training: #3c6b2a;
  --ben-ink-other: #3b4661;

  --ben-note-bg: #fff4d9;
  --ben-note-ink: #7a4d05;
  --ben-note-line: #e8c479;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ben-tint-insurance: #16263e;
    --ben-tint-software: #221f3d;
    --ben-tint-equipment: #122c25;
    --ben-tint-fuel: #332012;
    --ben-tint-hotels: #301823;
    --ben-tint-compliance: #1c2436;
    --ben-tint-training: #1a2a17;
    --ben-tint-other: #1c2436;

    --ben-ink-insurance: #8fb8ea;
    --ben-ink-software: #b0a5f0;
    --ben-ink-equipment: #62c9a2;
    --ben-ink-fuel: #efa470;
    --ben-ink-hotels: #e894b2;
    --ben-ink-compliance: #a9b4cd;
    --ben-ink-training: #9ccb8a;
    --ben-ink-other: #a9b4cd;

    --ben-note-bg: #33290f;
    --ben-note-ink: #f0cb7d;
    --ben-note-line: #56431a;
  }
}

/* ---------------------------------------------------------------- intro */

.ben-intro .section-head { margin-bottom: var(--s-2); }

/* The honesty line. It must stay legible, not decorative — no company here
   has agreed to anything and the screen has to say so out loud. */
.ben-disclaim {
  font-size: .82rem;
  line-height: 1.45;
  color: var(--ink-2);
  background: var(--ben-note-bg);
  border: 1px solid var(--ben-note-line);
  border-radius: var(--r-sm);
  padding: var(--s-3);
}

.ben-highlight .ben-disclaim {
  background: none;
  border: 0;
  padding: var(--s-2) 0 0;
  color: var(--muted);
}

/* ---------------------------------------------------------------- stats */

.ben-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-3);
}

.ben-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 62px;
  padding: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-1);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.ben-stat.ben-stat-static { cursor: default; }

.ben-stat:not(.ben-stat-static):hover { background: var(--surface-2); }

.ben-stat:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ben-stat.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.ben-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.ben-stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

/* --------------------------------------------------------------- search */

.ben-search-wrap { margin-bottom: var(--s-3); }

.ben-search { width: 100%; display: block; }

.ben-search::-webkit-search-decoration,
.ben-search::-webkit-search-results-button { -webkit-appearance: none; }

.ben-filters { margin-bottom: var(--s-4); }

/* ---------------------------------------------------------------- cards */

.ben-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}

@media (min-width: 620px) {
  .ben-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ben-card {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.ben-card-past { opacity: .62; }

.ben-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  padding-right: 46px;
  background: none;
  border: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.ben-main:hover { background: var(--surface-2); }

.ben-main:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.ben-top {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  min-width: 0;
}

.ben-glyph {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-size: 1.05rem;
  background: var(--ben-tint-other);
  color: var(--ben-ink-other);
}

.ben-glyph-insurance { background: var(--ben-tint-insurance); color: var(--ben-ink-insurance); }
.ben-glyph-software { background: var(--ben-tint-software); color: var(--ben-ink-software); }
.ben-glyph-equipment { background: var(--ben-tint-equipment); color: var(--ben-ink-equipment); }
.ben-glyph-fuel { background: var(--ben-tint-fuel); color: var(--ben-ink-fuel); }
.ben-glyph-hotels { background: var(--ben-tint-hotels); color: var(--ben-ink-hotels); }
.ben-glyph-compliance { background: var(--ben-tint-compliance); color: var(--ben-ink-compliance); }
.ben-glyph-training { background: var(--ben-tint-training); color: var(--ben-ink-training); }

.ben-names {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ben-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.ben-partner {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.ben-sub {
  font-size: .78rem;
  color: var(--muted);
}

.ben-new,
.ben-used-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.ben-new { background: var(--primary); color: var(--primary-ink); }

.ben-used-pill {
  background: var(--blue-soft);
  color: var(--ben-ink-insurance);
}

.ben-headline {
  font-size: .95rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.ben-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-top: auto;
  padding-top: var(--s-1);
}

.ben-expiry {
  font-size: .76rem;
  color: var(--muted);
  white-space: nowrap;
}

.ben-expiry.soon {
  color: var(--warn);
  font-weight: 600;
}

.ben-go {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* the star */

.ben-save {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.ben-save:hover { background: var(--surface-3); }
.ben-save.on { color: var(--orange); }

.ben-save:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ben-past-head {
  margin: var(--s-6) 0 var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  color: var(--muted);
}

.ben-foot-note,
.ben-foot { min-width: 0; }

.ben-foot p { margin: 0; }

footer.ben-foot { margin-top: var(--s-6); }

/* ---------------------------------------------------------------- sheet */

.ben-sheet { display: flex; flex-direction: column; gap: var(--s-3); }

.ben-sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.ben-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .75rem;
  font-weight: 600;
  background: var(--ben-tint-other);
  color: var(--ben-ink-other);
}

.ben-cat-insurance { background: var(--ben-tint-insurance); color: var(--ben-ink-insurance); }
.ben-cat-software { background: var(--ben-tint-software); color: var(--ben-ink-software); }
.ben-cat-equipment { background: var(--ben-tint-equipment); color: var(--ben-ink-equipment); }
.ben-cat-fuel { background: var(--ben-tint-fuel); color: var(--ben-ink-fuel); }
.ben-cat-hotels { background: var(--ben-tint-hotels); color: var(--ben-ink-hotels); }
.ben-cat-compliance { background: var(--ben-tint-compliance); color: var(--ben-ink-compliance); }
.ben-cat-training { background: var(--ben-tint-training); color: var(--ben-ink-training); }

.ben-cat-glyph { font-size: .9rem; }

.ben-sheet-head .ben-expiry { margin-left: auto; }

.ben-sheet-headline {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.ben-sheet-body {
  margin: 0;
  color: var(--ink-2);
}

.ben-sheet-h3 {
  margin: var(--s-2) 0 0;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

.ben-howto {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: var(--s-2);
  color: var(--ink-2);
}

.ben-terms {
  margin: 0;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--muted);
}

.ben-sheet-note {
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
}

.ben-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.ben-contact-name { font-weight: 600; color: var(--ink); }

.ben-contact-link {
  font-size: .88rem;
  word-break: break-word;
}

.ben-sheet-actions {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

/* ------------------------------------------------------------ code block */

.ben-code {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
}

.ben-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2) var(--s-3);
}

.ben-code-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

.ben-code-value {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  word-break: break-all;
}

.ben-code-value.shown {
  color: var(--ink);
  -webkit-user-select: all;
  user-select: all;
}

.ben-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.ben-code-note,
.ben-code-none {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
}

/* ------------------------------------------------------- home highlight */

.ben-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}

.ben-mini-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ben-mini-btn:hover { background: var(--surface-3); }

.ben-mini-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ben-mini-glyph { font-size: 1.1rem; }

.ben-mini-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ben-mini-partner { font-weight: 600; color: var(--ink); }

.ben-mini-headline {
  font-size: .82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ben-mini-btn .ben-expiry { margin-left: auto; }

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  .ben-card,
  .ben-stat,
  .ben-mini-btn { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
}
