/* ==================================================================
   Shared design tokens, header & footer for the ScaleUp Studio app.
   Indigo SaaS palette — clean white surfaces, indigo accent.
================================================================== */

:root {
  /* Surfaces */
  --bg:           #ffffff;   /* page white */
  --surface:      #ffffff;   /* card */
  --surface-2:    #f5f7fb;   /* subtle band / hover */
  --line:         #e6e8ee;
  --line-strong:  #cfd3dc;

  /* Ink (slate) */
  --ink:          #0f172a;   /* near-black slate */
  --ink-2:        #475569;   /* mid slate */
  --ink-3:        #64748b;   /* muted */
  --ink-4:        #94a3b8;   /* placeholder */

  /* Brand accent — light indigo */
  --accent:       #6366f1;   /* indigo-500 */
  --accent-hover: #4f46e5;   /* indigo-600 */
  --accent-soft:  #eef0ff;   /* tint */
  --accent-tint:  #e0e7ff;   /* mid tint */
  --accent-ink:   #ffffff;

  /* Pastel category palette (re-used from schedule) */
  --c-sunrise: #dbe9ff;   --c-sunrise-ink: #1e3a6b;
  --c-reformer: #f3ecdd;  --c-reformer-ink: #5c4a1e;
  --c-private: #e8dcf5;   --c-private-ink: #4a2b7a;
  --c-focus:   #c9b2ef;   --c-focus-ink:   #3a1f6b;
  --c-power:   #fde68a;   --c-power-ink:   #713f12;   /* was coral red — now amber */
  --c-flow:    #ffd5c2;   --c-flow-ink:    #7a3420;
  --c-group:   #d3eadb;   --c-group-ink:   #1f4a35;
  --c-burn:    #d8e88a;   --c-burn-ink:    #3a4a10;

  --radius:    8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 24px -8px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; }

.page { flex: 1; display: flex; flex-direction: column; }

/* =======================  HEADER  ======================== */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
  /* Above in-page stacking contexts (e.g. .hero-inner z-index:20) so the sticky header's
     account + notification popovers are never painted behind the hero/search section. */
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
}
.site-header .header-left { display: flex; align-items: center; gap: 14px; }
.site-header .menu-btn { color: var(--ink); display: none; }

/* =======================  NAV DRAWER  ======================== */
.nav-drawer {
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none;
}
.nav-drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.32);
  opacity: 0; transition: opacity .22s ease;
  pointer-events: none;
}
.nav-drawer.open .nav-drawer-scrim { opacity: 1; pointer-events: auto; }
.nav-drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: min(360px, 88vw);
  background: var(--bg);
  border-right: 1px solid var(--line);
  box-shadow: 30px 0 60px -20px rgba(15, 23, 42, 0.18);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .22s ease;
  pointer-events: auto;
  overflow-y: auto;
}
.nav-drawer.open .nav-drawer-panel { transform: translateX(0); }
.nav-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.nav-drawer-section {
  padding: 22px 22px 6px;
}
.nav-drawer-section h5 {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.nav-drawer-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-drawer-list a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.nav-drawer-list a:hover { background: var(--surface-2); }
.nav-drawer-list a.active {
  background: var(--accent-soft);
  border-color: var(--accent-tint);
}
.nav-drawer-list a.active .lbl { color: var(--accent-hover); }
.nav-drawer-list a .row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.nav-drawer-list a .lbl {
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
}
.nav-drawer-list a .row svg { color: var(--ink-3); }
.nav-drawer-list a:hover .row svg { color: var(--accent); transform: translateX(2px); transition: transform .15s; }
.nav-drawer-list a .desc {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.4;
}
.nav-drawer-list.compact a { padding: 9px 14px; }
.nav-drawer-list.compact a .lbl { font-size: 13.5px; font-weight: 500; }
.nav-drawer-foot {
  margin-top: auto;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.nav-drawer-foot .who { font-size: 13.5px; font-weight: 500; }
.nav-drawer-foot .who-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.site-header .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  text-decoration: none; color: var(--ink);
}
.site-header .brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent);
  position: relative;
}
.site-header .brand-mark::before,
.site-header .brand-mark::after {
  content: ''; position: absolute;
  background: rgba(255,255,255,0.85);
  border-radius: 1.5px;
  left: 6px; right: 6px; height: 2px;
}
.site-header .brand-mark::before { top: 7px; }
.site-header .brand-mark::after  { bottom: 7px; }
.site-header .brand small {
  font-weight: 500; color: var(--ink-3); font-size: 12px; margin-left: 2px;
}

.primary-nav {
  display: flex; align-items: center; gap: 4px;
}
.primary-nav a {
  text-decoration: none;
  padding: 8px 14px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.primary-nav a:hover { background: var(--surface-2); color: var(--ink); }
.primary-nav a.active { background: var(--accent-soft); color: var(--accent-hover); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.acct-trigger { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; font-family: inherit; color: var(--ink); }
.acct-trigger:hover { background: var(--surface-2); border-color: var(--line-strong); }
.acct-trigger .avatar { width: 30px; height: 30px; font-size: 12px; }
.acct-trigger .nm { font-size: 13.5px; font-weight: 600; }
.acct-trigger svg { color: var(--ink-3); }
.notif-bell { position: relative; text-decoration: none; }
.notif-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 999px; background: #e11d48; border: 2px solid var(--bg); }
/* Notification bell dropdown (reuses .pop-wrap/.pop-menu positioning) */
.notif-menu { width: 340px; padding: 0; overflow: hidden; }
.notif-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-pop-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.notif-markall { background: none; border: 0; color: var(--accent-hover); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; padding: 0; }
.notif-markall:hover { text-decoration: underline; }
.notif-pop-list { max-height: 360px; overflow-y: auto; }
.notif-pop-item { display: flex; gap: 10px; padding: 11px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.notif-pop-item:hover { background: var(--surface-2); }
.notif-pop-item:last-child { border-bottom: 0; }
.notif-pop-item.unread { background: var(--accent-soft); }
.notif-pop-item .np-ic { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); }
.notif-pop-item.unread .np-ic { background: #fff; }
.np-ic.ok { color: #10b981; } .np-ic.warn { color: #f59e0b; } .np-ic.pay { color: var(--accent); } .np-ic.info { color: var(--ink-2); }
.notif-pop-item .np-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-pop-item .np-t { font-size: 13px; font-weight: 600; color: var(--ink); }
.notif-pop-item .np-d { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-pop-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.notif-pop-all { display: block; padding: 11px 14px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--accent-hover); text-decoration: none; border-top: 1px solid var(--line); }
.notif-pop-all:hover { background: var(--surface-2); }
@media (max-width: 560px) { .acct-trigger .nm { display: none; } }
.site-header.consumer .header-actions .btn { padding: 8px 16px; font-size: 13.5px; }
@media (max-width: 560px) {
  .site-header.consumer .auth-login { display: none; }
  .site-header.consumer .header-actions { gap: 8px; }
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; display: grid; place-items: center;
  color: var(--ink-2); transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.avatar {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--accent-soft);
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px; color: var(--accent-hover);
  border: 0; font-family: inherit; cursor: pointer;
}

/* ----- Popovers (language picker + profile menu) ----- */
.pop-wrap { position: relative; }
.lang-btn { width: auto; gap: 7px; padding: 0 10px; border-radius: 999px; }
.lang-btn .lang-flag { display: inline-flex; }
.fl { width: 21px; height: 14px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.lang-btn .lang-code { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }

/* Footer language picker */
.legal-right { display: flex; align-items: center; gap: 20px; }
.footer-lang {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-family: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.footer-lang:hover { border-color: var(--ink-3); background: var(--surface); }
.footer-lang .lang-code { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; }
.footer-lang .lang-flag { display: inline-flex; }
.footer-lang svg { color: var(--ink-3); }
.lang-up .pop-menu {
  top: auto; bottom: calc(100% + 8px); right: 0;
  transform-origin: bottom right; transform: translateY(6px) scale(0.98);
}
.lang-up.open .pop-menu { transform: translateY(0) scale(1); }
.pop-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.22);
  padding: 6px;
  min-width: 180px;
  opacity: 0; transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 40;
}
.pop-wrap.open .pop-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.lang-menu { min-width: 208px; }
.lang-item {
  width: 100%; display: flex; align-items: center;
  gap: 11px; padding: 9px 12px; border: 0; background: transparent;
  border-radius: 9px; cursor: pointer; font-family: inherit;
  font-size: 13.5px; color: var(--ink); text-align: left;
}
.lang-item .flag { display: inline-flex; width: 21px; }
.lang-item .nm { flex: 1; }
.lang-item:hover { background: var(--surface-2); }
.lang-item.active { color: var(--accent-hover); font-weight: 600; background: var(--accent-soft); }
.lang-item .code { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.lang-item.active .code { color: var(--accent-hover); }

.profile-menu { min-width: 248px; padding: 8px; }
.profile-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.profile-head .avatar { cursor: default; }
.profile-head .who { font-size: 13.5px; font-weight: 600; }
.profile-head .who-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.profile-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); text-decoration: none;
}
.profile-item svg { color: var(--ink-3); }
.profile-item:hover { background: var(--surface-2); color: var(--ink); }
.profile-item:hover svg { color: var(--accent); }
.profile-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.profile-item.signout { color: var(--ink-2); }
.profile-item.signout:hover { background: var(--surface-2); }

/* =======================  FOOTER  ======================== */
@media (min-width: 901px) {
  .site-footer.consumer-footer { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.consumer-footer .app-badges { display: flex; gap: 8px; margin-top: 16px; }
.consumer-footer .app-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-size: 12.5px; font-weight: 600; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.consumer-footer .app-badge:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  margin-top: 40px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  font-size: 13px;
  color: var(--ink-2);
}
.site-footer .foot-brand {
  display: flex; flex-direction: column; gap: 12px; max-width: 280px;
}
.site-footer .foot-brand .logo {
  display: flex; align-items: center; gap: 10px; color: var(--ink);
  font-weight: 600; font-size: 15px;
}
.site-footer .foot-brand .logo .brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent);
  position: relative;
}
.site-footer .foot-brand .logo .brand-mark::before,
.site-footer .foot-brand .logo .brand-mark::after {
  content: ''; position: absolute;
  background: rgba(255,255,255,0.85);
  border-radius: 1.5px;
  left: 6px; right: 6px; height: 2px;
}
.site-footer .foot-brand .logo .brand-mark::before { top: 7px; }
.site-footer .foot-brand .logo .brand-mark::after  { bottom: 7px; }
.site-footer .foot-brand p { margin: 0; line-height: 1.55; color: var(--ink-3); }
.site-footer h4 {
  margin: 0 0 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); font-weight: 600;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer ul a { text-decoration: none; color: var(--ink-2); }
.site-footer ul a:hover { color: var(--accent-hover); }
.site-footer .legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 16px; margin-top: 8px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-3);
}
.site-footer .legal .social { display: flex; gap: 12px; }

/* =======================  SEARCH AUTOCOMPLETE  ======================== */
.ac-host { position: relative; }
.ac-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 200;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px -14px rgba(15,23,42,.28);
  padding: 6px; max-height: 344px; overflow-y: auto;
}
.ac-group + .ac-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.ac-head {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; padding: 8px 10px 6px;
}
.ac-country { display: flex; align-items: center; gap: 8px; }
.ac-country .fl { width: 20px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.ac-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; background: transparent; border-radius: 9px;
  cursor: pointer; font-family: inherit; font-size: 13.5px; color: var(--ink); text-align: left;
}
.ac-item:hover, .ac-item.active { background: var(--surface-2); }
.ac-ic { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; color: var(--ink-3); }
.ac-ic svg { width: 15px; height: 15px; }
.ac-cityitem .ac-ic { color: var(--accent); }
.ac-tx { flex: 1; }
.ac-tx mark { background: var(--accent-soft); color: var(--accent-hover); padding: 0 1px; border-radius: 3px; }
.ac-empty { padding: 14px 12px; font-size: 13px; color: var(--ink-3); }

/* =======================  SHARED PRIMITIVES  ======================== */
.btn {
  appearance: none; -webkit-appearance: none;
  padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  font-weight: 500;
  transition: all .15s;
  font-family: inherit;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent-tint); }

/* Mobile */
@media (max-width: 1024px) {
  .site-header { padding: 14px 16px; gap: 12px; }
  .site-header .menu-btn { display: grid; }
  .primary-nav { display: none; }
  .site-footer { grid-template-columns: 1fr 1fr; padding: 24px 16px; gap: 24px; }
  .site-footer .foot-brand { grid-column: 1 / -1; }
  .site-footer .legal { flex-direction: column; gap: 10px; align-items: flex-start; }
}
