/* e-framtid designsystem — sammanslagna tokens */

/* ===== fonts.css ===== */
/* Barlow + Barlow Condensed — SIL Open Font License, self-hostable.
   Loaded from the Google Fonts CDN here; drop the woff2 files into
   assets/fonts/ and swap in @font-face rules to self-host. */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&display=swap");

:root {
  /* Barlow Condensed carries every display, heading, button and eyebrow role. */
  --font-condensed: "Barlow Condensed", "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; /* @kind font */
  /* Barlow (normal width) carries running body copy and data. */
  --font-body-face: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; /* @kind font */

  --font-family-display: var(--font-condensed); /* @kind font */
  --font-family-body: var(--font-body-face); /* @kind font */
  --font-features-tabular: "tnum"; /* @kind other */
}


/* ===== colors.css ===== */
/* ── e-framtid palette ──────────────────────────────────────────────
   The four brand values below are supplied by the client and exact.
   Values marked (derived) are tints/shades computed from them for
   states, surfaces and text — documented in readme.md → VISUAL FOUNDATIONS. */
:root {
  /* ---- Brand blue ---- */
  --sky: #0388c7;              /* supplied — "ljusblåa färgen" */
  --navy: #002c5d;             /* supplied — "blå skugga" */
  --sky-light: #37a6db;        /* derived — light stop of the logo gradient */
  --sky-deep: #0273a9;         /* derived — accessible fill/link blue, 5.2:1 on white */
  --sky-press: #015d88;        /* derived — hover on the accessible fill */
  --navy-deep: #001d3f;        /* derived — deepest app surface */

  /* ---- Brand red ---- */
  --red: #de0d39;              /* supplied — "röd färg" */
  --red-deep: #820a29;         /* supplied — "röd färg skugga" */
  --red-light: #f2456a;        /* derived — light stop */
  --red-on-dark: #ff8ba3;      /* derived — red text on navy, 6.2:1 */

  /* ---- Ink (navy-tinted, never pure black) ---- */
  --ink: #10263f;              /* derived from --navy */
  --ink-secondary: #35506b;    /* derived */
  --ink-mute: #64798f;         /* derived */
  --on-brand: #ffffff;

  /* ---- Surfaces ---- */
  --canvas: #ffffff;
  --canvas-soft: #f2f6fa;      /* derived — cool sky tint */
  --canvas-mute: #e5edf5;      /* derived */
  --hairline: #d6e2ec;         /* derived */
  --hairline-input: #b6c7d7;   /* derived */

  /* ---- Gradients (the logo's own vertical sky→navy and red→deep-red) ---- */
  --gradient-brand: linear-gradient(180deg, var(--sky) 0%, var(--navy) 100%);
  --gradient-brand-soft: linear-gradient(180deg, var(--sky-light) 0%, var(--sky) 48%, var(--navy) 100%);
  --gradient-accent: linear-gradient(180deg, var(--red) 0%, var(--red-deep) 100%);
  --gradient-hero: linear-gradient(168deg, var(--navy) 0%, #013f78 46%, var(--sky) 100%);

  /* ---- Semantic aliases ---- */
  --text-body: var(--ink);
  --text-secondary: var(--ink-secondary);
  --text-muted: var(--ink-mute);
  --text-on-dark: var(--on-brand);
  --text-on-dark-muted: rgba(255, 255, 255, 0.74);
  --text-on-dark-faint: rgba(255, 255, 255, 0.66);
  --text-link: var(--sky-deep);

  --surface-page: var(--canvas);
  --surface-card: var(--canvas);
  --surface-band: var(--canvas-soft);
  --surface-band-strong: var(--canvas-mute);
  --surface-inverse: var(--navy);
  --surface-inverse-deep: var(--navy-deep);
  --surface-panel-on-dark: rgba(255, 255, 255, 0.06);

  --border-hairline: var(--hairline);
  --border-input: var(--hairline-input);
  --border-input-focus: var(--sky);
  --border-on-dark: rgba(255, 255, 255, 0.16);

  /* Filled actions use --sky-deep, not --sky: white on #0388c7 is only 3.9:1,
     white on #0273a9 is 5.2:1. --sky stays the graphic/chart blue. */
  --action-primary: var(--sky-deep);
  --action-primary-hover: var(--sky-press);
  --action-primary-press: var(--navy);
  --action-accent: var(--red);
  --action-accent-hover: #c50c32;
  --action-accent-press: var(--red-deep);

  --status-positive: var(--sky-deep);
  --status-positive-on-dark: var(--sky-light);
  --status-negative: var(--red);
  --status-negative-on-dark: var(--red-on-dark);
  --chart-1: var(--sky);
  --chart-2: var(--sky-light);
  --chart-3: var(--navy);
  --chart-4: var(--red);
  --chart-grid: var(--hairline);
}


/* ===== typography.css ===== */
:root {
  --weight-regular: 400; /* @kind other */
  --weight-medium: 500; /* @kind other */
  --weight-semibold: 600; /* @kind other */
  --weight-bold: 700; /* @kind other */

  /* ---- Display / heading tier: Barlow Condensed ---- */
  --display-xxl-size: 76px; /* @kind spacing */
  --display-xxl-line: 0.94; /* @kind other */
  --display-xxl-track: -1.5px; /* @kind other */

  --display-xl-size: 56px; /* @kind spacing */
  --display-xl-line: 1; /* @kind other */
  --display-xl-track: -1px; /* @kind other */

  --display-lg-size: 40px; /* @kind spacing */
  --display-lg-line: 1.05; /* @kind other */
  --display-lg-track: -0.6px; /* @kind other */

  --display-md-size: 30px; /* @kind spacing */
  --display-md-line: 1.1; /* @kind other */
  --display-md-track: -0.3px; /* @kind other */

  --heading-lg-size: 24px; /* @kind spacing */
  --heading-lg-line: 1.15; /* @kind other */
  --heading-lg-track: -0.2px; /* @kind other */

  --heading-md-size: 20px; /* @kind spacing */
  --heading-md-line: 1.2; /* @kind other */
  --heading-md-track: -0.1px; /* @kind other */

  --heading-sm-size: 18px; /* @kind spacing */
  --heading-sm-line: 1.25; /* @kind other */
  --heading-sm-track: 0; /* @kind other */

  /* ---- Body tier: Barlow ---- */
  --body-lg-size: 18px; /* @kind spacing */
  --body-lg-line: 1.55; /* @kind other */

  --body-md-size: 16px; /* @kind spacing */
  --body-md-line: 1.55; /* @kind other */

  --body-sm-size: 15px; /* @kind spacing */
  --body-sm-line: 1.5; /* @kind other */

  --body-tabular-size: 15px; /* @kind spacing */
  --body-tabular-line: 1.45; /* @kind other */
  --body-tabular-track: -0.2px; /* @kind other */

  /* ---- Controls & labels: Barlow Condensed, uppercase ---- */
  --button-md-size: 17px; /* @kind spacing */
  --button-md-track: 0.6px; /* @kind other */
  --button-sm-size: 15px; /* @kind spacing */
  --button-sm-track: 0.5px; /* @kind other */

  --eyebrow-size: 13px; /* @kind spacing */
  --eyebrow-track: 1.3px; /* @kind other */

  --caption-size: 14px; /* @kind spacing */
  --caption-line: 1.45; /* @kind other */

  --micro-size: 12px; /* @kind spacing */
  --micro-line: 1.45; /* @kind other */

  /* ---- Composite shorthands ---- */
  --type-display-xxl: var(--weight-bold) var(--display-xxl-size) / var(--display-xxl-line) var(--font-family-display);
  --type-display-xl: var(--weight-bold) var(--display-xl-size) / var(--display-xl-line) var(--font-family-display);
  --type-display-lg: var(--weight-semibold) var(--display-lg-size) / var(--display-lg-line) var(--font-family-display);
  --type-display-md: var(--weight-semibold) var(--display-md-size) / var(--display-md-line) var(--font-family-display);
  --type-heading-lg: var(--weight-semibold) var(--heading-lg-size) / var(--heading-lg-line) var(--font-family-display);
  --type-heading-md: var(--weight-semibold) var(--heading-md-size) / var(--heading-md-line) var(--font-family-display);
  --type-heading-sm: var(--weight-semibold) var(--heading-sm-size) / var(--heading-sm-line) var(--font-family-display);
  --type-body-lg: var(--weight-regular) var(--body-lg-size) / var(--body-lg-line) var(--font-family-body);
  --type-body-md: var(--weight-regular) var(--body-md-size) / var(--body-md-line) var(--font-family-body);
  --type-body-sm: var(--weight-regular) var(--body-sm-size) / var(--body-sm-line) var(--font-family-body);
  --type-body-tabular: var(--weight-medium) var(--body-tabular-size) / var(--body-tabular-line) var(--font-family-body);
  --type-button-md: var(--weight-semibold) var(--button-md-size) / 1 var(--font-family-display);
  --type-button-sm: var(--weight-semibold) var(--button-sm-size) / 1 var(--font-family-display);
  --type-eyebrow: var(--weight-semibold) var(--eyebrow-size) / 1.2 var(--font-family-display);
  --type-caption: var(--weight-regular) var(--caption-size) / var(--caption-line) var(--font-family-body);
  --type-micro: var(--weight-regular) var(--micro-size) / var(--micro-line) var(--font-family-body);
}


/* ===== spacing.css ===== */
:root {
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-huge: 64px;

  /* ---- Semantic aliases ---- */
  --section-padding-marketing: 96px;
  --section-padding-marketing-min: 64px;
  --section-padding-product: 48px;
  --section-padding-product-min: 32px;
  --section-gap: 96px;
  --section-gap-tight: 32px;

  --card-padding: var(--space-xxl);
  --card-padding-mockup: var(--space-xl);
  --button-padding: 10px 20px;
  --input-padding: 10px var(--space-md);
  --tag-padding: 4px 9px;
  --nav-padding: var(--space-lg) var(--space-xl);
  --footer-padding: var(--space-huge) var(--space-xl);

  --container-max: 1240px;
  --control-height: 42px;
  --control-height-touch: 44px;
}


/* ===== radius.css ===== */
:root {
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 9999px;

  /* ---- Semantic aliases ---- */
  --radius-button: var(--radius-sm);
  --radius-tag: var(--radius-xs);
  --radius-input: var(--radius-sm);
  --radius-card: var(--radius-md);
  --radius-card-feature: var(--radius-lg);
  --radius-mockup: var(--radius-lg);
  --radius-logo-tile: var(--radius-md);
}


/* ===== elevation.css ===== */
:root {
  /* Shadows are tinted with --navy, never neutral grey — the logo's own
     soft drop shadow is the reference. */
  --elevation-0: none;
  --elevation-1: rgba(0, 44, 93, 0.08) 0 1px 2px, rgba(0, 44, 93, 0.06) 0 2px 6px;
  --elevation-2: rgba(0, 44, 93, 0.1) 0 4px 16px, rgba(0, 44, 93, 0.06) 0 1px 3px;
  --elevation-3: rgba(0, 44, 93, 0.16) 0 18px 44px, rgba(0, 44, 93, 0.08) 0 4px 12px;

  --shadow-card: var(--elevation-1);
  --shadow-raised: var(--elevation-2);
  --shadow-panel: var(--elevation-3);
  --shadow-logo: drop-shadow(rgba(0, 44, 93, 0.28) 0 3px 6px);

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1); /* @kind other */
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1); /* @kind other */
  --duration-fast: 120ms; /* @kind other */
  --duration-base: 200ms; /* @kind other */
  --duration-slow: 340ms; /* @kind other */
  --transition-control: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}


/* ===== base.css ===== */
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font: var(--type-body-md);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
*,
*::before,
*::after { box-sizing: border-box; }
h1, h2, h3, h4 { font-family: var(--font-family-display); font-weight: var(--weight-semibold); margin: 0; }
a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

/* Numeric cells: tabular figures so columns align. */
[data-tabular] { font-feature-settings: var(--font-features-tabular); font-variant-numeric: tabular-nums; letter-spacing: var(--body-tabular-track); }

/* The uppercase condensed eyebrow — the brand's small-label voice. */
.ef-eyebrow { font: var(--type-eyebrow); letter-spacing: var(--eyebrow-track); text-transform: uppercase; color: var(--sky-deep); }

/* Brand gradient fields, taken from the logo's own vertical sky→navy ramp. */
.ef-brand-gradient { background: var(--gradient-brand); color: var(--on-brand); }
.ef-hero-gradient { background: var(--gradient-hero); color: var(--on-brand); }
.ef-accent-rule { height: 4px; background: var(--gradient-accent); border: 0; margin: 0; }

