:root {
  --blue: #2162e7;
  --blue-2: #2471ee;
  --blue-light: #85bffd;
  --navy: #101a32;
  --tint: #eaf1fe;
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --border: #e3e8f3;
  --muted: #5d6882;
  --danger: #d6293e;
  --radius: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 26, 50, 0.05);
  --shadow-md: 0 14px 36px rgba(16, 26, 50, 0.1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--navy);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.container { width: min(1120px, 100% - 3rem); margin-inline: auto; }

/* Logo (SVG fra /assets) */
.logo { display: inline-block; line-height: 0; }
.logo img { height: 30px; width: auto; display: block; }
.footer .logo img { height: 24px; }
.auth-card .logo img { height: 34px; margin: 0 auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.35rem; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1b56d1; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { background: #e9eef8; }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Kort og gitre (dashboard) */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(16, 26, 50, 0.08); }
.card p { color: var(--muted); margin: 0; }

/* Auth + onboarding pages */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 2.2rem 1rem;
  background: var(--bg-soft); position: relative; isolation: isolate;
}
.auth-page::before { content: ''; position: fixed; inset: 10px; border-radius: 32px; background: var(--navy); z-index: -1; }
@media (max-width: 560px) { .auth-page::before { inset: 6px; border-radius: 24px; } }
.auth-card {
  width: min(440px, 100%); background: #fff;
  border-radius: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); padding: 2.2rem;
  animation: rise 0.5s var(--ease);
}
.auth-card.wide { width: min(640px, 100%); }
.auth-card .logo { display: block; text-align: center; margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.7rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 1.6rem; }
.auth-foot { text-align: center; color: var(--muted); margin: 1.4rem 0 0; font-size: 0.95rem; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Forms */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.field label small { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 0.75rem 0.9rem; font: inherit; color: var(--navy);
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(33, 98, 231, 0.14); }
.field .err { color: var(--danger); font-size: 0.85rem; margin-top: 0.3rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.alert { padding: 0.8rem 1rem; border-radius: 10px; font-size: 0.92rem; margin-bottom: 1.1rem; }
.alert-error { background: #fdecef; color: #9d1c2d; border: 1px solid #f7c6ce; }
.alert-warn { background: #fff7e6; color: #7a5200; border: 1px solid #f5dfae; }
.alert-ok { background: #e8f7ee; color: #14663a; border: 1px solid #bde5cd; }

/* Dashboard */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: var(--bg-soft); }
.sidebar {
  background: #fff; color: var(--muted); padding: 1.4rem 1rem; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { padding: 0 0.6rem; }
.side-panel { display: flex; flex-direction: column; gap: 1.5rem; flex: 1; min-height: 0; }
.nav-toggle { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem; border-radius: 10px;
  color: inherit; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
  transition: background 0.2s, color 0.2s;
}
.side-nav a:hover, .side-nav button:hover { background: #eef2fa; color: var(--navy); }
.side-nav a.active { background: var(--tint); color: var(--blue); font-weight: 600; }
.side-nav svg { width: 18px; height: 18px; flex: none; }
.side-nav .soon { margin-left: auto; font-size: 0.68rem; padding: 0.1rem 0.45rem; border-radius: 99px; background: var(--bg-soft); }
.main { padding: clamp(1.2rem, 3vw, 2.5rem); min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.topbar h1 { font-size: 1.8rem; margin: 0; }
.topbar p { margin: 0; color: var(--muted); }
.user-chip { color: var(--muted); font-size: 0.9rem; }
.biz-card { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.biz-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: var(--tint); flex: none; }
.biz-meta { color: var(--muted); font-size: 0.92rem; }
.biz-meta span { margin-right: 1rem; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 99px; background: var(--bg-soft); color: var(--muted); margin-left: 0.5rem; vertical-align: middle; }

.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  /* Mobil: kompakt topbjælke (logo + menuknap) med en dropdown-menu under */
  .sidebar { position: sticky; top: 0; z-index: 40; height: auto; border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; align-items: center; justify-content: space-between; padding: 0.6rem 1rem; gap: 0.8rem; }
  .sidebar .logo { padding: 0; }
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
  .nav-toggle:hover { background: #eef2fa; }
  .nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--navy); transition: transform 0.25s var(--ease), opacity 0.2s; }
  .sidebar.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .sidebar.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .sidebar.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .side-panel { display: none; position: absolute; left: 0; right: 0; top: 100%; flex: none; gap: 0.8rem; max-height: calc(100vh - 70px); overflow-y: auto; padding: 0.6rem 1rem 1rem; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 24px 40px rgba(16, 26, 50, 0.12); }
  .sidebar.open .side-panel { display: flex; animation: panel-in 0.2s var(--ease); }
  .side-nav { flex: none; }
  .side-nav a, .side-nav button { min-height: 46px; }
}
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 640px) { .nav-links a.link { display: none; } }

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

/* Onboarding og branchevalg */
.steps { display: flex; justify-content: center; gap: 0.5rem; margin: 0 0 1.4rem; }
.steps span { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.steps span b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e9eef8; color: var(--muted); font-size: 0.8rem; transition: all 0.25s; }
.steps span.active { color: var(--navy); }
.steps span.active b, .steps span.done b { background: var(--blue); color: #fff; }
.steps i { width: 36px; height: 2px; background: var(--border); align-self: center; border-radius: 2px; }
.step[hidden] { display: none; }
.step { animation: stepin 0.3s ease both; }
@keyframes stepin { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.step-actions { display: flex; gap: 0.7rem; margin-top: 0.6rem; }
.step-actions .btn-primary { flex: 1; }
.chip-group { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.1rem; }
.chip-opt { font: inherit; font-weight: 600; font-size: 0.92rem; color: var(--navy); background: #fff; border: 2px solid var(--border); border-radius: 99px; padding: 0.5rem 1rem; cursor: pointer; transition: all 0.18s; }
.chip-opt:hover { border-color: var(--blue-light); background: #f8fbff; }
.chip-opt.selected { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(33, 98, 231, 0.25); }
.industry-other { margin-top: 0.7rem; }
.field-hint { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.82rem; }
