/* =====================================================================
   New look (2026 refresh) — stage 1: public site and sign-in screens
   =====================================================================
   Loaded only while Admin -> Settings -> Look -> "New look on the public
   site" is on, and every rule sits under `body.ui2`. Off, this file is not
   even requested and the pages are drawn by app.css exactly as before.

   It changes how things look, never what they do: no element is removed
   from the page, and nothing here hides a control. Brand colours still
   come from Organisation settings (--brand, --brand-2, --accent), and the
   per-section type and alignment choices made on the Content screen keep
   working, because those are set by more specific classes than these.
   ===================================================================== */

body.ui2 {
  --ink:        #10201a;
  --ink-soft:   #46564e;
  --ink-faint:  #52635b;
  --line:       #dfe6e2;
  --line-soft:  #ebf0ed;
  --bg-soft:    #f3f6f4;
  --bg-sunken:  #e8edea;

  --ok:         #075338;  --ok-bg:   #ddf3e8;
  --warn:       #6b4700;  --warn-bg: #fcebc5;
  --bad:        #8c1d12;  --bad-bg:  #fbe0dc;

  --radius:     16px;
  --radius-sm:  12px;
  --shadow-sm:  none;
  --shadow:     0 6px 20px rgba(16, 32, 26, .08);

  --field-line: #c5d0ca;
  --brand-tint: color-mix(in srgb, var(--brand) 11%, #fff);

  background: var(--bg-soft);
  color: var(--ink);
}

/* ---- header --------------------------------------------------------- */
body.ui2 .site-header {
  background: #fff; backdrop-filter: none;
  border-bottom: 1px solid var(--line); box-shadow: none;
}
body.ui2 .brand .logo, body.ui2 .brand .logo-fallback { border-radius: 12px; }
body.ui2 .nav a:not(.btn) { font-weight: 600; border-radius: 10px; color: var(--ink-soft); }
body.ui2 .nav a:not(.btn).active { color: var(--brand); background: var(--brand-tint); }

/* ---- buttons -------------------------------------------------------- */
body.ui2 .btn {
  /* No `display` here: app.css already makes .btn an inline-flex box, and
     setting it again would un-hide buttons other rules hide on purpose. */
  min-height: 46px; border-radius: 12px; font-weight: 600;
  box-shadow: none; border-width: 1.5px;
}
body.ui2 .btn-lg { min-height: 52px; border-radius: 14px; }
body.ui2 .btn-sm { min-height: 38px; }
body.ui2 .btn-outline { border-color: var(--brand); color: var(--brand); background: #fff; }
body.ui2 .btn-outline:hover { background: var(--brand-tint); }
body.ui2 .btn-light { background: #fff; color: var(--brand); border-color: #fff; }
body.ui2 .btn-light:hover { background: rgba(255,255,255,.88); color: var(--brand); }
body.ui2 span.btn-light[aria-disabled] { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
body.ui2 .btn:focus-visible, body.ui2 a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, #fff); outline-offset: 2px;
}

/* ---- surfaces ------------------------------------------------------- */
body.ui2 .card { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: none; }
body.ui2 .card.hoverable:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
body.ui2 .card-icon { border-radius: 14px; background: var(--brand-tint); color: var(--brand); }
body.ui2 section.tint { background: transparent; }
body.ui2 .alert { border-radius: 14px; }

/* ---- form fields ---------------------------------------------------- */
body.ui2 .input, body.ui2 .select, body.ui2 .textarea {
  min-height: 48px; border: 1.5px solid var(--field-line); border-radius: 12px; background: #fff;
}
body.ui2 .textarea { min-height: 96px; }
body.ui2 .input:focus, body.ui2 .select:focus, body.ui2 .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
body.ui2 .input.is-invalid, body.ui2 .select.is-invalid { border-color: var(--bad); }
body.ui2 .field label { font-weight: 600; }
body.ui2 .field .error { font-weight: 600; }
body.ui2 .hint { color: var(--ink-faint); }
body.ui2 input[type=checkbox], body.ui2 input[type=radio] { accent-color: var(--brand); }

/* ---- status pills --------------------------------------------------- */
body.ui2 .badge { border-radius: 999px; font-weight: 600; }

/* ---- section headings ----------------------------------------------- */
body.ui2 .kicker { color: var(--brand); font-weight: 700; letter-spacing: .08em; }

/* ---- home page banner ----------------------------------------------- */
body.ui2 .hero {
  background: var(--brand);
  max-width: calc(var(--wrap) - 2.5rem); margin: 1.5rem auto 0; border-radius: 24px;
}
body.ui2 .hero::after { display: none; }
body.ui2 .hero .wrap { padding-block: clamp(2.25rem, 5vw, 3.5rem); padding-inline: clamp(1.25rem, 4vw, 3rem); }
body.ui2 .hero .eyebrow { background: var(--accent); color: #1f1600; border: 0; font-weight: 700; }
body.ui2 .hero .eyebrow .dot { background: #1f1600; }
body.ui2 .hero .eyebrow.is-closed { background: rgba(255,255,255,.18); color: #fff; }
body.ui2 .hero .eyebrow.is-closed .dot { background: #fff; }
body.ui2 .hero .lede { color: rgba(255,255,255,.92); }
body.ui2 .hero .cta .btn { min-width: 11rem; }

/* ---- application form ----------------------------------------------- */
body.ui2 .apply-head { padding-bottom: 1rem; }
body.ui2 .stepbar { gap: .4rem; flex-wrap: nowrap; }
body.ui2 .stepbar li {
  flex: 1; min-width: 0; padding: .7rem 0 0; border: 0; border-radius: 0; background: transparent;
  border-top: 6px solid var(--bg-sunken); font-size: .78rem; font-weight: 600; color: var(--ink-faint);
  box-shadow: none; gap: .35rem;
}
body.ui2 .stepbar li .n { display: none; }
body.ui2 .stepbar li .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ui2 .stepbar li.done { border-top-color: var(--brand); color: var(--ink-soft); }
body.ui2 .stepbar li.current { border-top-color: var(--brand); color: var(--brand); box-shadow: none; }
body.ui2 .applyform .step { border-radius: 18px; box-shadow: none; border: 1px solid var(--line); }
body.ui2 .step-legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
body.ui2 .step-legend > h2, body.ui2 .step-legend > p { flex-basis: 100%; }
body.ui2 .step-count { font-weight: 700; letter-spacing: .06em; color: var(--brand); }
body.ui2 .step-next { font-size: .84rem; color: var(--ink-faint); margin-left: auto; }

/* ---- status result -------------------------------------------------- */
body.ui2 .statusresult { overflow: hidden; }
body.ui2 .statusband {
  display: flex; align-items: center; gap: .9rem;
  margin: -1.5rem -1.5rem 1.25rem; padding: 1.1rem 1.5rem; color: #fff;
}
body.ui2 .statusband-ok   { background: var(--brand); }
body.ui2 .statusband-warn { background: #7a5200; }
body.ui2 .statusband-bad  { background: #8c1d12; }
body.ui2 .statusband-ic {
  width: 44px; height: 44px; flex: none; border-radius: 50%; background: #fff;
  display: grid; place-items: center;
}
body.ui2 .statusband-ok .statusband-ic   { color: var(--brand); }
body.ui2 .statusband-warn .statusband-ic { color: #7a5200; }
body.ui2 .statusband-bad .statusband-ic  { color: #8c1d12; }
body.ui2 .statusband strong { display: block; font-size: 1.2rem; line-height: 1.25; }
body.ui2 .statusband strong + span { font-size: .9rem; opacity: .92; }
body.ui2 .statusresult .statusbadge { display: none; }   /* the band above says it */
body.ui2 .statusresult .kv { grid-template-columns: minmax(8rem, auto) minmax(0, 1fr); gap: 0; }
body.ui2 .statusresult .kv dt, body.ui2 .statusresult .kv dd { padding: .6rem 0; border-top: 1px solid var(--line-soft); }
body.ui2 .statusresult .kv dd { text-align: right; }
body.ui2 .coverhistory li { border-radius: 12px; }

/* ---- "Ready to join?" band ------------------------------------------ */
body.ui2 .cta-band { background: var(--brand-2); border-radius: 24px; box-shadow: none; }

/* ---- sign-in screens ------------------------------------------------ */
body.ui2 .auth-wrap { background: var(--bg-soft); }
body.ui2 .auth-card { border-radius: 20px; border: 1px solid var(--line); box-shadow: none; }

/* ---- footer --------------------------------------------------------- */
body.ui2 .site-footer { background: #10201a; margin-top: 2rem; }

/* =====================================================================
   Member portal (stage 2)
   ===================================================================== */
body.ui2.portal .portalwrap { max-width: 860px; padding-top: 1.5rem; padding-bottom: 2rem; }
body.ui2.portal .site-footer { background: transparent; color: var(--ink-faint); margin-top: 0; padding-block: 1rem 2rem; }
body.ui2.portal .site-footer .muted { color: var(--ink-faint); }
body.ui2.portal .site-footer strong { color: var(--ink); }

/* The digital membership card. */
body.ui2 .mcard {
  background: var(--brand-2); color: #fff; border-radius: 22px;
  padding: 1.4rem 1.5rem; margin-bottom: 1rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
body.ui2 .mcard-top, body.ui2 .mcard-bottom { display: flex; justify-content: space-between; gap: 1rem; }
body.ui2 .mcard-top { align-items: flex-start; }
body.ui2 .mcard-bottom { align-items: flex-end; }
body.ui2 .mcard-label {
  display: block; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.78);
}
body.ui2 .mcard-name { display: block; font-size: 1.35rem; line-height: 1.25; margin-top: .35rem; overflow-wrap: anywhere; }
body.ui2 .mcard-no { display: block; font-size: .88rem; color: rgba(255,255,255,.82); margin-top: .15rem; }
body.ui2 .mcard-headline { font-size: 1rem; font-weight: 600; margin: 0 0 .7rem; color: #fff; }
body.ui2 .mcard-date { display: block; font-size: 1.3rem; margin-top: .2rem; }
body.ui2 .mcard-state {
  flex: none; padding: .3rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap;
  background: var(--ok-bg); color: var(--ok);
}
body.ui2 .mcard-warn .mcard-state { background: var(--warn-bg); color: var(--warn); }
body.ui2 .mcard-bad .mcard-state  { background: var(--bad-bg);  color: var(--bad); }
body.ui2 .mcard-qr { width: 104px; height: 104px; flex: none; border-radius: 10px; background: #fff; }

/* What the member can do, as a row of buttons under the card. */
body.ui2 .mactions { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.2rem, 1fr)); gap: .6rem; margin-bottom: 1.25rem; }
body.ui2 .mactions a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  min-height: 88px; padding: .75rem .4rem; border-radius: 16px; text-align: center;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  font-size: .82rem; font-weight: 600; line-height: 1.25; text-decoration: none;
}
body.ui2 .mactions a:hover { border-color: var(--brand); text-decoration: none; }
body.ui2 .mactions a span {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand);
}

body.ui2.portal .portalgrid { gap: 1rem; }
body.ui2.portal .portalgrid h2, body.ui2.portal .historyhead { font-size: 1.02rem; }
body.ui2.portal .kv { grid-template-columns: minmax(7.5rem, auto) minmax(0, 1fr); gap: 0; }
body.ui2.portal .kv dt, body.ui2.portal .kv dd { padding: .55rem 0; border-top: 1px solid var(--line-soft); }
body.ui2.portal .kv dt:first-of-type, body.ui2.portal .kv dt:first-of-type + dd { border-top: 0; }
body.ui2.portal .kv dd { text-align: right; overflow-wrap: break-word; }
body.ui2.portal .renewcall { border-radius: 16px; }

/* =====================================================================
   Phones
   ===================================================================== */
@media (max-width: 760px) {
  body.ui2 .hero { margin: .9rem .9rem 0; border-radius: 20px; max-width: none; }
  body.ui2 .hero .wrap { padding: 1.4rem 1.15rem 1.25rem; }
  body.ui2 .hero h1 { font-size: 1.7rem; }

  /* Apply is the wide main button; Renew and Check status sit side by side
     under it as two tiles. Same three links, in the same order. */
  body.ui2 .hero .cta { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.1rem; }
  body.ui2 .hero .cta .btn { min-width: 0; width: 100%; padding-inline: .6rem; text-align: center; white-space: normal; line-height: 1.2; }
  body.ui2 .hero .cta .btn:first-child { grid-column: 1 / -1; }
  body.ui2 .hero .cta .btn:last-child:nth-child(2) { grid-column: 1 / -1; }

  body.ui2 section { padding-block: 2rem; }
  body.ui2 .section-head h1 { font-size: 1.6rem; }

  /* Only the bars on a phone; the step's own heading names it. */
  body.ui2 .stepbar li { padding-top: 0; }
  body.ui2 .stepbar li .t { display: none; }
  body.ui2 .applyform .step { padding: 1.15rem; }

  body.ui2 .statusband { margin: -1.5rem -1.5rem 1rem; padding: 1rem 1.15rem; }

  body.ui2 .mcard { padding: 1.2rem 1.15rem; border-radius: 20px; }
  body.ui2 .mcard-qr { width: 92px; height: 92px; }
  body.ui2 .mactions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
  body.ui2 .mactions a { min-height: 84px; font-size: .74rem; padding-inline: .2rem; }
  body.ui2.portal .portalwrap { padding-top: 1rem; }

  /* The tab bar: a pill behind the current tab. */
  body.ui2.mapp .mtabs { box-shadow: none; border-top: 1px solid var(--line); }
  body.ui2.mapp .mtab { color: var(--ink-faint); }
  body.ui2.mapp .mtab.on { background: var(--brand-tint); color: var(--brand); }
  body.ui2.mapp { background: var(--bg-soft); }
}

@media print { body.ui2 { background: #fff; } }

/* =====================================================================
   Staff area (stage 3)
   =====================================================================
   Every rule is under `body.ui2.staff`. The layout is the same grid, the
   same sidebar (wide or rail), the same drawer on a phone; this changes the
   surfaces, not the structure, so every menu item, column, filter and
   button is where it was.
   ===================================================================== */

/* ---- the side menu, light ------------------------------------------- */
body.ui2.staff .sidebar {
  background: #fff; color: var(--ink-soft); border-right: 1px solid var(--line);
  scrollbar-color: #c9d3ce transparent;
}
body.ui2.staff .sidebar::-webkit-scrollbar-thumb { background: #c9d3ce; }
body.ui2.staff .sidebar::-webkit-scrollbar-thumb:hover { background: #aab7b0; }
body.ui2.staff .sidebar .brand { color: var(--ink); }
body.ui2.staff .sidebar .brand .tag { color: var(--ink-faint); }
body.ui2.staff .sidebar .navlabel { color: var(--ink-faint); }
body.ui2.staff .navgroup > summary:hover { background: var(--bg-soft); }
body.ui2.staff .sidebar a { color: #26352e; border-radius: 10px; font-weight: 500; }
body.ui2.staff .sidebar a:hover { background: var(--bg-soft); color: var(--ink); }
body.ui2.staff .sidebar a.active { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
body.ui2.staff .sidebar .navicon { opacity: .9; }
body.ui2.staff .sidebar .soon { background: var(--bg-sunken); color: var(--ink-soft); }
body.ui2.staff .drawer-foot a { color: var(--brand); }
body.ui2.staff .drawer-account { border-top-color: var(--line); color: var(--ink); }
html[data-nav="rail"] body.ui2.staff .navgroup > summary::after { background: var(--line); }

/* ---- top bar and page ----------------------------------------------- */
body.ui2.staff .admin-main { background: var(--bg-soft); }
body.ui2.staff .admin-top { background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; }
body.ui2.staff .admin-top h1 { font-size: 1.2rem; }
body.ui2.staff .admin-foot { border-top-color: var(--line); }

/* ---- panels, tiles --------------------------------------------------- */
body.ui2.staff .panel { border-radius: 16px; border: 1px solid var(--line); box-shadow: none; overflow: hidden; }
body.ui2.staff .panel > header { background: #fff; border-bottom: 1px solid var(--line-soft); }
body.ui2.staff .stat-card, body.ui2.staff .kpi { border-radius: 16px; box-shadow: none; }
body.ui2.staff .stat-card .lbl, body.ui2.staff .kpi .kpi-lbl { color: var(--ink-faint); letter-spacing: .06em; }
body.ui2.staff .dash-hero { background: var(--brand-2); border-radius: 20px; box-shadow: none; padding: 1.4rem 1.6rem; }
body.ui2.staff .dash-actions .btn-primary { background: #fff; color: var(--brand-2); border-color: #fff; }
body.ui2.staff .dash-actions .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
body.ui2.staff .dash-actions .btn-outline:hover { background: rgba(255,255,255,.14); }

/* ---- tables ---------------------------------------------------------- */
body.ui2.staff .table th {
  background: #f8faf9; color: var(--ink-faint); font-weight: 600; letter-spacing: .05em;
  border-bottom: 1px solid var(--line);
}
body.ui2.staff .table td { border-bottom-color: var(--line-soft); }
body.ui2.staff .table tbody tr:hover { background: #f6f9f7; }
body.ui2.staff .table tbody tr.is-selected { background: var(--brand-tint); }

/* ---- tabs as a segmented control ------------------------------------- */
body.ui2.staff .tabs {
  border-bottom: 0; background: var(--bg-sunken); border-radius: 12px; padding: 4px; gap: 4px;
  display: inline-flex; max-width: 100%;
}
body.ui2.staff .tabs a { border: 0; border-radius: 9px; color: var(--ink-soft); font-weight: 600; }
body.ui2.staff .tabs a:hover { background: rgba(255,255,255,.6); }
body.ui2.staff .tabs a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,32,26,.08); }

/* ---- controls sized for a desk (a phone gets the thumb size below) ---- */
body.ui2.staff .btn { min-height: 40px; }
body.ui2.staff .btn-lg { min-height: 46px; }
body.ui2.staff .btn-sm { min-height: 32px; border-radius: 9px; }
body.ui2.staff .input, body.ui2.staff .select { min-height: 40px; border-radius: 10px; }
body.ui2.staff .table .input, body.ui2.staff .table .select { min-height: 34px; border-radius: 8px; }
body.ui2.staff .btn-outline { border-color: var(--field-line); color: var(--ink); }
body.ui2.staff .btn-outline:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
body.ui2.staff .dash-actions .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }

@media (max-width: 760px) {
  body.ui2.staff .btn { min-height: 46px; }
  body.ui2.staff .btn-sm { min-height: 40px; }
  body.ui2.staff .input, body.ui2.staff .select { min-height: 46px; border-radius: 12px; }
  body.ui2.staff .admin-body { padding: 1rem .9rem; }
  body.ui2.staff .dash-hero { border-radius: 18px; padding: 1.1rem 1.1rem; }
  body.ui2.staff .tabs { display: flex; overflow-x: auto; flex-wrap: nowrap; }
  body.ui2.staff .tabs a { white-space: nowrap; }
  /* A table drawn as cards on a phone (responsive-tables.js): one member,
     one card, with the first value as its title. */
  body.ui2.staff .rt tbody tr { border-radius: 14px; border: 1px solid var(--line); box-shadow: none; }
}
