/* FireHub — gated foundation (FH-GATED-PORTALS-VISUAL-V1).
 *
 * Load order per gated page: /shared/brand.css FIRST, then this file, then
 * the page's own component styles. brand.css owns fonts and brand colors;
 * this file maps the legacy gated variable names onto brand tokens so every
 * gated surface converges on the FireHub identity without component
 * rewrites (the component language itself aligns to the Brannkostnaden
 * patterns in V2). No new brand colors are invented here (brand rule).
 */

/* Skriftene. Uten disse falt hele den gatede flaten tilbake på systemfonten,
   mens nettstedet står i Satoshi + Inter — samme produkt kunne ikke leses av
   typografien alene. Filene er nettstedets egne (firehub-final/public/site/fonts,
   samme byte), lagt i portalens public/fonts. Ingen ny avhengighet, ingen
   ekstern forespørsel. Samme deklarasjon som site.css. */
@font-face { font-family: Satoshi; src: url('/portal-app/fonts/Satoshi-Variable.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: Inter; src: url('/portal-app/fonts/Inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/portal-app/fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }

:root {
  /* Display face (Satoshi) under an internal name — the legacy gated
     `--display` is remapped to the BODY stack below because the gated
     components use it for body text. */
  --fh-display: 'Satoshi', 'Inter', system-ui, sans-serif;

  /* legacy gated names → brand tokens */
  --orange: var(--fire-500);
  --orange-strong: var(--fire-600);
  --orange-wash: var(--fire-50);
  --orange-line: var(--fire-200);
  --green: var(--safe);
  --green-strong: #15803d;
  --green-wash: var(--safe-50);
  --green-line: #cdebd7;
  --bg: var(--paper);
  --surface: #ffffff;
  --surface-2: var(--paper);
  --ink: var(--navy-900);
  --ink-soft: var(--navy-700);
  --ink-quiet: var(--navy-500);
  --line: var(--navy-100);
  --line-2: var(--navy-50);
  --display: var(--body);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 67, 0.05);
  --shadow: 0 10px 30px -14px rgba(16, 42, 67, 0.16), 0 2px 6px -2px rgba(16, 42, 67, 0.06);
  /* Arbeidsflate-bredde (staging readiness 2026-08-12, Påls beslutning):
   * gated Angular er et OPERATIVT system, ikke en markedsside — flatene
   * skal bruke skjermen. 1880px-tak gir full bredde minus gutters på
   * 1366/1440/1536-skjermer og et fornuftig tak på 1920+. Tekstbredder
   * begrenses lokalt (65-70ch) der lesbarhet krever det. */
  --maxw: 1880px;
}

/* Overskrifter: nettstedets egen paring (site.css) — Satoshi 650, -.04em,
   text-wrap: balance. Komponentene setter kun størrelse; vekt og knip
   bestemmes her, ikke per fil. */
h1, h2, h3, h4 { font-family: var(--fh-display); font-weight: 650; letter-spacing: -0.04em; text-wrap: balance; }

/* Den felles toppbaren setter display på .right; da må [hidden] fortsatt
   vinne (ellers dukker den innloggede høyresiden opp på utloggede skjermer).
   Komponentene erklærte dette hver for seg; nå står det ett sted. */
[hidden] { display: none !important; }

/* Toppbaren — ÉN definisjon for hele den gatede flaten. Nettstedets
   .site-header: 79px høy, flytende gutter, nesten hvit, tynn strek #e9edef,
   logo 128px bred. Komponentene hadde ni kopier av denne blokken; de er
   slettet. Feedback-familien beholder sin egen (identiske) kopi. */
.fb-top { background: rgba(255,255,255,.96); border-bottom: 1px solid #e9edef; position: sticky; top: 0; z-index: 30; }
.fb-top-inner { max-width: var(--maxw); margin: 0 auto; height: 79px; padding: 0 clamp(24px, 6.5vw, 116px); display: flex; align-items: center; gap: 18px; }
.fb-top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.fb-top .orgname { font-size: 14px; color: var(--ink-soft); font-weight: 600; }

/* Official FireHub logo lockup for gated top bars (mirrors Brand.astro:
   locked colours #ff8d00 flame + #771f00 wordmark; width rules the size). */
.fh-wordmark { display: flex; align-items: center; gap: 14px; min-height: 44px; text-decoration: none; color: inherit; }
.fh-logo { width: 128px; height: auto; display: block; flex-shrink: 0; }
.fh-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--navy-300); flex-shrink: 0; }
.fh-wordmark .sub { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 560px) {
  .fb-top-inner { height: 71px; padding: 0 24px; }
  .fb-top .fh-dot, .fb-top .fh-wordmark .sub { display: none; }
  .fh-logo { width: 112px; }
}

/* Smal skjerm (launch blockers item 6, 2026-09-24): toppbaren skal aldri gjøre
   siden bredere enn skjermen. Høyre del brytes under logoen når den ikke får
   plass, knappene brytes seg imellom, og navnet/e-posten kortes med «…».
   Alle knappene blir stående synlige. Desktop er uendret. */
.fb-top-inner, .fb-top .right { min-width: 0; }
.fb-top .fh-wordmark { flex-shrink: 0; }
.fb-top .orgname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-top .right .btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 900px) {
  .fb-top-inner { height: auto; min-height: 71px; flex-wrap: wrap; row-gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .fb-top .right { flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100%; }
  .fb-top .orgname { max-width: 100%; }
}
@media (max-width: 480px) {
  .fb-top-inner { padding-left: 16px; padding-right: 16px; }
  /* Navnet får sin egen linje over knappene, kortet med «…». */
  .fb-top .orgname { flex: 1 1 100%; text-align: right; font-size: 13px; }
  .fb-top .right .btn-sm { padding-left: 11px; padding-right: 11px; }
}

/* ── V2: komponentspråk — Brannkostnaden-mønstrene ──
   Buttons/chips centralised here (the per-file duplicates are removed);
   chip washes mirror brannkalkulator.css badge pairs 1:1. */

:root {
  --chip-green-bg: rgba(22, 163, 74, 0.10);
  --chip-green-line: rgba(22, 163, 74, 0.30);
  --chip-gray-bg: rgba(100, 116, 139, 0.10);
  --chip-gray-line: rgba(100, 116, 139, 0.28);
  --chip-orange-bg: rgba(249, 115, 22, 0.12);
  --chip-orange-line: rgba(249, 115, 22, 0.34);
}

/* Knapper — nettstedets .button (site.css): Inter 600 14px, radius 4,
   treffflate minst 44px, 52px når knappen er full bredde (inngangene).
   Pilen ↗ er et tekstglyf, som på nettstedet — ikke et ikon.
   Presentasjonsviseren beholder sine egne knappestiler med vilje. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--body); font-weight: 600; font-size: 14px; line-height: 1.3; min-height: 44px; border: 1px solid transparent; cursor: pointer; padding: 12px 20px; border-radius: var(--r-sm); text-decoration: none; white-space: nowrap; transition: background .2s, border-color .15s, box-shadow .2s; }
.btn span[aria-hidden="true"] { font-size: 20px; line-height: 1; }
.btn-primary { background: var(--fire-500); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), inset 0 -2px 0 rgba(0, 0, 0, 0.08); }
.btn-primary:hover { background: var(--fire-600); }
.btn-primary:disabled { background: var(--fire-200); color: #fff; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--navy-200); }
.btn-ghost:hover { background: var(--navy-50); border-color: var(--navy-300); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 7px 13px; font-size: 13px; gap: 9px; }
.btn-block { width: 100%; min-height: 52px; gap: 24px; }

/* Skjemafelt — nettstedets .form-row input (site.css): hvit boks med en
   bestemt kant, radius 4, minst 44px høy. 16px er et bevisst avvik fra
   nettstedets 14px: under 16px zoomer iOS inn ved fokus, og inngangene
   fylles ut på mobil. Fokus er den globale ringen (portal-level1.css) —
   feltene fjerner den ikke lenger og legger ikke på en egen glød.
   Definert her; de tre lokale kopiene i komponentene er slettet. */
.f input, .f select, .f textarea { font-size: 16px; color: var(--ink); background: #fff; border: 1px solid #cad4db; border-radius: var(--r-sm); padding: 11px 13px; min-height: 44px; width: 100%; transition: border-color .14s; }
.f textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.f input::placeholder, .f textarea::placeholder { color: var(--ink-quiet); }

/* Tomme tilstander — nettstedets .lead-stemme, ett språk for hele flaten. */
.fh-empty { font-size: 17px; line-height: 1.7; color: var(--ink-soft); margin: 0; max-width: 60ch; }

/* To merkespråk, ikke fem (2026-09-22): en 999px tilstandspille
   (.acc-pill, .lang-toggle a) og et datamerke med radius 4 — alt annet
   følger den strukturelle radiusen. */
.sb-pill { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.02em; padding: 3px 8px; border-radius: var(--r-sm); border: 1px solid transparent; white-space: nowrap; }
.sb-pill.y { background: var(--chip-green-bg); border-color: var(--chip-green-line); color: var(--green-strong); }
.sb-pill.n { background: var(--chip-gray-bg); border-color: var(--chip-gray-line); color: var(--navy-600); }
.sb-pill.o { background: var(--chip-orange-bg); border-color: var(--chip-orange-line); color: #c2410c; }

/* NDA status chips inherit the same badge language. */
.nda-chip { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.02em; padding: 4px 9px; border-radius: var(--r-sm); background: var(--chip-gray-bg); border: 1px solid var(--chip-gray-line); color: var(--navy-600); white-space: nowrap; }
.nda-chip.y { background: var(--chip-green-bg); border-color: var(--chip-green-line); color: var(--green-strong); }

/* State-bearing NDA surfaces get the bkc left rule (accent only where it
   earns hierarchy — the pattern from the impact/life cards). */
#ndaPanel, #ndaStatus { border-left: 3px solid var(--fire-500); }

/* Loading: STRATA in HTML and CSS (Pål 2026-09-27, «få inn strata med en eller annen html effekt når ting loader»).
   The flame of the logo mark is the mask; inside it a stack of floor plates (--paper with a --paper-3 edge) rises from the bottom,
   one floor at a time, like the tower in the launch film. The 1 px seams between the floors are left open, so the element's own
   background shows through as the core: it warms from --fire-300 to --fire-400 once the tower stands, then the tower is taken
   down from the top and rises again for as long as something loads. The ghost of the whole flame (::before) keeps the shape in
   view from the start. It appears only after 200 ms, so a fast load never flashes. No images, no new dependency; the only
   JavaScript is the real progress under the text (.fh-load-bar).
   Reduced motion: the tower stands finished and still, with a calm core, the text under it and the progress line.
   .fh-loading--sm is the small inline variant for «Henter …» inside a page (tower beside the text). */
.fh-loading { display: grid; grid-template-rows: auto auto; justify-items: center; gap: 16px; }
.fh-loading::before, .fh-loading::after {
  content: ''; grid-area: 1 / 1; width: 64px; height: 132px;
  -webkit-mask: url('/brand/firehub-logo-mark.svg') center / contain no-repeat; mask: url('/brand/firehub-logo-mark.svg') center / contain no-repeat;
}
.fh-loading::before { background: var(--paper-2); }
.fh-loading::after {
  background-color: var(--fire-300);
  background-image:
    linear-gradient(90deg, rgba(16, 42, 67, .05), rgba(255, 255, 255, .5) 24%, transparent 46%, rgba(16, 42, 67, .12) 78%, rgba(16, 42, 67, .24)),
    repeating-linear-gradient(to top, transparent 0 1.5px, var(--paper-3) 1.5px 2.4px, #fff 2.4px 5.2px, var(--paper-3) 5.2px 6px);
}
.fh-loading p { grid-row: 2; margin: 0; font-size: 14px; color: var(--ink-quiet); }
.fh-loading.is-live { animation: fh-loading-in 240ms ease-out 200ms both; }
/* Pål 06.10 (replaces «rise once, no loop» from the night before): the animation loops while something loads, and a progress
   line shows how far it has come, so a hang is visible as a line that stands still. The loop is the tower being built floor by
   floor, standing a moment, and taking itself down from the top before it is built again. The figure never blinks or pulses:
   no opacity change, the core only warms one step while the tower stands. */
.fh-loading.is-live::after { animation: fh-strata-rise 4.4s infinite; }
@keyframes fh-loading-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fh-strata-rise {
  0%   { clip-path: inset(100% 0 0 0); background-color: var(--fire-300); animation-timing-function: steps(22, end); }
  56%  { clip-path: inset(0 0 0 0); background-color: var(--fire-300); animation-timing-function: ease-out; }
  70%  { clip-path: inset(0 0 0 0); background-color: var(--fire-400); }
  82%  { clip-path: inset(0 0 0 0); background-color: var(--fire-400); animation-timing-function: ease-in-out; }
  100% { clip-path: inset(100% 0 0 0); background-color: var(--fire-300); }
}
/* The progress line (fh-loading-screen and the boot screen in index.html). --fh-progress (0 to 1) is set only from real progress:
   finished Supabase calls, navigations and boot steps. It never moves on a timer. */
.fh-load-bar {
  grid-row: 3; width: min(220px, 60vw); height: 3px; border-radius: 3px; overflow: hidden; background: var(--paper-3);
}
.fh-load-bar > span {
  display: block; height: 100%; background: var(--fire-500); border-radius: inherit;
  transform: scaleX(var(--fh-progress, 0)); transform-origin: left center; transition: transform 320ms ease-out;
}
.fh-loading--sm .fh-load-bar { display: none; }
.fh-loading--sm { display: inline-grid; grid-template-rows: auto; grid-auto-flow: column; align-items: center; justify-items: start; gap: 10px; }
.fh-loading--sm::before, .fh-loading--sm::after { width: 22px; height: 46px; }
.fh-loading--sm p { grid-row: 1; grid-column: 2; font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) {
  /* Reduced motion: no loop, the tower stands finished; the progress line still moves, without a glide. */
  .fh-loading.is-live, .fh-loading.is-live::after { animation: none; }
  .fh-load-bar > span { transition: none; }
}
.fh-boot { min-height: 100vh; align-content: center; }
/* Pål 06.10: a loading screen stands in the middle of the window on every screen, at a size you notice, never at the top.
   Covers the page while it loads (same background as the page); the small inline variant (.fh-loading--sm) is untouched. */
.fh-loading.is-live:not(.fh-loading--sm) {
  position: fixed; inset: 0; z-index: 40; margin: 0; max-width: none; padding: 24px;
  align-content: center; background: var(--bg);
}
.fh-loading.is-live:not(.fh-loading--sm)::before, .fh-loading.is-live:not(.fh-loading--sm)::after { width: 96px; height: 198px; }
.fh-loading.is-live:not(.fh-loading--sm) p { font-size: 15px; }

/* ── Forsiden etter innlogging (visuelt løft 27.09) ─────────────────────
   Hver innlogget forside svarer på tre spørsmål før første klikk: hva
   trenger meg nå (.fh-todo), hvor står vi (.fh-kpis), hva skjer videre.
   Samme byggeklosser i alle områder, så admin, partner, investor og kunde
   kjennes som ett produkt. Oransje = krever handling, navy = fakta, grønt
   bare for det som er fullført. */
.fh-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.fh-sec-h { font-family: var(--display); font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
.fh-sec-k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-quiet); margin: 0; }
.fh-ico { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; background: var(--navy-50); color: var(--navy-700); }
.fh-ico svg, .fh-ico .fh-icon > svg { width: 19px; height: 19px; display: block; }
.fh-ico.act { background: var(--orange-wash); color: var(--orange-strong); }
.fh-ico.done { background: var(--green-wash); color: var(--green-strong); }
.fh-chev { width: 7px; height: 7px; border-top: 1.6px solid var(--ink-quiet); border-right: 1.6px solid var(--ink-quiet); transform: rotate(45deg); margin: 0 6px 0 2px; flex-shrink: 0; }

.fh-todo { list-style: none; margin: 0; padding: 0; }
.fh-todo li + li { border-top: 1px solid var(--line); }
.fh-todo a, .fh-todo .fh-todo-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 2px; text-decoration: none; color: inherit; border-radius: 8px; }
.fh-todo a:hover .fh-chev { border-color: var(--orange-strong); }
.fh-todo a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.fh-todo .t { font-size: 14.5px; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.fh-todo .t b { font-variant-numeric: tabular-nums; font-weight: 700; }
.fh-todo .s { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.fh-todo-clear { display: flex; align-items: center; gap: 12px; padding: 10px 2px; font-size: 14.5px; color: var(--ink-soft); margin: 0; }

.fh-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fh-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; min-width: 0; text-decoration: none; color: inherit; }
a.fh-kpi:hover { border-color: var(--navy-200); }
a.fh-kpi:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.fh-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.fh-kpi-n { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ink); }
.fh-kpi-n small { font-family: var(--body); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-soft); }
.fh-kpi-s { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); overflow-wrap: anywhere; }

/* Én rolig inngang per blokk: opp 6 px og inn, forskjøvet. Ingen løkker. */
.fh-rise { animation: fh-rise 260ms ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes fh-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fh-rise { animation: none; } }

/* ── STRATA og landskapet ──────────────────────────────────────────────
   Samme bilde-lag som nettstedets /kom-i-gang (.contact-scene .world):
   bybildet på .9 inne i et lag på .48, og lystårnet til høyre — alltid
   beskåret av høyre kant, aldri sentrert, aldri bak et felt eller en
   tabell. Løftet ut av feedback-familien (.fbB-world) så inngangene kan
   bruke det samme laget. Begge bildene ligger allerede i public/img.
   Statiske bilder: redusert bevegelse endrer ingenting her. */
.fh-world { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; opacity: .48; }
.fh-world .plate { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center bottom; opacity: .9; }
.fh-world .strata { position: absolute; width: 1100px; max-width: none; height: auto; right: -370px; bottom: 0; }
@media (max-width: 800px) {
  .fh-world { opacity: .2; }
  .fh-world .plate { object-position: 65% bottom; opacity: .7; }
  /* Smalskjerm: nettstedets mindre tårn (site.css @800: 750px), skjøvet så
     langt ut at det blir beskåret av høyre kant også på telefon — aldri
     sentrert. Forholdet mellom forskyvning og bredde, ikke skjermbredden,
     avgjør beskjæringen, så den holder fra 320px og opp. */
  .fh-world .strata { width: 750px; right: -300px; }
}

/* Områdevarianten: kun en horisontstripe bak sideoverskriften, maskert ut
   før det første kortet — aldri bak en tabell. Nettstedets .core-world-
   geometri (780px tårn). Foreldreelementet setter position: relative. */
.fh-world--band { position: absolute; inset: 0 0 auto; height: 280px; opacity: .22; -webkit-mask-image: linear-gradient(#000 0 55%, transparent); mask-image: linear-gradient(#000 0 55%, transparent); }
.fh-world--band .plate { object-position: center bottom; }
.fh-world--band .strata { width: 780px; right: -90px; }
@media (max-width: 900px) {
  .fh-world--band { opacity: .12; }
  .fh-world--band .strata { display: none; }
}
