/* ==========================================================================
   EMI Freedom Lab — self-contained dark fintech theme.
   Scoped entirely under .fl-wrap so it never inherits the landing page's
   light theme variables and never leaks styles back out.
   ========================================================================== */

.fl-wrap {
  --fl-bg: #0b1120;
  --fl-bg-soft: #0f1729;
  --fl-card: #141f36;
  --fl-card-2: #1b2843;
  --fl-line: #253352;
  --fl-tx: #eef2fb;
  --fl-mu: #93a3c0;
  --fl-green: #3ddc97;
  --fl-amber: #f5b84a;
  --fl-red: #ff6b6b;
  --fl-blue: #5b9dff;
  --fl-gold: #f2c14e;

  position: relative;
  margin: 0 clamp(-18px, -5vw, -64px);
  padding: clamp(28px, 4vw, 52px) clamp(18px, 5vw, 64px) 40px;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(91,157,255,.16), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(61,220,151,.12), transparent 62%),
    linear-gradient(180deg, var(--fl-bg) 0%, var(--fl-bg-soft) 100%);
  color: var(--fl-tx);
  font-family: var(--font, 'Plus Jakarta Sans', system-ui, sans-serif);
  border-radius: 28px;
  border: 1px solid #1c2942;
  box-shadow: 0 30px 80px rgba(6, 12, 28, .55);
  overflow: hidden;
  isolation: isolate;
}

.fl-wrap *, .fl-wrap *::before, .fl-wrap *::after { box-sizing: border-box; }
.fl-wrap h3, .fl-wrap h4, .fl-wrap p, .fl-wrap ul, .fl-wrap ol, .fl-wrap li { margin: 0; }
.fl-wrap ul, .fl-wrap ol { padding: 0; list-style: none; }
.fl-wrap input, .fl-wrap select, .fl-wrap button { font: inherit; }
.fl-wrap :focus-visible { outline: 2px solid var(--fl-gold); outline-offset: 2px; }

/* ------------------------------------------------------------- top bar */
.fl-topbar {
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--fl-line);
}
.fl-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fl-brand-mark {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px;
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(140deg, var(--fl-green), #16a34a);
  color: #06241a; box-shadow: 0 10px 26px rgba(61,220,151,.32);
}
.fl-brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.fl-brand-sub { font-size: .8rem; color: var(--fl-mu); font-weight: 600; }
.fl-top-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.fl-top-kpis > div {
  background: var(--fl-card); border: 1px solid var(--fl-line);
  border-radius: 14px; padding: 10px 16px; min-width: 120px;
}
.fl-top-kpis span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fl-mu); font-weight: 800; }
.fl-top-kpis b { font-size: 1.02rem; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- nav */
.fl-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; scrollbar-width: thin; }
.fl-navbtn {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: var(--fl-card); color: var(--fl-mu);
  border: 1px solid var(--fl-line); font-weight: 700; font-size: .86rem;
  transition: all .18s ease;
}
.fl-navbtn:hover { color: var(--fl-tx); border-color: #3a4d78; }
.fl-navbtn.active { background: var(--fl-green); color: #06241a; border-color: transparent; font-weight: 800; }
.fl-emoji { line-height: 1; }

/* --------------------------------------------------------------- basics */
.fl-h3 { font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; margin: 26px 0 12px; }
.fl-h4 { font-size: .98rem; font-weight: 800; margin-bottom: 8px; }
.fl-kicker { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--fl-mu); font-weight: 800; }
.fl-sub { font-size: .84rem; color: var(--fl-mu); line-height: 1.55; }
.fl-note { font-size: .8rem; color: var(--fl-mu); line-height: 1.55; margin-top: 10px; }
.fl-note.warn { color: var(--fl-amber); }
.fl-strong { font-weight: 800; }
.fl-muted { color: var(--fl-mu); }
.ta-r { text-align: right; }
.mt-2 { margin-top: 12px; }
.ok { color: var(--fl-green); } .bad { color: var(--fl-red); }
.warn { color: var(--fl-amber); } .gold { color: var(--fl-gold); }
.info, .fl-strong { color: var(--fl-blue); }

.fl-big {
  font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800;
  line-height: 1.05; letter-spacing: -.03em; margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.fl-per { font-size: .55em; font-weight: 700; color: var(--fl-mu); margin-left: 6px; letter-spacing: 0; }

.fl-card {
  background: var(--fl-card); border: 1px solid var(--fl-line);
  border-radius: 20px; padding: 18px; min-width: 0;
}
.fl-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }

/* ---------------------------------------------------------------- hero */
.fl-hero {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 14px;
  background: linear-gradient(150deg, var(--fl-card-2), var(--fl-card));
  border: 1px solid var(--fl-line); border-radius: 24px; padding: 22px;
}
.fl-hero2 {
  background: linear-gradient(150deg, var(--fl-card-2), var(--fl-card));
  border: 1px solid var(--fl-line); border-radius: 24px; padding: 22px;
  margin-bottom: 14px;
}
.fl-hero-score { text-align: center; }
.fl-score-big { font-size: clamp(2.6rem, 8vw, 3.9rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--fl-green); }
.fl-score-big span { font-size: .3em; color: var(--fl-mu); letter-spacing: 0; }
.fl-donut { margin: 12px auto 6px; }
.fl-donut svg { display: block; }
.fl-score-parts { text-align: left; display: grid; gap: 8px; margin-top: 10px; }
.fl-part-top { display: flex; justify-content: space-between; font-size: .76rem; color: var(--fl-mu); font-weight: 700; margin-bottom: 3px; }
.fl-part-top b { color: var(--fl-tx); }
.fl-hero-mission { display: flex; flex-direction: column; justify-content: center; }
.fl-mission-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 8px; line-height: 1.2; }
.fl-hero-mission p { font-size: .9rem; color: var(--fl-mu); line-height: 1.6; }

/* --------------------------------------------------------------- KPIs */
.fl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-top: 14px; }
.fl-kpi-val { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; word-break: break-word; }
.fl-kpi-val.gold { color: var(--fl-gold); }

/* ------------------------------------------------------------ buttons */
.fl-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.fl-btn {
  padding: 11px 18px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .88rem;
  background: var(--fl-card-2); color: var(--fl-tx); border: 1px solid var(--fl-line);
  transition: transform .12s ease, filter .18s ease;
}
.fl-btn:hover { filter: brightness(1.14); transform: translateY(-1px); }
.fl-btn-primary { background: var(--fl-green); color: #06241a; border-color: transparent; font-weight: 800; }
.fl-btn-ghost { background: transparent; color: var(--fl-gold); box-shadow: inset 0 0 0 1.4px rgba(242,193,78,.55); }

/* --------------------------------------------------------------- chips */
.fl-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; letter-spacing: .03em;
  border: 1px solid currentColor; white-space: nowrap;
}
.fl-chip.ok, .fl-chip.good { color: var(--fl-green); }
.fl-chip.warn { color: var(--fl-amber); }
.fl-chip.bad { color: var(--fl-red); }
.fl-chip.info { color: var(--fl-blue); }
.fl-chip.gold { color: var(--fl-gold); }

/* --------------------------------------------------------------- forms */
.fl-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin-top: 14px; }
.fl-field { display: block; min-width: 0; }
.fl-field > span { display: block; font-size: .76rem; color: var(--fl-mu); font-weight: 700; margin-bottom: 5px; }
.fl-field small { display: block; font-size: .7rem; color: var(--fl-mu); margin-top: 4px; }
.fl-field input, .fl-field select {
  width: 100%; background: var(--fl-bg); color: var(--fl-tx);
  border: 1px solid var(--fl-line); border-radius: 11px; padding: 10px 12px;
}
.fl-field select { cursor: pointer; }
.fl-field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.fl-field input::-webkit-outer-spin-button, .fl-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fl-inline { max-width: 240px; margin-top: 12px; }

/* ----------------------------------------------------------- key/value */
.fl-rows { margin-top: 12px; display: grid; gap: 8px; }
.fl-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--fl-line); font-size: .87rem;
}
.fl-row:first-child { border-top: 0; }
.fl-row span { color: var(--fl-mu); }
.fl-row b { font-variant-numeric: tabular-nums; text-align: right; }
.fl-list { display: grid; gap: 7px; margin-top: 10px; }
.fl-list li { position: relative; padding-left: 18px; font-size: .86rem; color: var(--fl-mu); line-height: 1.55; }
.fl-list li::before { content: '→'; position: absolute; left: 0; color: var(--fl-green); font-weight: 800; }
.fl-list li b { color: var(--fl-tx); }

/* --------------------------------------------------------------- bars */
.fl-bar { height: 8px; background: var(--fl-card-2); border-radius: 999px; overflow: hidden; }
.fl-bar.sm { height: 6px; }
.fl-bar.tall { height: 12px; margin: 10px 0; }
.fl-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #10b981, var(--fl-green)); border-radius: 999px; transition: width .7s ease; }
.fl-bar > i.fl-warn { background: linear-gradient(90deg, #f59e0b, var(--fl-amber)); }
.fl-bar > i.fl-bad { background: linear-gradient(90deg, #ef4444, var(--fl-red)); }
.fl-bar > i.fl-info { background: linear-gradient(90deg, #3b82f6, var(--fl-blue)); }
.fl-bar > i.fl-ok { background: linear-gradient(90deg, #10b981, var(--fl-green)); }
.fl-bar > i.fl-good { background: linear-gradient(90deg, #10b981, var(--fl-green)); }
.fl-bar > i.gold { background: linear-gradient(90deg, #d9a404, var(--fl-gold)); }

.fl-bar-row { margin-bottom: 12px; }
.fl-bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; font-weight: 700; margin-bottom: 5px; }
.fl-bar-val { color: var(--fl-mu); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* --------------------------------------------------------- reco cards */
.fl-rec { border-color: rgba(61,220,151,.34); box-shadow: 0 0 0 1px rgba(61,220,151,.08); }
.fl-rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fl-rec-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }

.fl-action { border-left: 4px solid var(--fl-blue); }
.fl-action.tone-gold { border-left-color: var(--fl-gold); }
.fl-action.tone-ok { border-left-color: var(--fl-green); }
.fl-action.tone-warn { border-left-color: var(--fl-amber); }
.fl-action.tone-bad { border-left-color: var(--fl-red); }
.fl-action-title { font-size: .9rem; font-weight: 800; display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }

.fl-insight { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--fl-line); font-size: .86rem; line-height: 1.55; color: var(--fl-mu); }
.fl-insight:first-of-type { border-top: 0; }
.fl-insight b { color: var(--fl-tx); }

.fl-opt { font-size: 1.5rem; line-height: 1; margin-bottom: 6px; }

/* ------------------------------------------------------------ closures */
.fl-closure {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 0; border-top: 1px solid var(--fl-line);
}
.fl-closure:first-of-type { border-top: 0; }
.fl-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--fl-mu); margin-top: 10px; font-weight: 600; }

/* -------------------------------------------------------------- table */
.fl-table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--fl-line); border-radius: 14px; }
.fl-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 860px; }
.fl-table th {
  text-align: left; padding: 11px 12px; background: var(--fl-bg-soft);
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--fl-mu); font-weight: 800; white-space: nowrap;
}
.fl-table td { padding: 11px 12px; border-top: 1px solid var(--fl-line); vertical-align: middle; }
.fl-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-table tbody tr:hover { background: rgba(91,157,255,.06); }

/* ---------------------------------------------------------- strategies */
.fl-strat { margin-bottom: 16px; }
.fl-strat-top { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; margin-bottom: 6px; }
.fl-strat-end { color: var(--fl-green); font-weight: 800; font-variant-numeric: tabular-nums; }
.fl-strat-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--fl-mu); margin-top: 6px; font-weight: 600; }

.fl-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.fl-tab {
  padding: 8px 15px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .82rem;
  background: var(--fl-card-2); color: var(--fl-mu); border: 1px solid var(--fl-line);
}
.fl-tab.active { background: var(--fl-green); color: #06241a; border-color: transparent; font-weight: 800; }

/* -------------------------------------------------------- freedom replay */
.fl-replay {
  display: flex; align-items: flex-end; gap: 5px; height: 220px;
  margin-top: 16px; padding: 10px; background: var(--fl-bg-soft);
  border: 1px solid var(--fl-line); border-radius: 14px; overflow-x: auto;
}
.fl-replay-col { flex: 1 1 0; min-width: 42px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.fl-replay-bar {
  width: 100%; max-width: 30px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--fl-blue), #2563eb);
  transition: height .4s ease;
}
.fl-replay-amt { font-size: .62rem; color: var(--fl-mu); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-replay-mo { font-size: .6rem; color: var(--fl-mu); text-align: center; line-height: 1.2; white-space: nowrap; }
.fl-replay-mo em { display: block; color: var(--fl-green); font-style: normal; font-weight: 800; }

/* --------------------------------------------------------- achievements */
.fl-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; margin-top: 12px; }
.fl-badge {
  padding: 11px 14px; border-radius: 14px; font-size: .82rem; font-weight: 700;
  background: var(--fl-card-2); border: 1px solid var(--fl-line); color: var(--fl-mu); opacity: .5;
}
.fl-badge.earned { opacity: 1; color: var(--fl-gold); border-color: rgba(242,193,78,.4); background: rgba(242,193,78,.08); }

.fl-road { display: grid; gap: 4px; margin-top: 12px; }
.fl-road-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--fl-line); }
.fl-road-step:last-child { border-bottom: 0; }
.fl-road-dot {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; font-weight: 800;
  background: var(--fl-card-2); color: var(--fl-mu); border: 1px solid var(--fl-line);
}
.fl-road-step.now .fl-road-dot { background: var(--fl-green); color: #06241a; border-color: transparent; }
.fl-road-step.next .fl-road-dot { background: var(--fl-gold); color: #241a02; border-color: transparent; }
.fl-road-step.end .fl-road-dot { background: var(--fl-blue); color: #04101f; border-color: transparent; }

/* ------------------------------------------------------------ verdict */
.fl-verdict {
  margin-top: 14px; padding: 13px 16px; border-radius: 14px;
  font-size: .95rem; font-weight: 800; letter-spacing: .02em;
}
.fl-verdict.ok { background: rgba(61,220,151,.12); color: var(--fl-green); }
.fl-verdict.warn { background: rgba(245,184,74,.12); color: var(--fl-amber); }
.fl-verdict.bad { background: rgba(255,107,107,.12); color: var(--fl-red); }
.fl-verdict.info { background: rgba(91,157,255,.12); color: var(--fl-blue); }

.fl-disclaimer {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--fl-line);
  font-size: .76rem; color: var(--fl-mu); line-height: 1.6;
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .fl-hero { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .fl-wrap { border-radius: 0; margin-left: -18px; margin-right: -18px; padding-left: 14px; padding-right: 14px; }
  .fl-top-kpis { width: 100%; }
  .fl-top-kpis > div { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .fl-card, .fl-hero2, .fl-hero { padding: 16px; border-radius: 18px; }
  .fl-kpi-val { font-size: 1.4rem; }
  .fl-closure { flex-direction: column; }
  .ta-r { text-align: left; }
  .fl-row { flex-direction: column; gap: 2px; }
  .fl-row b { text-align: left; }
  .fl-replay-col { min-width: 34px; }
  .fl-replay-amt { display: none; }

  /* table becomes stacked cards */
  .fl-table-wrap { border: 0; overflow: visible; }
  .fl-table { min-width: 0; display: block; }
  .fl-table thead { display: none; }
  .fl-table tbody, .fl-table tr { display: block; }
  .fl-table tr {
    border: 1px solid var(--fl-line); border-radius: 14px;
    padding: 10px 12px; margin-bottom: 10px; background: var(--fl-bg-soft);
  }
  .fl-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 0; text-align: left !important; }
  .fl-table td::before {
    content: attr(data-label); color: var(--fl-mu); font-size: .68rem;
    text-transform: uppercase; letter-spacing: .06em; font-weight: 800; flex: 0 0 44%;
  }
  .fl-table td.num { text-align: left !important; }
  .fl-table td .fl-bar { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .fl-wrap *, .fl-wrap *::before, .fl-wrap *::after { animation: none !important; transition: none !important; }
}
