/* ==========================================================================
   QueVault – quevault.org
   Nordisk industristil: marinblå, vitt, skiffergrått, smaragdgrön statusfärg.
   Inga externa ramverk eller typsnitt (systemtypsnitt – inga anrop till tredje part).
   ========================================================================== */

:root {
  --navy: #0F2942;
  --navy-700: #16365A;
  --navy-600: #1F4670;
  --white: #FFFFFF;
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --ink: #1E293B;
  --emerald: #10B981;
  --emerald-700: #047857;
  --emerald-50: #ECFDF5;
  --amber-50: #FFFBEB;
  --amber-700: #B45309;
  --violet-50: #F5F3FF;
  --violet-700: #6D28D9;
  --danger: #B91C1C;

  --font-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 41, 66, .06);
  --shadow-md: 0 8px 24px rgba(15, 41, 66, .08), 0 1px 3px rgba(15, 41, 66, .06);
  --shadow-lg: 0 24px 60px rgba(15, 41, 66, .16), 0 2px 6px rgba(15, 41, 66, .08);
  --container: 1180px;
  --header-h: 68px;
}

/* ---------- Bas ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--navy); line-height: 1.15; margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.35rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 1.25rem + 1.6vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--navy-600); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
code { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--slate-500); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--navy); color: var(--white); padding: 10px 16px; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600; transition: top .15s;
}
.skip-link:focus { top: 12px; color: var(--white); }

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1;
  border-radius: 8px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn-primary { background: var(--navy); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-700); color: var(--white); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--white); color: var(--navy); border-color: var(--slate-300); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .93rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Sidhuvud ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--slate-200); box-shadow: var(--shadow-sm); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.site-nav ul a {
  color: var(--slate-600); text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.site-nav ul a:hover, .site-nav ul a.is-active { color: var(--navy); border-bottom-color: var(--emerald); }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  border: 1px solid var(--slate-200); border-radius: 8px; background: var(--white); cursor: pointer;
  position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px; background: var(--navy);
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-toggle-bar { top: 50%; margin-top: -1px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Statusmarkering ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--emerald-50); color: var(--emerald-700);
  font-size: .85rem; font-weight: 600; border: 1px solid rgba(16, 185, 129, .25);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .status-dot { animation: pulse 2.4s ease-in-out infinite; }
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .22); } 50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, .06); } }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 8vw, 112px);
  background:
    linear-gradient(180deg, var(--slate-50) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--slate-200);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy h1 { margin-top: 20px; }
.lead { margin-top: 20px; font-size: clamp(1.05rem, 1rem + .3vw, 1.22rem); color: var(--slate-600); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--slate-600); font-size: .93rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts li::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: var(--emerald) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

/* ---------- Mockup ---------- */
.mockup { margin: 0; }
.mockup-window {
  background: var(--white); border: 1px solid var(--slate-200); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.mockup-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--navy); color: var(--white);
}
.mockup-dots { display: inline-flex; gap: 6px; }
.mockup-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.mockup-title { font-size: .82rem; color: rgba(255, 255, 255, .8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.badge-offline {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: rgba(16, 185, 129, .16); color: #A7F3D0; border: 1px solid rgba(16, 185, 129, .45);
}
.mockup-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--slate-200); background: var(--slate-50);
}
.segmented { display: inline-flex; padding: 3px; background: var(--slate-200); border-radius: 8px; }
.segmented button {
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--slate-600);
  border: 0; background: transparent; border-radius: 6px; padding: 8px 12px; min-height: 36px; cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.segmented button:hover { color: var(--navy); }
.segmented button.is-active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }
.mockup-meta { font-size: .8rem; color: var(--slate-500); }
.mockup-body { position: relative; min-height: 318px; }
.mockup-view { padding: 4px 0; overflow-x: auto; }
.mockup-view[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .mockup-view.is-entering { animation: viewIn .32s ease-out; }
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sheet, .offer { width: 100%; border-collapse: collapse; font-size: .84rem; }
.sheet th, .sheet td { border: 1px solid var(--slate-200); padding: 9px 10px; text-align: left; vertical-align: top; }
.sheet thead th { background: var(--slate-100); color: var(--slate-500); font-weight: 500; font-size: .75rem; text-align: center; }
.sheet .sheet-n { width: 34px; background: var(--slate-100); color: var(--slate-400); text-align: center; font-size: .75rem; }
.sheet .sheet-h { font-weight: 600; color: var(--slate-600); background: #FBFCFD; }
.sheet td { color: var(--ink); font-family: var(--font-mono); font-size: .8rem; }
.sheet tr > :first-child { border-left: 0; }
.sheet tr > :last-child { border-right: 0; }

.offer th, .offer td { padding: 10px 16px; border-bottom: 1px solid var(--slate-100); text-align: left; }
.offer th { font-size: .74rem; font-weight: 600; color: var(--slate-500); text-transform: none; }
.offer th.num, .offer td.num { text-align: right; }
.offer code { color: var(--navy); font-size: .8rem; white-space: nowrap; }
.offer tfoot td { border-bottom: 0; background: var(--slate-50); font-size: .84rem; color: var(--slate-600); }
.offer tfoot strong { color: var(--navy); font-size: .95rem; }
.offer-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.tag-ok { background: var(--emerald-50); color: var(--emerald-700); }
.tag-warn { background: var(--amber-50); color: var(--amber-700); }
.tag-special { background: var(--violet-50); color: var(--violet-700); }

.mockup figcaption { margin-top: 14px; font-size: .82rem; color: var(--slate-500); }

/* ---------- Sektioner ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-muted { background: var(--slate-50); border-top: 1px solid var(--slate-200); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.eyebrow { font-size: .85rem; font-weight: 650; color: var(--emerald-700); margin-bottom: 12px; }
.eyebrow-light { color: #6EE7B7; }
.section-lead { margin-top: 16px; font-size: 1.1rem; color: var(--slate-600); max-width: 44em; }

/* Kort */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--slate-300); }
.card h3 { margin-top: 20px; }
.card p { margin-top: 10px; color: var(--slate-600); font-size: .98rem; }
.card-icon {
  width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center;
  background: var(--navy); color: var(--white);
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.feature-list {
  margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--slate-200);
}
.feature { padding: 28px 32px 28px 0; border-bottom: 1px solid var(--slate-200); }
.feature:nth-child(even) { padding: 28px 0 28px 32px; border-left: 1px solid var(--slate-200); }
.feature p { margin-top: 8px; color: var(--slate-600); font-size: .98rem; }

/* Mörk säkerhetssektion */
.section-dark { background: var(--navy); color: #DCE6F2; }
.section-dark h2 { color: var(--white); }
.section-dark .section-lead { color: #B9C9DC; }
.security-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.security-points { margin: 36px 0 0; display: grid; gap: 22px; }
.security-points > div { padding-left: 22px; border-left: 2px solid rgba(16, 185, 129, .6); }
.security-points dt { color: var(--white); font-weight: 650; font-size: 1.05rem; }
.security-points dd { margin: 6px 0 0; color: #B9C9DC; font-size: .98rem; }

.dataflow { margin: 0; }
.dataflow svg { width: 100%; height: auto; }
.df-zone { fill: rgba(255, 255, 255, .04); stroke: rgba(16, 185, 129, .55); stroke-width: 1.5; stroke-dasharray: 6 5; }
.df-zone-label { fill: #6EE7B7; font: 600 13px var(--font-sans); }
.df-cloud path { fill: none; stroke: #6B829C; stroke-width: 1.5; }
.df-cloud-label { fill: #6B829C; font: 500 11px var(--font-sans); text-anchor: middle; }
.df-cut { stroke: #6B829C; stroke-width: 1.5; stroke-dasharray: 3 4; }
.df-x { stroke: #F87171; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.df-node rect { fill: var(--navy-700); stroke: rgba(255, 255, 255, .14); }
.df-node text { fill: var(--white); font: 500 14px var(--font-sans); }
.df-node .df-tag { fill: #6EE7B7; font-size: 12px; font-weight: 600; }
.df-node-out rect { fill: var(--emerald); stroke: none; }
.df-node-out text { fill: #052E21; font-weight: 650; }
.df-arrow { stroke: #6B829C; stroke-width: 1.5; fill: none; marker-end: none; }
.dataflow figcaption { margin-top: 12px; font-size: .85rem; color: #93A8C0; }

/* Steg */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: none; }
.step {
  position: relative; padding: 32px 28px 28px; border-radius: var(--radius);
  background: var(--slate-50); border: 1px solid var(--slate-200);
}
.step-no {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--navy); color: var(--navy); font-weight: 700;
}
.step h3 { margin-top: 18px; }
.step p { margin-top: 10px; color: var(--slate-600); font-size: .98rem; }

/* Kontakt */
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
.contact-direct { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--slate-200); }
.contact-direct h3 { font-size: 1rem; }
.contact-direct p { margin-top: 8px; }
.contact-direct .muted { font-size: .92rem; max-width: 30em; }

.contact-form {
  background: var(--white); border: 1px solid var(--slate-200); border-radius: 12px;
  padding: clamp(24px, 3vw, 36px); box-shadow: var(--shadow-md);
}
.field + .field { margin-top: 18px; }
.field label { display: block; font-weight: 600; font-size: .93rem; color: var(--navy); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 12px 14px; min-height: 48px;
  background: var(--white); border: 1px solid var(--slate-300); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 132px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--slate-400); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(31, 70, 112, .15); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(185, 28, 28, .1); }
.field-error { min-height: 0; margin-top: 6px; font-size: .86rem; color: var(--danger); }
.field-error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .btn-block { margin-top: 24px; }
.form-status { margin-top: 14px; font-size: .95rem; }
.form-status:empty { display: none; }
.form-status.is-success { color: var(--emerald-700); }
.form-status.is-error { color: var(--danger); }
.form-note { margin-top: 14px; font-size: .84rem; color: var(--slate-500); }

/* Sidfot */
.site-footer { background: var(--navy); color: #B9C9DC; padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; font-size: .92rem; }
.footer-inner .muted { color: #8DA3BC; margin-left: auto; }
.site-footer a { color: #DCE6F2; }
.brand-footer { color: var(--white); }
.brand-footer .brand-mark { outline: 1px solid rgba(255, 255, 255, .25); border-radius: 7px; }

/* ---------- Responsivt ---------- */
@media (max-width: 1024px) {
  .hero-grid, .security-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .cards, .steps { grid-template-columns: minmax(0, 1fr); }
  .dataflow { max-width: 480px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px 24px 24px; background: var(--white);
    border-bottom: 1px solid var(--slate-200); box-shadow: var(--shadow-md);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 12px 0; border-bottom: 1px solid var(--slate-100); }
  .site-nav ul a:hover, .site-nav ul a.is-active { border-bottom-color: var(--slate-100); }
  .site-nav .btn { width: 100%; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .feature-list { grid-template-columns: minmax(0, 1fr); }
  .feature, .feature:nth-child(even) { padding: 24px 0; border-left: 0; }
  .mockup-title { display: none; }
  .mockup-body { min-height: 0; }
  .sheet td:nth-child(2), .sheet th:nth-child(2) { display: none; }
  .offer th, .offer td { padding: 9px 10px; }
  .footer-inner .muted { margin-left: 0; }
}

@media (max-width: 520px) {
  .offer th, .offer td { padding: 9px 8px; }
  .offer .col-qty { display: none; }
  .offer code { font-size: .7rem; }
  .tag { font-size: .7rem; padding: 2px 7px; }
}

@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .hero-actions .btn { width: 100%; }
  .segmented button { padding: 8px 9px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .nav-toggle, .contact-form, .skip-link { display: none !important; }
  .section-dark, .site-footer { background: var(--white); color: var(--ink); }
}
