/* Good River app kit: the shared look of the Good River apps.
   Generated copy in each app; the master is GoodRiverWellness.com/ui-kit/public/grw-ui.css.

   Taken from the public site: river navy, sun orange, plum, cream, Inter + Kanit, pill buttons,
   soft rounded cards and the rainbow. <body data-app="..."> picks the app's "hat" (app bar color,
   accent, portal label) so people always know which app they're in. Load after Bootstrap 5.3. */

:root {
  --river: #0a3d67;
  --river-deep: #072a48;
  --river-mid: #145b80;
  --sun: #f7941d;
  --sun-light: #ffb347;
  --sun-dark: #e07d06;
  --plum: #584a64;
  --cream: #fffaf1;
  --sand: #f6efe3;
  --ink: #1f2a37;
  --muted: #5b6573;
  --line: #e8dfcf;
  --field-line: #d9cdb8;
  --rainbow: linear-gradient(90deg, #e5242b, #f15a29, #f7941d, #e0b100, #8dc63f, #2fa84f, #0072bc);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 10px rgba(10, 61, 103, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 61, 103, 0.1);

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--cream);
  --bs-heading-color: var(--river);
  --bs-link-color: var(--river);
  --bs-link-color-rgb: 10, 61, 103;
  --bs-link-hover-color: var(--river-deep);
  --bs-link-hover-color-rgb: 7, 42, 72;
  --bs-border-color: var(--line);
  --bs-border-radius: var(--radius-sm);
}

/* ---- Hats ------------------------------------------------------------------------ */
/* Members wear the river, like the public site. Keep bar colors in step with index.js. */

body,
[data-app="members"] {
  --app-bar: #0a3d67;
  --app-bar-rgb: 10, 61, 103;
  --app-accent: #f7941d;
  --app-accent-hover: #ffb347;
  --app-accent-active: #e07d06;
  --app-tint: #fff1de;
  --app-eyebrow: #584a64;
}

[data-app="partners"] {
  --app-bar: #17452f;
  --app-bar-rgb: 23, 69, 47;
  --app-accent: #8dc63f;
  --app-accent-hover: #a5d75f;
  --app-accent-active: #74ad27;
  --app-tint: #eef7e3;
  --app-eyebrow: #2b7a43;
}

[data-app="employers"] {
  --app-bar: #4a3d57;
  --app-bar-rgb: 74, 61, 87;
  --app-accent: #e0b100;
  --app-accent-hover: #f0c629;
  --app-accent-active: #c29900;
  --app-tint: #f4eff8;
  --app-eyebrow: #584a64;
}

[data-app="admin"] {
  --app-bar: #1f2a37;
  --app-bar-rgb: 31, 42, 55;
  --app-accent: #7cc4ff;
  --app-accent-hover: #9dd3ff;
  --app-accent-active: #56afff;
  --app-tint: #e8f3fd;
  --app-eyebrow: #0072bc;
}

/* Bootstrap pieces that use "primary" follow the hat. */
body {
  --bs-primary: var(--app-bar);
  --bs-primary-rgb: var(--app-bar-rgb);
}

/* ---- Base ------------------------------------------------------------------------ */

body { line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1 0 auto; padding-bottom: 2.5rem; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: "Kanit", "Inter", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.2;
}
a { text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid rgba(var(--app-bar-rgb), 0.45); outline-offset: 2px; }

.skip-link:focus {
  position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2000;
  background: #fff; padding: 0.5rem 1rem; border-radius: 8px; box-shadow: var(--shadow-md);
}

.eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--app-eyebrow); margin-bottom: 0.35rem;
}
.text-muted-grw { color: var(--muted); }
.fine-print { font-size: 0.875rem; color: var(--muted); }

/* ---- App bar --------------------------------------------------------------------- */

.app-bar { background: var(--app-bar); color: #fff; position: sticky; top: 0; z-index: 1030; }
.app-bar::after { content: ""; display: block; height: 4px; background: var(--rainbow); }
.app-bar .navbar { padding: 0.5rem 0; }
.app-bar .container-xl { flex-wrap: wrap; }

.app-brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; margin-right: 1.25rem; padding: 0.2rem 0; }
.app-brand:hover, .app-brand:focus-visible { color: #fff; }
.app-brand img { width: 44px; height: auto; }
.app-brand-word { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 1.2rem; line-height: 1; white-space: nowrap; }
.app-brand-word small {
  display: block; font-family: "Inter", sans-serif; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--app-accent); margin-top: 0.3rem;
}

.app-bar .navbar-nav { gap: 0.15rem; }
.app-bar .nav-link { color: rgba(255, 255, 255, 0.85); font-weight: 500; border-radius: 999px; padding: 0.4rem 0.85rem; }
.app-bar .nav-link:hover, .app-bar .nav-link:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.1); }
.app-bar .nav-link.active { color: var(--ink); background: var(--app-accent); font-weight: 600; }
.app-bar .navbar-toggler { border: 0; color: #fff; font-size: 1.75rem; padding: 0.15rem 0.4rem; }
.app-bar .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }

.app-tools { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.app-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 600; font-size: 0.875rem; text-decoration: none; white-space: nowrap;
}
a.app-chip:hover, a.app-chip:focus-visible { background: rgba(255, 255, 255, 0.2); color: #fff; }
.app-user { display: inline-flex; align-items: center; gap: 0.4rem; color: #fff; background: none; border: 0; padding: 0.2rem 0.35rem; border-radius: 999px; }
.app-user:hover, .app-user:focus-visible { background: rgba(255, 255, 255, 0.12); }
.app-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--app-accent); color: var(--ink); font-weight: 700; font-size: 0.85rem;
}

.app-bar .dropdown-menu { border-radius: var(--radius-sm); border-color: var(--line); box-shadow: var(--shadow-md); min-width: 15rem; }
.app-bar .dropdown-item { padding: 0.45rem 1rem; }
.app-bar .dropdown-item i { color: var(--muted); margin-right: 0.35rem; }
.dropdown-header-user { padding: 0.5rem 1rem 0.35rem; }
.dropdown-header-user strong { display: block; color: var(--ink); }
.dropdown-header-user span { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 991.98px) {
  .app-brand-word { font-size: 1.05rem; }
  .app-bar .navbar-collapse { order: 10; flex-basis: 100%; padding: 0.5rem 0 0.75rem; }
  .app-bar .nav-link { padding: 0.55rem 0.85rem; }
}
@media (max-width: 420px) {
  .app-brand img { width: 36px; }
  .app-chip { display: none; }
}

/* ---- Page head ------------------------------------------------------------------- */

.app-page-head { padding: 2rem 0 1.5rem; }
.app-page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; }
.app-page-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 0; }
.app-page-head .lede { color: var(--muted); margin: 0.4rem 0 0; max-width: 46rem; }
.app-page-head .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- Buttons --------------------------------------------------------------------- */

.btn { --bs-btn-border-radius: 999px; --bs-btn-font-weight: 600; --bs-btn-padding-x: 1.25rem; }
.btn-sm { --bs-btn-padding-x: 0.9rem; }
.btn-lg { --bs-btn-padding-x: 1.6rem; }
.btn-primary, .btn-accent {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--app-accent); --bs-btn-border-color: var(--app-accent);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--app-accent-hover); --bs-btn-hover-border-color: var(--app-accent-hover);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--app-accent-active); --bs-btn-active-border-color: var(--app-accent-active);
  --bs-btn-disabled-color: var(--ink); --bs-btn-disabled-bg: var(--app-accent); --bs-btn-disabled-border-color: var(--app-accent);
  --bs-btn-focus-shadow-rgb: 31, 42, 55;
}
.btn-river {
  --bs-btn-color: #fff; --bs-btn-bg: var(--river); --bs-btn-border-color: var(--river);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--river-mid); --bs-btn-hover-border-color: var(--river-mid);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--river-deep); --bs-btn-active-border-color: var(--river-deep);
}
.btn-outline-river, .btn-outline-primary {
  --bs-btn-color: var(--river); --bs-btn-border-color: var(--river);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--river); --bs-btn-hover-border-color: var(--river);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--river-deep); --bs-btn-active-border-color: var(--river-deep);
  --bs-btn-focus-shadow-rgb: 10, 61, 103;
}

/* ---- Cards, tiles, stats --------------------------------------------------------- */

.app-card, .card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.app-card { padding: 1.4rem 1.5rem; }
.app-card + .app-card { margin-top: 1.25rem; }
.card { --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px); --bs-card-border-color: var(--line); --bs-card-cap-bg: var(--sand); }
.app-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 1rem; }
.app-card-head h2 { font-size: 1.2rem; margin: 0; }

.action-tile {
  display: flex; gap: 1rem; align-items: flex-start; height: 100%; padding: 1.25rem 1.35rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--ink); text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.action-tile:hover, .action-tile:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--ink); }
.action-tile .tile-icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--app-tint); color: var(--app-bar); font-size: 1.35rem;
}
.action-tile h2, .action-tile h3 { font-size: 1.1rem; margin: 0 0 0.2rem; }
.action-tile p { margin: 0; color: var(--muted); font-size: 0.925rem; }

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); height: 100%; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--petal, var(--app-accent)); }
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-family: "Kanit", sans-serif; font-size: 2rem; font-weight: 600; color: var(--river); line-height: 1.15; }
.stat-note { font-size: 0.85rem; color: var(--muted); }

/* ---- Tables, lists, badges ------------------------------------------------------- */

.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--app-tint); --bs-table-striped-bg: rgba(246, 239, 227, 0.6); margin: 0; }
.table > thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.table > :not(caption) > * > * { padding: 0.75rem; border-color: var(--line); }

.detail-list { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: 0.65rem 1.5rem; margin: 0; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .detail-list { grid-template-columns: 1fr; gap: 0.15rem; } .detail-list dd { margin-bottom: 0.6rem; } }

.badge-soft { display: inline-block; padding: 0.25em 0.7em; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-soft.ok { background: #e3f4e8; color: #1e6e36; }
.badge-soft.wait { background: #fff1de; color: #8a4b00; }
.badge-soft.off { background: #eef0f3; color: var(--muted); }
.badge-soft.bad { background: #fde8e8; color: #a3191f; }

.alert { --bs-alert-border-radius: var(--radius-sm); }

.empty-state { text-align: center; padding: 2.5rem 1rem; max-width: 34rem; margin: 0 auto; }
.empty-state .empty-icon {
  width: 64px; height: 64px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--app-tint); color: var(--app-bar); font-size: 1.75rem; margin-bottom: 1rem;
}
.empty-state h2 { font-size: 1.3rem; }
.empty-state p { color: var(--muted); }

/* ---- Forms ----------------------------------------------------------------------- */

.form-label { font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
.form-label small, .form-text { color: var(--muted); font-weight: 400; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--field-line); background-color: #fff; padding: 0.6rem 0.85rem; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--river-mid); box-shadow: 0 0 0 0.2rem rgba(20, 91, 128, 0.18); }
.form-check-input:checked { background-color: var(--app-bar); border-color: var(--app-bar); }
.form-check-input:focus { border-color: var(--river-mid); box-shadow: 0 0 0 0.2rem rgba(20, 91, 128, 0.18); }
.form-section + .form-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.form-section-title { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--app-eyebrow); margin-bottom: 1rem; }

/* ---- Sign-in style pages (top with bare: true) ------------------------------------ */

.auth-wrap { padding: 3rem 0 1rem; }
.auth-card { max-width: 30rem; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 2rem; }
.auth-card.wide { max-width: 48rem; }
.auth-card h1 { font-size: 1.65rem; margin-bottom: 0.35rem; }
.auth-card .lede { color: var(--muted); margin-bottom: 1.5rem; }
.auth-mark {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 1rem;
  background: var(--app-bar); color: var(--app-accent); font-size: 1.5rem;
}
.auth-alt { text-align: center; margin: 1.25rem 0 0; color: var(--muted); }

.portal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.25rem; margin: 1.5rem auto 0; font-size: 0.9rem; color: var(--muted); }
.portal-links a { color: var(--muted); font-weight: 500; text-decoration: none; }
.portal-links a:hover, .portal-links a:focus-visible { color: var(--river); text-decoration: underline; }

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

.app-footer { padding: 1.5rem 0 1.25rem; border-top: 1px solid var(--line); background: var(--sand); color: var(--muted); font-size: 0.875rem; }
.app-footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover, .app-footer a:focus-visible { color: var(--river); text-decoration: underline; }
.app-footer .footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--river); font-weight: 600; }
.app-footer .footer-brand img { width: 30px; height: auto; }
.app-footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.app-footer .footer-fine { margin: 0.75rem 0 0; font-size: 0.8rem; }

/* ---- Facet colors ------------------------------------------------------------------ */

.petal-body { --petal: #e5242b; }
.petal-mind { --petal: #f15a29; }
.petal-spirit { --petal: #f7941d; }
.petal-diet { --petal: #e0b100; }
.petal-exercise { --petal: #8dc63f; }
.petal-nature { --petal: #2fa84f; }
.petal-community { --petal: #0072bc; }

@media (prefers-reduced-motion: reduce) {
  .action-tile { transition: none; }
  .action-tile:hover { transform: none; }
}
