/* ============================================================
   School Communicator · Parent PWA
   Dark-professional "liquid glass" design system
   Materio-inspired · neutral dark surfaces · school color = accent
   Default = dark.  [data-theme="light"] on <html> = light variant.
   --primary / --primary-2 are injected per-school by _Layout.cshtml
   ============================================================ */

:root {
  /* ── School accent (overridden per-school in _Layout inline <style>) ── */
  --primary:        #7367f0;
  --primary-rgb:    115,103,240;
  --primary-2:      #9d7bff;
  --primary-2-rgb:  157,123,255;
  --primary-light:  rgba(var(--primary-rgb), .16);
  --primary-dark:   #5e50ee;

  /* ── Dark surfaces (default) ── */
  --bg-0:   #0a0b10;
  --bg:     #0e1017;
  --grad-a: rgba(var(--primary-rgb),   .22);
  --grad-b: rgba(var(--primary-2-rgb), .12);

  --glass:        rgba(255,255,255,.045);
  --glass-strong: rgba(255,255,255,.07);
  --glass-hi:     rgba(255,255,255,.10);
  --card-bg:      rgba(255,255,255,.045);
  --border:       rgba(255,255,255,.09);
  --border-soft:  rgba(255,255,255,.055);

  --text:           #eceef5;
  --text-secondary: #a4a8ba;
  --text-muted:     #6c7186;

  /* ── Semantic palette ── */
  --color-orange: #ff9f43;
  --color-green:  #28c76f;
  --color-teal:   #00cfe8;
  --color-blue:   #4a9eff;
  --color-red:    #ea5455;
  --color-pink:   #f75c9e;
  --color-purple: #7367f0;

  /* ── Layout ── */
  --header-h:     70px;
  --bottom-nav-h: 74px;
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
  --safe-top:     env(safe-area-inset-top, 0px);

  /* ── Shape ── */
  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 24px;
  --radius-xl: 30px;

  /* ── Elevation ── */
  --shadow-xs: 0 2px 8px rgba(0,0,0,.35);
  --shadow-sm: 0 4px 18px rgba(0,0,0,.35);
  --shadow:    0 12px 40px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.6);
  --glow:      0 8px 30px rgba(var(--primary-rgb), .45);

  /* ── Motion ── */
  --ease-spring: cubic-bezier(.22,1.2,.36,1);
  --ease-soft:   cubic-bezier(.4,0,.2,1);
}

/* ── Light variant ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-0:   #eaecf4;
  --bg:     #f6f7fb;
  --grad-a: rgba(var(--primary-rgb),   .14);
  --grad-b: rgba(var(--primary-2-rgb), .12);

  --glass:        rgba(255,255,255,.66);
  --glass-strong: rgba(255,255,255,.82);
  --glass-hi:     rgba(255,255,255,.92);
  --card-bg:      rgba(255,255,255,.78);
  --border:       rgba(20,22,40,.08);
  --border-soft:  rgba(20,22,40,.05);

  --text:           #23263a;
  --text-secondary: #5b6076;
  --text-muted:     #969ab0;

  --shadow-xs: 0 2px 8px rgba(60,60,110,.08);
  --shadow-sm: 0 4px 18px rgba(60,60,110,.10);
  --shadow:    0 16px 44px rgba(60,60,110,.18);
  --shadow-lg: 0 24px 60px rgba(60,60,110,.22);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(120% 55% at 12% -6%, var(--grad-a) 0%, transparent 55%),
    radial-gradient(120% 50% at 100% 4%, var(--grad-b) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  transition: background .5s var(--ease-soft), color .35s;
}
@media (display-mode: standalone) {
  body { padding-top: var(--safe-top); }
}
a { color: inherit; }

/* Cross-document view transitions (progressive enhancement) */
@view-transition { navigation: auto; }

/* ── Top App Bar (liquid glass) ────────────────────────────── */
.pwa-header {
  position: sticky; top: 0; z-index: 100;
  margin: 10px 12px 0;
  height: 58px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.14);
}
.pwa-header-left  { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }
.pwa-header-right { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; }

.pwa-header-logo {
  width: 38px; height: 38px; border-radius: 11px;
  object-fit: cover; flex-shrink: 0;
  box-shadow: var(--glow);
}
.pwa-header-logo-placeholder {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: var(--glow);
}
.pwa-header-logo-placeholder i { color: #fff; font-size: 1.2rem; }
.pwa-header-school {
  font-weight: 800; font-size: .92rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.01em;
}
.pwa-icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass); border: 1px solid var(--border-soft); cursor: pointer;
  position: relative; text-decoration: none;
  color: var(--text-secondary);
  transition: transform .18s var(--ease-spring), background .2s, color .2s;
  flex-shrink: 0;
}
.pwa-icon-btn:hover  { background: var(--glass-hi); color: var(--text); }
.pwa-icon-btn:active { transform: scale(.9); }
.pwa-icon-btn i { font-size: 1.2rem; }
.pwa-notif-dot {
  position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff5d6c; box-shadow: 0 0 0 2px var(--bg), 0 0 8px #ff5d6c;
}
.pwa-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .74rem; flex-shrink: 0;
  overflow: hidden; border: none; cursor: pointer;
  box-shadow: var(--glow);
  transition: transform .18s var(--ease-spring);
}
.pwa-avatar:active { transform: scale(.9); }
.pwa-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Theme toggle button in header */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass); border: 1px solid var(--border-soft);
  color: var(--text-secondary); cursor: pointer; flex-shrink: 0;
  transition: transform .18s var(--ease-spring), background .2s, color .2s;
}
.theme-toggle:hover  { background: var(--glass-hi); color: var(--text); }
.theme-toggle:active { transform: scale(.9) rotate(-15deg); }
.theme-toggle i { font-size: 1.2rem; }

/* ── Bottom Navigation (liquid glass + sliding pill) ───────── */
.bottom-nav {
  position: fixed; left: 14px; right: 14px;
  bottom: calc(12px + var(--safe-bottom)); z-index: 200;
  height: var(--bottom-nav-h);
  display: flex; align-items: stretch;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 26px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.16);
  padding: 6px;
}
.nav-pill {
  position: absolute; top: 6px; bottom: 6px; width: 20%;
  border-radius: 20px; z-index: 0; pointer-events: none;
  background: linear-gradient(150deg, rgba(var(--primary-rgb),.26), rgba(var(--primary-2-rgb),.15));
  border: 1px solid rgba(var(--primary-rgb),.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  transition: transform .48s var(--ease-spring);
}
.bottom-nav-item {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: .6rem; font-weight: 700;
  gap: 4px; letter-spacing: .02em;
  transition: color .3s;
}
.bottom-nav-item i { font-size: 1.4rem; line-height: 1; transition: transform .4s var(--ease-spring); }
.pwa-cart-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-2); color: #fff;
  font-size: .62rem; font-weight: 800; line-height: 1;
  border-radius: 10px; box-shadow: 0 0 0 2px var(--glass-strong);
}
/* ── Shop / storefront ─────────────────────────────────────── */
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shop-card { background: var(--card, var(--glass)); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.shop-card-img { aspect-ratio: 1/1; background: var(--glass); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.shop-card-name { font-weight: 700; font-size: .82rem; line-height: 1.25; }
.shop-card-price { font-weight: 800; color: var(--primary-2); font-size: .9rem; }
.shop-chip { display: inline-flex; align-items: center; gap: 4px; padding: .38rem .8rem; border-radius: 50px; border: 1px solid var(--border); background: var(--glass); color: var(--text-muted); font-size: .78rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.shop-chip.active { background: linear-gradient(150deg, rgba(var(--primary-rgb),.28), rgba(var(--primary-2-rgb),.16)); border-color: rgba(var(--primary-rgb),.5); color: var(--text); }
.bottom-nav-item.active { color: var(--primary-2); }
.bottom-nav-item.active i { transform: translateY(-1px) scale(1.12); }

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  padding: 14px 16px calc(var(--bottom-nav-h) + var(--safe-bottom) + 28px);
  min-height: calc(100vh - var(--header-h));
  animation: page-in .5s var(--ease-soft) both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Staggered entrance for direct children of page-content */
.page-content > * { animation: rise .5s var(--ease-spring) both; }
.page-content > *:nth-child(1){ animation-delay: .02s }
.page-content > *:nth-child(2){ animation-delay: .06s }
.page-content > *:nth-child(3){ animation-delay: .10s }
.page-content > *:nth-child(4){ animation-delay: .14s }
.page-content > *:nth-child(5){ animation-delay: .18s }
.page-content > *:nth-child(6){ animation-delay: .22s }
.page-content > *:nth-child(7){ animation-delay: .26s }
.page-content > *:nth-child(8){ animation-delay: .30s }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .page-content, .page-content > * { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

/* ── Cards (glass) ─────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.06);
}
.card-title    { font-weight: 800; font-size: .92rem; margin-bottom: .15rem; color: var(--text); }
.card-subtitle { color: var(--text-muted); font-size: .78rem; }
.glass-card    { /* alias */
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

/* ── Hero Card ─────────────────────────────────────────────── */
.hero-card {
  position: relative; border-radius: var(--radius-lg);
  overflow: hidden; min-height: 190px;
  margin-bottom: 1rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.4rem;
  background: linear-gradient(150deg, var(--primary), color-mix(in srgb, var(--primary) 45%, #0b0c14));
  box-shadow: var(--glow);
}
.hero-card-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.05);
}
.hero-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(170deg,
    rgba(var(--primary-rgb), .30) 0%,
    rgba(8, 6, 16, .82) 100%);
}
.hero-card-content { position: relative; z-index: 1; color: #fff; }
.hero-greeting { font-size: 1.28rem; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.hero-sub      { font-size: .82rem; opacity: .9; margin-top: 3px; }

.hero-stats { display: flex; gap: .5rem; margin-top: .95rem; flex-wrap: wrap; }
.hero-stat {
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50px;
  padding: .4rem .9rem;
  display: flex; align-items: center; gap: .35rem;
  font-size: .76rem; color: #fff; font-weight: 700;
}
.hero-stat i { font-size: .95rem; opacity: .9; }
.hero-stat strong { font-size: .95rem; }

/* ── Quick Actions Grid ────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1rem; }
.qa-tile {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem .75rem .85rem;
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--text);
  backdrop-filter: blur(14px);
  transition: transform .18s var(--ease-spring), background .2s, border-color .2s;
}
.qa-tile:hover  { transform: translateY(-3px); background: var(--glass-strong); border-color: rgba(var(--primary-rgb),.4); }
.qa-tile:active { transform: scale(.94); }
.qa-icon {
  width: 50px; height: 50px; border-radius: 15px; position: relative;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qa-icon::before { content: ""; position: absolute; inset: 0; border-radius: 15px; background: currentColor; opacity: .16; }
.qa-icon i { font-size: 1.55rem; position: relative; z-index: 1; }
.qa-label { font-size: .68rem; font-weight: 700; color: var(--text-secondary); text-align: center; line-height: 1.25; }

.qa-orange { color: var(--color-orange); }
.qa-purple { color: var(--primary); }
.qa-green  { color: var(--color-green); }
.qa-teal   { color: var(--color-teal); }
.qa-blue   { color: var(--color-blue); }
.qa-red    { color: var(--color-red); }
.qa-pink   { color: var(--color-pink); }
.qa-gold   { color: var(--primary-2); }
/* keep icons colored even though parent sets color via class above */
.qa-orange i { color: var(--color-orange); } .qa-purple i { color: var(--primary); }
.qa-green i { color: var(--color-green); } .qa-teal i { color: var(--color-teal); }
.qa-blue i { color: var(--color-blue); } .qa-red i { color: var(--color-red); }
.qa-pink i { color: var(--color-pink); } .qa-gold i { color: var(--primary-2); }

/* ── Section Header ────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px; }
.section-title  { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.section-link   { font-size: .74rem; color: var(--primary-2); text-decoration: none; font-weight: 700; }

/* ── Notification / Message List Item ──────────────────────── */
.notif-item {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .85rem 0; border-bottom: 1px solid var(--border-soft);
}
.notif-item:last-child { border-bottom: none; }
.notif-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.notif-avatar img { width: 100%; height: 100%; object-fit: cover; }
.notif-avatar-orange { background: linear-gradient(135deg, #ff9f43, #ffbe80); }
.notif-avatar-purple { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.notif-avatar-green  { background: linear-gradient(135deg, #28c76f, #48da89); }
.notif-avatar-teal   { background: linear-gradient(135deg, #00cfe8, #4a9eff); }
.notif-avatar-blue   { background: linear-gradient(135deg, #4a9eff, #63b3ed); }
.notif-avatar-red    { background: linear-gradient(135deg, #ea5455, #f08182); }

.notif-icon {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary-2); font-size: 1.3rem;
}
.notif-body    { flex: 1; min-width: 0; }
.notif-row1    { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 2px; }
.notif-title   { font-weight: 700; font-size: .87rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time    { font-size: .66rem; color: var(--text-muted); flex-shrink: 0; }
.notif-preview { color: var(--text-secondary); font-size: .78rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Unread vs read distinction */
.notif-item.notif-unread { position: relative; }
.notif-item.notif-unread .notif-title { color: var(--text); font-weight: 800; }
.notif-item:not(.notif-unread) .notif-title   { color: var(--text-secondary); font-weight: 600; }
.notif-item:not(.notif-unread) .notif-preview { color: var(--text-muted); }
.notif-item:not(.notif-unread) .notif-icon,
.notif-item:not(.notif-unread) .notif-avatar  { opacity: .55; }

/* Glowing unread dot after the title (Home list) */
.notif-unread .notif-title::after {
  content: ''; display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary-2); margin-left: 6px; vertical-align: middle;
  box-shadow: 0 0 8px var(--primary-2);
}

/* Explicit unread badge (Messages list, right side) */
.unread-badge {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; align-self: center;
  background: var(--primary-2); box-shadow: 0 0 10px var(--primary-2);
}
.read-check { color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; align-self: center; }

/* ── Auth Layout (glass, dark) ─────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-0);
  position: relative; overflow: hidden;
}
.auth-page-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(1.5px) brightness(.72);
  transform: scale(1.08);
}
.auth-page-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(170deg, rgba(var(--primary-rgb), .34) 0%, rgba(6, 5, 12, .72) 100%);
}
.auth-top {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1.5rem 1.5rem; text-align: center; color: #fff;
  min-height: 45vh;
}
.auth-school-logo {
  width: 84px; height: 84px; border-radius: 22px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: .95rem; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.auth-school-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-school-name    { font-size: 1.45rem; font-weight: 800; line-height: 1.25; text-shadow: 0 2px 16px rgba(0,0,0,.4); }
.auth-school-tagline { font-size: .85rem; opacity: .75; margin-top: .3rem; font-weight: 500; }

.auth-card {
  position: relative; z-index: 1;
  background: var(--glass-strong);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.5rem 1.5rem 2.5rem;
  flex-shrink: 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.4);
}
.auth-card-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 1.5rem; }
.auth-card-title  { font-size: 1.25rem; font-weight: 800; color: var(--text); margin-bottom: .2rem; }
.auth-card-sub    { font-size: .84rem; color: var(--text-muted); margin-bottom: 1.4rem; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-label { display: block; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin-bottom: .4rem; }
.form-group { margin-bottom: 1rem; }
.form-control {
  width: 100%; height: 50px; padding: 0 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9rem; font-family: inherit; color: var(--text);
  background: var(--glass); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { height: auto; padding: .75rem 1rem; resize: vertical; min-height: 88px; }
.form-control:focus {
  border-color: var(--primary-2);
  background: var(--glass-strong);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18);
}
.field-error { font-size: .78rem; color: var(--color-red); margin-top: .3rem; display: block; }

.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 2.8rem; }
.input-wrap-btn {
  position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 0; font-size: 1.15rem; line-height: 1;
}

/* -- Buttons -- */
.btn-primary {
  background: var(--primary); color: #fff;
  border: none; border-radius: 50px;
  height: 52px; padding: 0 1.5rem;
  font-size: .95rem; font-weight: 700;
  width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  /* Safety net: if a caller overrides display (e.g. inline-block on an <a>),
     justify-content stops applying and the label falls to the left. */
  text-align: center;
  transition: transform .14s var(--ease-spring), box-shadow .2s, opacity .15s;
  box-shadow: var(--glow);
  letter-spacing: .01em;
  position: relative; overflow: hidden;
}
.btn-primary:active { transform: scale(.97); opacity: .95; }
.btn-outline {
  background: var(--glass); color: var(--primary-2);
  border: 1.5px solid rgba(var(--primary-rgb),.4); border-radius: 50px;
  height: 50px; padding: 0 1.5rem;
  font-size: .9rem; font-weight: 700;
  width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  text-align: center;
  margin-top: .5rem; transition: background .15s, transform .14s var(--ease-spring);
}
.btn-outline:active { transform: scale(.97); background: var(--primary-light); }
.btn-ghost {
  background: none; border: none; color: var(--text-secondary);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  text-decoration: none; padding: 0;
}

/* tap ripple */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.35); pointer-events: none; animation: rip .6s var(--ease-soft); }
@keyframes rip { to { transform: scale(3); opacity: 0; } }

/* -- Divider -- */
.divider { display: flex; align-items: center; gap: .75rem; font-size: .75rem; color: var(--text-muted); margin: 1.25rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* -- Badges / Pills -- */
.pill { display: inline-flex; align-items: center; gap: .25rem; padding: .3rem .75rem; border-radius: 50px; font-size: .7rem; font-weight: 700; }
.pill-success { background: rgba(40,199,111,.16); color: #35d67f; }
.pill-warning { background: rgba(255,159,67,.16); color: #ffb166; }
.pill-danger  { background: rgba(234,84,85,.16);  color: #ff7576; }
.pill-info    { background: rgba(0,207,232,.16);  color: #2fdcee; }
.pill-primary { background: var(--primary-light); color: var(--primary-2); }
.pill-gold    { background: rgba(var(--primary-2-rgb),.18); color: var(--primary-2); }

/* -- Alert banners -- */
.alert {
  border-radius: var(--radius-sm); padding: .8rem 1rem;
  font-size: .84rem; margin-bottom: 1rem;
  display: flex; gap: .5rem; align-items: flex-start;
  border: 1px solid transparent; backdrop-filter: blur(12px);
}
.alert-warning { background: rgba(255,159,67,.14); color: #ffc182; border-color: rgba(255,159,67,.28); }
.alert-danger  { background: rgba(234,84,85,.14);  color: #ff9a9b; border-color: rgba(234,84,85,.28); }
.alert-success { background: rgba(40,199,111,.14); color: #57e29a; border-color: rgba(40,199,111,.28); }
.alert-info    { background: rgba(74,158,255,.14); color: #8fc0ff; border-color: rgba(74,158,255,.28); }

/* -- Step label -- */
.step-label { display: flex; align-items: center; gap: .5rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 1.25rem; }
.step-label::before, .step-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* -- Event card -- */
.event-card { border-left: 3px solid var(--primary-2); }
.event-date-badge { background: var(--primary-light); color: var(--primary-2); border-radius: 8px; padding: .22rem .55rem; font-size: .72rem; font-weight: 800; }

/* -- Ads / Sponsored slots (clearly labelled) -- */
.ad-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px;
}
.ad-card {
  position: relative; background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  backdrop-filter: blur(16px); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); overflow: hidden;
  transition: opacity .3s, transform .3s;
}
.ad-card::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: linear-gradient(var(--primary), var(--primary-2)); opacity: .7; }
.ad-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ad-close { background: none; border: none; color: var(--text-muted); font-size: 1.15rem; cursor: pointer; line-height: 1; }
.ad-body { display: flex; gap: 12px; align-items: center; }
.ad-logo { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem; background: linear-gradient(135deg, #2563eb, #38bdf8); }
.ad-txt  { flex: 1; min-width: 0; }
.ad-h    { font-weight: 800; font-size: .88rem; color: var(--text); }
.ad-d    { font-size: .75rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.ad-cta  { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.ad-adv  { font-size: .68rem; color: var(--text-muted); font-weight: 600; }
.ad-btn  { background: var(--primary-light); color: var(--primary-2); border: 1px solid rgba(var(--primary-rgb),.3); border-radius: 50px; padding: 6px 14px; font-size: .74rem; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none; }

.ad-banner { position: relative; display: flex; align-items: center; gap: 12px; background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; margin-bottom: 12px; backdrop-filter: blur(14px); }
.ad-banner .bl { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem; background: linear-gradient(135deg, #059669, #34d399); }
.ad-banner .bt { flex: 1; min-width: 0; }
.ad-banner .bh { font-weight: 700; font-size: .82rem; color: var(--text); }
.ad-banner .bd { font-size: .72rem; color: var(--text-secondary); }
.ad-banner .btag { position: absolute; top: 8px; right: 10px; }

/* -- Empty state -- */
.empty-state { text-align: center; padding: 2.75rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2.8rem; display: block; margin-bottom: .6rem; opacity: .7; }
.empty-state p { font-size: .85rem; }

/* -- Toast -- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 26px);
  transform: translate(-50%, 20px);
  background: var(--glass-strong); border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; border-radius: 50px; font-size: .78rem; font-weight: 600;
  backdrop-filter: blur(20px); box-shadow: var(--shadow); z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease-spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* -- Install Banner -- */
#pwa-install-banner .card { margin: 0; }

/* -- Spinner -- */
@keyframes bx-spin { to { transform: rotate(360deg); } }
.bx-spin { display: inline-block; animation: bx-spin .7s linear infinite; }

/* -- Utilities -- */
.d-flex { display: flex; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.mt-1 { margin-top: .25rem; } .mb-0 { margin-bottom: 0; } .mb-3 { margin-bottom: 1rem; }
.align-items-center { align-items: center; }
.align-items-start  { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.w-100 { width: 100%; }
