/* FunIntended shared design system — used by all three sites. */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  /* 800/900 and orange-2 are derived, so a client's own colors (set inline on <html>) carry through the gradients. */
  --navy-900: color-mix(in srgb, var(--navy-700) 70%, black);
  --navy-800: color-mix(in srgb, var(--navy-700) 86%, black);
  --navy-700: #2b4192;
  --navy-600: #3651ad;
  --orange: #f97316;
  --orange-2: color-mix(in srgb, var(--orange) 78%, white);
  --yellow: #fbbf24;
  --green: #22a35a;
  --red: #e5484d;
  --ink: #1b2559;
  --ink-2: #4a5280;
  --muted: #7d84a8;
  --line: #e2e5f4;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #fff;
  --bg: #e9ebfa;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(43, 65, 146, 0.12), 0 1px 2px rgba(43, 65, 146, 0.08);
  --sidebar-w: 230px;
  --font: 'Nunito', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 70% -10%, #fff7ec 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 110%, #dfe2fb 0%, transparent 60%),
    linear-gradient(180deg, #f1f2fc 0%, #e4e6f8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); letter-spacing: 0.1px; }
h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }

/* ---------- layout ---------- */
.fi-app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.fi-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.07) 0 2px, transparent 3px) 0 0/38px 38px,
    radial-gradient(600px 300px at 0% 40%, rgba(99,129,230,0.35), transparent 70%),
    radial-gradient(500px 400px at 100% 90%, rgba(99,129,230,0.3), transparent 70%),
    linear-gradient(180deg, var(--navy-700), var(--navy-900));
  color: #dfe5ff; padding: 18px 0 24px; display: flex; flex-direction: column;
}
.fi-brand { display: flex; align-items: center; gap: 10px; padding: 0 18px 22px; color: #fff; }
.fi-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; color: var(--orange-2); }
.fi-brand .name small { display: block; font-size: 13px; color: #c9d2ff; font-weight: 500; margin-top: 4px; }
.fi-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.fi-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #e3e8ff; font-weight: 600; font-size: 15px; text-decoration: none; position: relative;
}
.fi-nav a:hover { background: rgba(255,255,255,0.08); }
.fi-nav a.active { background: rgba(255,255,255,0.14); color: var(--yellow); }
.fi-nav a.active::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 4px 4px 0; background: var(--orange); }
.fi-nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #93a0d8; padding: 16px 12px 6px; font-weight: 800; }
.fi-nav svg { width: 18px; height: 18px; flex: none; }
.fi-sidebar .fi-side-badge { margin: auto 16px 0; padding: 18px 14px; border-radius: 18px; background: rgba(255,255,255,0.06); text-align: center; }
.fi-sidebar .fi-side-badge .t { font-family: var(--font-display); font-size: 26px; color: #fff; line-height: 1.05; margin-top: 8px; }
.fi-sidebar .fi-side-badge .s { color: #c9d2ff; font-size: 14px; margin-top: 6px; }

.fi-main { min-width: 0; display: flex; flex-direction: column; }
.fi-topbar {
  position: sticky; top: 0; z-index: 20; height: 58px; display: flex; align-items: center; gap: 6px; padding: 0 22px;
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800)); color: #fff; box-shadow: 0 2px 10px rgba(27,42,99,0.25);
}
.fi-topbar .links { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.fi-topbar .links a { color: #e6eaff; padding: 18px 14px; font-weight: 600; font-size: 15px; text-decoration: none; position: relative; white-space: nowrap; }
.fi-topbar .links a.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--orange); }
.fi-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.12); font-size: 14px; font-weight: 600; color: #fff; }
.fi-iconbtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: #fff; cursor: pointer; }
.fi-iconbtn:hover { background: rgba(255,255,255,0.1); }
.fi-iconbtn svg { width: 20px; height: 20px; }
.fi-content { padding: 26px 28px 60px; max-width: 1240px; width: 100%; }
.fi-menu-toggle { display: none; }

/* ---------- hero ---------- */
.fi-hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 6px 4px 0; }
.fi-hero h1 { color: var(--navy-900); }
.fi-hero p { font-size: 19px; color: var(--ink-2); margin-top: 10px; max-width: 560px; line-height: 1.5; }
.fi-hero .small { font-size: 14px; margin-top: 12px; }
.fi-hero .confetti { position: absolute; right: 30px; top: -10px; font-size: 34px; opacity: 0.9; pointer-events: none; }

/* ---------- grid & cards ---------- */
.fi-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.fi-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fi-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.fi-cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.fi-cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.card { background: var(--card); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.9); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card.panel { padding: 20px 20px 22px; background: rgba(255,255,255,0.55); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { flex: 1; }
.card.inner { background: var(--card-solid); box-shadow: 0 2px 10px rgba(43,65,146,0.08); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 12px; } .mt2 { margin-top: 20px; } .mb { margin-bottom: 12px; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--navy-700); font-weight: 700; padding: 9px 16px; border-radius: 10px; cursor: pointer; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform .08s, box-shadow .15s; }
.btn:hover { box-shadow: 0 3px 10px rgba(43,65,146,0.15); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, var(--orange-2), var(--orange)); color: #fff; border-color: color-mix(in srgb, var(--orange) 88%, black); box-shadow: 0 4px 12px color-mix(in srgb, var(--orange) 35%, transparent); }
.btn.navy { background: linear-gradient(180deg, var(--navy-600), var(--navy-700)); color: #fff; border-color: var(--navy-800); }
.btn.ghost { background: rgba(255,255,255,0.6); }
.btn.danger { color: var(--red); }
.btn.big { padding: 12px 22px; font-size: 17px; border-radius: 12px; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--navy-600); font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.linkbtn:hover { background: rgba(54,81,173,0.08); }

/* ---------- pills & badges ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 7px; font-size: 13px; font-weight: 700; background: #eef0fb; color: var(--ink-2); }
.pill.green { background: #dcf5e6; color: #177c43; }
.pill.red { background: var(--red); color: #fff; }
.pill.yellow { background: #fde9a8; color: #7a5300; }
.pill.orange { background: #ffe4cc; color: #b54708; }
.pill.blue { background: #dfe6ff; color: var(--navy-600); }
.points-badge { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 12px; border-radius: 10px; font-family: var(--font-display); font-weight: 700; font-size: 26px; background: #fde68a; color: var(--ink); }
.points-badge small { font-size: 14px; font-weight: 600; }
.points-badge.green { background: #7cc95b; color: #fff; }

/* ---------- avatars ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.15); background-size: cover; background-position: center; }
.avatar.lg { width: 92px; height: 92px; font-size: 32px; border-radius: 14px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item .score { font-weight: 800; color: var(--ink); }
.tile { border-radius: 12px; display: grid; place-items: center; font-size: 44px; aspect-ratio: 16/9; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.2); background-size: cover; background-position: center; }
.tile.sq { aspect-ratio: 1; font-size: 26px; width: 44px; border-radius: 10px; }

/* ---------- progress / donut ---------- */
.bar { height: 10px; border-radius: 99px; background: #e2e5f4; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-600), #5b7be0); }
.bar.warm > span { background: linear-gradient(90deg, var(--yellow), var(--orange-2)); }
.donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 6px auto; }
.donut > div { width: 104px; height: 104px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.donut b { font-family: var(--font-display); font-size: 30px; display: block; line-height: 1; }
.donut small { font-size: 12px; color: var(--muted); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid #d6daf0; border-radius: 10px; background: #fff; outline: none; font-size: 15px; }
.input:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(54,81,173,0.15); }
textarea.input { min-height: 90px; resize: vertical; }
input[type=color].input { height: 46px; padding: 5px 6px; cursor: pointer; }
input[type=color].input::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color].input::-webkit-color-swatch { border: none; border-radius: 7px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 0; }
.toggle input { width: 40px; height: 22px; appearance: none; border-radius: 99px; background: #cfd4ee; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--green); }
.toggle input:checked::after { left: 21px; }
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer .input { border-color: transparent; background: #f6f7fd; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(54,81,173,0.03); }

/* ---------- stats ---------- */
.stat { padding: 16px 18px; }
.stat .k { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat .v { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin-top: 4px; }
.stat .d { font-size: 13px; color: var(--ink-2); }

/* ---------- feed ---------- */
.post { padding: 16px 18px; }
.post .head { display: flex; align-items: center; gap: 10px; }
.post .actions { display: flex; gap: 18px; margin-top: 12px; color: var(--navy-600); font-weight: 700; font-size: 14px; }
.post .actions button { background: none; border: 0; color: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 4px; font-weight: 700; }
.post .actions button.on { color: var(--orange); }
.post .congrats { font-family: var(--font-display); font-size: 26px; font-weight: 500; }
.post .congrats b { color: var(--navy-600); font-weight: 600; }
.gif { border-radius: 12px; aspect-ratio: 16/8; display: grid; place-items: center; font-size: 64px; background: linear-gradient(135deg, #ffd27a, #ff8a65 50%, #b388ff); margin-top: 12px; position: relative; }
.gif::after { content: 'GIF'; position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.comment { display: flex; gap: 8px; margin-top: 8px; font-size: 14px; }
.comment .bubble { background: #f3f4fb; padding: 7px 11px; border-radius: 10px; }

/* ---------- toast & modal ---------- */
.fi-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy-800); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; font-weight: 700; max-width: calc(100vw - 32px); }
.fi-toast.error { background: var(--red); }
.fi-modal-bg { position: fixed; inset: 0; background: rgba(20,28,70,0.45); display: grid; place-items: center; z-index: 90; padding: 16px; }
.fi-modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.fi-modal.wide { width: min(820px, 100%); }
.fi-modal header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.fi-modal .body { padding: 20px 22px; }
.fi-modal footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- login ---------- */
.fi-login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(800px 500px at 20% 20%, rgba(99,129,230,0.45), transparent 70%), linear-gradient(160deg, var(--navy-700), var(--navy-900)); }
.fi-login .card { width: min(420px, 100%); padding: 30px; background: #fff; }
.fi-login .logo { display: flex; justify-content: center; margin-bottom: 12px; }
.fi-login h1 { font-size: 28px; text-align: center; }
.fi-login .sub { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.demo-note { margin-top: 16px; font-size: 13px; background: #f4f6ff; border-radius: 10px; padding: 10px 12px; color: var(--ink-2); }

.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .e { font-size: 38px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 99px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.tabs button.on { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #f1f3fb; padding: 2px 6px; border-radius: 6px; }
pre.mono { padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .fi-grid { grid-template-columns: 1fr; }
  .fi-cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .fi-app { grid-template-columns: 1fr; }
  .fi-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .fi-app.nav-open .fi-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .fi-menu-toggle { display: grid; }
  .fi-topbar { padding: 0 8px; }
  .fi-topbar .links { display: none; }
  .fi-topbar .spacer-m { flex: 1; }
  .fi-content { padding: 18px 16px 50px; }
  h1 { font-size: 30px; }
  .fi-hero { flex-direction: column; align-items: flex-start; }
  .fi-hero p { font-size: 16px; }
  .fi-cols-2, .fi-cols-3, .fi-cols-4, .form-grid { grid-template-columns: 1fr; }
}

/* keep the sidebar colour running the full height of long pages */
@media (min-width: 821px) { .fi-app { background: linear-gradient(90deg, var(--navy-900) var(--sidebar-w), transparent var(--sidebar-w)); } }
.post .actions svg, .linkbtn svg, .card-head svg { width: 18px; height: 18px; vertical-align: middle; }
