/* Design: Fjord — cool Nordic teal, soft geometry, calm data product */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
  --color-bg: #e4eef2;
  --color-bg-end: #d5e6ec;
  --color-surface: #ffffff;
  --color-text: #14323f;
  --color-text-muted: #5a7380;
  --color-text-light: #7a929e;
  --color-primary: #0d7a8c;
  --color-primary-dark: #0a5f6d;
  --color-header: #0b4a56;
  --color-header-end: #0d7a8c;
  --color-accent: #1b6b4a;
  --color-accent-bg: #e6f4ee;
  --color-role-bg: #e8f4f7;
  --color-exact: #0d7a8c;
  --color-exact-bg: #e8f4f7;
  --color-exact-border: #0d7a8c;
  --color-role: #0d7a8c;
  --color-role-border: #0d7a8c;
  --color-school: #b33a2e;
  --color-school-bg: #fdedec;
  --color-error: #b33a2e;
  --color-error-bg: #fdecea;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 10px rgba(11, 74, 86, 0.06);
  --shadow-md: 0 8px 28px rgba(11, 74, 86, 0.1);
  --shadow-lg: 0 18px 48px rgba(11, 74, 86, 0.14);
  --font: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(13, 122, 140, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(27, 107, 74, 0.1), transparent 50%),
    linear-gradient(165deg, var(--color-bg) 0%, #f2f7f9 40%, var(--color-bg-end) 100%);
  background-attachment: fixed;
}

/* Sticky header: same page color so content can’t scroll through */
.lp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: none;
}

.lp-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  gap: 16px;
}

.lp-brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-header);
  justify-self: start;
  line-height: 1;
}

.lp-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 22px;
  flex-wrap: wrap;
  justify-self: center;
}

.lp-nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lp-nav a.ghost {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.lp-nav a.ghost:hover {
  color: var(--color-header);
}

.lp-nav a.ghost.is-active {
  color: var(--color-header);
  border-bottom-color: var(--color-primary);
}

.lp-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  line-height: 1;
}

.lp-cta-btn:hover {
  background: var(--color-primary-dark);
}

@media (max-width: 720px) {
  .lp-nav {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .lp-brand,
  .lp-nav-links,
  .lp-nav-actions {
    justify-self: center;
  }
}

/* Hide legacy solid header if present */
.site-header { display: none !important; }

/* Hub pages with sticky header above centered content */
body:has(.hub-shell) {
  display: block;
}
body:has(.hub-shell) .hub-shell {
  min-height: calc(100vh - 72px);
}

.page-hero h1,
.school-name,
.kommun-name,
.role-name {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.page-hero {
  text-align: left;
}

/* Match job pages content width (nav is already 1200px) */
.page {
  max-width: 1200px;
}

/* Back navigation — calm text link, not legacy blue chip */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 0;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.back-link:hover {
  color: var(--color-primary);
  transform: translateX(-2px);
  box-shadow: none;
  text-decoration: none;
}

.breadcrumb-nav {
  margin-bottom: 20px;
}

.job-pages .page-hero,
body:has(.jobs-container) .page-hero {
  text-align: left;
}

.stat-card,
.panel,
.job-card,
.kommun-card,
.roll-card,
.data-table-container,
.chart-container,
.entity-header,
.school-header,
.kommun-header,
.role-header {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(13, 122, 140, 0.1);
}

.stat-value {
  color: var(--color-primary);
}

th {
  background: linear-gradient(135deg, var(--color-header), var(--color-header-end));
}

button,
#refreshBtn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 6px 18px rgba(13, 122, 140, 0.28);
  border-radius: var(--radius-sm);
}

.kommun-card::before,
.roll-card::before {
  background: linear-gradient(90deg, var(--color-primary), #1b6b4a);
}

/* Match landing teal on salary badges / exact-match UI */
.salary-section.exact-match,
.hero-badge .salary-section {
  background: linear-gradient(135deg, #0d7a8c 0%, #0b4a56 55%, #0a5f6d 100%) !important;
  box-shadow: 0 8px 32px rgba(13, 122, 140, 0.35) !important;
}

.salary-section.role-specific {
  background: linear-gradient(135deg, #0d7a8c 0%, #0a5f6d 50%, #0b4a56 100%) !important;
  box-shadow: 0 8px 32px rgba(13, 122, 140, 0.3) !important;
}

.salary-indicator.exact-match,
.job-card.match-exact {
  border-color: rgba(13, 122, 140, 0.35);
}

.salary-indicator.exact-match .salary-badge-small,
.stat-card.highlight .stat-value {
  color: var(--color-primary);
}

.stat-card.highlight {
  border-color: rgba(13, 122, 140, 0.25);
  background: linear-gradient(180deg, #fff 0%, var(--color-exact-bg) 100%);
}

/* Auth */
.auth-shell {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(13, 122, 140, 0.18), transparent 60%),
    linear-gradient(160deg, #e4eef2, #d5e6ec);
  font-family: var(--font);
  color: var(--color-text);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(13, 122, 140, 0.12);
  box-sizing: border-box;
}
.auth-card h1 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.75rem;
}
.auth-card .subtitle { color: var(--color-text-muted); margin: 0 0 24px; line-height: 1.5; }
.auth-card label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.auth-card input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  margin: 0 0 16px;
  border: 1.5px solid #c9d8de;
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--color-text);
  background: #fff;
  box-sizing: border-box;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 122, 140, 0.15);
}
.auth-card button[type="submit"] {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 48px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-sizing: border-box;
}
.auth-card button[type="submit"]:hover { background: var(--color-primary-dark); }
.auth-card .error, .auth-card .success {
  display: none; margin-bottom: 16px; padding: 12px; border-radius: 10px; font-size: 0.9rem;
}
.auth-card .error { background: var(--color-error-bg); color: var(--color-error); }
.auth-card .success { background: var(--color-accent-bg); color: var(--color-accent); }
.auth-card .error.visible, .auth-card .success.visible { display: block; }
.auth-card .note, .auth-card .switch-auth {
  margin-top: 18px; font-size: 0.85rem; color: var(--color-text-light); text-align: center;
}
.auth-card .switch-auth a { color: var(--color-primary); font-weight: 700; text-decoration: none; }
.auth-card .beta-badge {
  display: inline-block; margin-bottom: 12px; padding: 4px 10px;
  background: var(--color-accent-bg); color: var(--color-accent);
  border-radius: 8px; font-size: 0.75rem; font-weight: 700;
}
.auth-card #registerForm[hidden] { display: none; }

/* Hub */
.hub-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  font-family: var(--font);
  color: var(--color-text);
  background:
    radial-gradient(1000px 500px at 80% 0%, rgba(13, 122, 140, 0.14), transparent 55%),
    linear-gradient(165deg, #e4eef2, #d5e6ec);
}
.hub {
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.hub h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin: 0 0 10px;
}
.hub .subtitle { color: var(--color-text-muted); margin: 0 0 32px; line-height: 1.55; }
.hub-nav { display: grid; gap: 14px; }
.hub-link {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1.5px solid rgba(13, 122, 140, 0.12);
  border-radius: 16px; padding: 22px 24px; text-align: left;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.hub-link:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
.hub-link strong { display: block; font-size: 1.1rem; color: var(--color-primary); margin-bottom: 4px; }
.hub-link span { color: var(--color-text-muted); font-size: 0.92rem; }
.hub .logout-btn {
  margin-top: 24px; background: none; border: none; color: var(--color-text-light);
  text-decoration: underline; cursor: pointer; font: inherit;
}
