/* Grunnleggende stil for Samvirkeforbundet demo */
:root {
  /* Ny fargepalett */
  --primary-dark: #0C263D;
  /* dyp blå / base */
  --primary: #286DA4;
  /* hoved blå */
  --primary-accent: #96B647;
  /* grønn aksent */
  --accent: #96B647;
  --bg: #f5f7f9;
  --text: #1b2228;
  --muted: #5a646c;
  --warning: #c75100;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: #ffffff;
  color: var(--primary-dark);
  padding: 0.65rem 1.25rem .7rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 4px -2px rgba(0, 0, 0, .18);
  border-top: 6px solid var(--primary-accent);
}

header img {
  height: 54px;
  width: auto;
  display: block;
  padding: 4px;
  background: #fff;
  border: 1px solid #e1e6ea;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
}

header h1 {
  font-size: 1.5rem;
  margin: 0 0 .15rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--primary-dark);
}

header .brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.tagline {
  margin: 0;
  font-size: .7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  opacity: .9;
}

nav {
  margin-left: auto;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

nav a {
  color: var(--primary-dark);
  text-decoration: none;
  padding: .55rem .85rem;
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius);
  background: transparent;
  transition: .2s;
}

nav a:hover,
nav a:focus {
  background: #f0f5f8;
  color: var(--primary-dark);
}

nav a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

main {
  width: min(1180px, 100% - 2.5rem);
  margin: 1.5rem auto 4.5rem;
  flex: 1;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.cards-3 {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  background: #fff;
  padding: 1rem 1rem 1.1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .08), 0 8px 24px -6px rgba(0, 0, 0, .08);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.card h3 {
  margin: .25rem 0 .35rem;
  font-size: 1.05rem;
}

.card time {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: .87rem;
}

.card a.more {
  margin-top: auto;
  align-self: flex-start;
  font-size: .75rem;
  letter-spacing: .5px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 6px;
  text-decoration: none;
}

.card a.more:hover {
  background: var(--primary-accent);
}

h2.section-title {
  font-size: 1.35rem;
  margin: 0 0 .75rem;
  letter-spacing: .5px;
  font-weight: 600;
  color: var(--primary-dark);
}

.lead {
  font-size: 1rem;
  max-width: 70ch;
  color: var(--muted);
}

.table-wrapper {
  overflow-x: auto;
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .08);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.table-wrapper th,
.table-wrapper td {
  padding: .55rem .6rem;
  text-align: left;
  border-bottom: 1px solid #e2e7e5;
}

.table-wrapper th {
  background: #f0f4f3;
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #2d3936;
}

.table-wrapper tbody tr:hover {
  background: #f8faf9;
}

form {
  background: #fff;
  padding: 1.25rem 1.25rem 1.6rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .08), 0 4px 16px -4px rgba(0, 0, 0, .08);
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

form fieldset {
  border: 1px solid #d4dddb;
  padding: 1rem 1rem 1.25rem;
  border-radius: var(--radius);
}

form fieldset legend {
  padding: 0 .5rem;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--primary);
}

label {
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #2d3936;
  display: block;
  margin-bottom: .35rem;
}

input[type=text],
input[type=email],
input[type=number],
select,
textarea {
  width: 100%;
  padding: .65rem .7rem;
  border: 1px solid #c9d3d1;
  border-radius: 6px;
  font: inherit;
  background: #fbfdfc;
  transition: .15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-accent);
  outline-offset: 1px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.split {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

button,
.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .75rem 1.1rem;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .2);
}

button:hover,
.btn:hover {
  background: var(--primary-accent);
}

button.secondary {
  background: #2d3936;
}

button.secondary:hover {
  background: #445451;
}

.alert {
  background: #fff7eb;
  border: 1px solid #f3d9b6;
  padding: .85rem 1rem;
  border-radius: 6px;
  color: #5c3b09;
  font-size: .85rem;
  line-height: 1.35;
}

.badge {
  display: inline-block;
  background: var(--primary-dark);
  color: #fff;
  font-size: .65rem;
  padding: .3rem .5rem;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
  align-items: center;
}

.filter-bar select {
  max-width: 220px;
}

footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-dark);
  color: #e4eef5;
  padding: .9rem 1.25rem;
  font-size: .7rem;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  box-shadow: 0 -2px 8px -2px rgba(0, 0, 0, .4);
}

footer strong {
  color: #fff;
}

footer a {
  color: var(--primary-accent);
  font-weight: 600;
}

footer a:hover {
  text-decoration: none;
}

.notice-demo {
  font-size: .75rem;
  max-width: 960px;
}

.banner-inline {
  background: #fff;
  border-left: 4px solid var(--primary);
  padding: .75rem .9rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-size: .8rem;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .06);
}

.search-input {
  position: relative;
}

.search-input input {
  padding-left: 2rem;
}

.search-input svg {
  position: absolute;
  left: .6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #5a6466;
}

.stats-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}

.stats-highlight .stat {
  background: #fff;
  padding: .9rem .95rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .08);
}

.stats-highlight .stat h4 {
  margin: 0 0 .2rem;
  font-size: .75rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}

.stats-highlight .stat p {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--primary);
}

.page-hero {
  padding: 2.5rem 1rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.page-hero .lead {
  font-size: 1.15rem;
  color: #0C263D;
  max-width: 60ch;
}

.value-grid {
  display: grid;
  gap: 2rem;
  max-width: 1100px;
  margin: 2rem auto;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  padding-left: 1.4rem;
  position: relative;
  margin: .4rem 0;
}

.check-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #96B647;
  font-weight: 600;
}

.pricing {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.pricing th,
.pricing td {
  border: 1px solid #e2e6ea;
  padding: .55rem .6rem;
  text-align: left;
}

.cards {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1rem 0;
}

.cards article {
  background: #fff;
  border: 1px solid #dfe3e7;
  padding: 1rem;
  border-radius: 6px;
}

.steps {
  counter-reset: steg;
  list-style: none;
  padding: 0;
  display: grid;
  gap: .6rem;
}

.steps li {
  background: #fff;
  border: 1px solid #d9dde1;
  padding: .75rem .9rem;
  border-radius: 4px;
  position: relative;
}

.steps li:before {
  counter-increment: steg;
  content: counter(steg);
  background: #286DA4;
  color: #fff;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  border-radius: 50%;
  margin-right: .5rem;
}

blockquote {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  background: #f5f7f8;
  border-left: 4px solid #96B647;
  font-style: italic;
}

blockquote cite {
  display: block;
  font-style: normal;
  margin-top: .4rem;
  font-size: .85rem;
  color: #0C263D;
}

.cta-sticky {
  position: relative;
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;
  background: #0C263D;
  color: #fff;
  border-radius: 8px;
}

.cta-sticky .btn.accent {
  background: #96B647;
  color: #0C263D;
}

.panel {
  background: #fff;
  padding: 1rem 1.2rem;
  border: 1px solid #d9dde1;
  border-radius: 6px;
  max-width: 860px;
}

.panel .grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

.meta {
  font-size: .75rem;
  color: #555;
  margin-top: .6rem;
}

.demo-flag {
  background: #FFF9D6;
  padding: .9rem 1rem;
  border: 1px solid #E6DC99;
  border-radius: 4px;
  margin: 2rem 0;
}

/* Arrangementer layout */
.two-col {
  display: grid;
  align-items: start;
  gap: 2rem;
  grid-template-columns: 1fr 380px;
}

.registration {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.events-grid {
  display: grid;
  gap: 1.4rem;
}

.event {
  background: #fff;
  border: 1px solid #dfe3e7;
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .08);
}

.event header h3 {
  margin: .2rem 0 .4rem;
  font-size: 1.1rem;
}

.event-meta {
  margin: 0 0 .6rem;
  font-size: .75rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.bullets {
  list-style: none;
  padding: 0;
  margin: .6rem 0 .8rem;
  display: grid;
  gap: .35rem;
}

.bullets li {
  padding-left: 1.2rem;
  position: relative;
  font-size: .85rem;
  color: var(--muted);
}

.bullets li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-accent);
  font-weight: 600;
}

.btn.small {
  font-size: .7rem;
  padding: .55rem .75rem;
  box-shadow: none;
}

@media (max-width:1000px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .registration {
    position: static;
    order: -1;
  }
}

/* Page-specific override: make hero full width on arrangementer */
body.page-arrangementer .page-hero {
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Modal (arrangementer) */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4vh 1rem 6vh;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 38, 61, .6);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 660px;
  padding: 1.4rem 1.6rem 1.9rem;
  border-radius: 10px;
  box-shadow: 0 10px 40px -8px rgba(0, 0, 0, .35), 0 2px 8px -2px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: modalIn .35s cubic-bezier(.33, .9, .38, 1.08);
}

.modal-close {
  position: absolute;
  top: .4rem;
  right: .5rem;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--primary-dark);
  padding: .25rem .4rem;
  border-radius: 6px;
}

.modal-close:hover {
  background: #f0f5f8;
}

.modal-body {
  min-height: 120px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn.small[data-event-btn] {
  position: relative;
}

@media (max-width:720px) {
  header {
    flex-wrap: wrap;
  }

  nav {
    width: 100%;
  }

  nav ul {
    justify-content: flex-start;
  }

  main {
    margin: 1.25rem auto 5.5rem;
  }

  footer {
    font-size: .65rem;
  }
}

.panel.no-pad {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  max-width: 100%;
}

/* Hvis du heller vil fjerne wrapper helt kan du fjerne class="panel no-pad" i index.html */

/* -------------------------------------------------------------
   Main Tabs (My Page Dashboard)
   ------------------------------------------------------------- */
.main-tabs-container {
  margin-top: 1.5rem;
}

.main-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e7e5;
  margin-bottom: 1.5rem;
}

.main-tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
  text-transform: none;
  margin-bottom: -2px;
}

.main-tab-btn:hover {
  background: #f5f7f9;
  color: var(--primary);
}

.main-tab-btn.active {
  background: transparent;
  color: var(--primary);
  border-bottom-color: var(--primary-accent);
}

.main-tab-content {
  display: none;
}

.main-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sub-tabs (within Mentor tab) */
.tabs-container {
  margin-top: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e7e5;
  margin-bottom: 1.25rem;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
  text-transform: none;
  margin-bottom: -2px;
}

.tab-btn:hover {
  background: #f5f7f9;
  color: var(--primary);
}

.tab-btn.active {
  background: transparent;
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Dashboard styling */
.dashboard-section {
  margin-bottom: 2rem;
}

.subsection-title {
  font-size: 1.25rem;
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.section-intro {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.6;
}

.form-heading {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.form-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Insurance layout - two columns */
.insurance-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
  align-items: start;
}

/* Insurance cards column - vertical stack */
.insurance-cards-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insurance-card {
  background: #fff;
  border: 1px solid #e2e7e5;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
}

.insurance-card:hover {
  border-color: var(--primary-accent);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.12);
}

.insurance-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--primary-dark);
}

.insurance-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Insurance form column */
.insurance-form-column {
  display: flex;
  flex-direction: column;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 768px) {
  .insurance-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* -------------------------------------------------------------
   ia-dialogue webcomponent design token overrides
   These map the component's customizable CSS variables to the
   existing Samvirkeforbundet palette & typographic scale.
   ------------------------------------------------------------- */
ia-dialogue,
ia-dialogue * {
  /* ensure variables inherit inside shadow parts */
  /* Brand / core */
  --ia-primary-color: var(--primary);
  /* link + accent */
  --ia-font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Errors / validation (reuse existing alert palette) */
  --ia-error-color: #a23400;
  /* slightly darker than warning for contrast */
  --ia-error-message-color: #5c3b09;
  --ia-error-message-background-color: #fff7eb;
  --ia-error-message-border: 1px solid #f3d9b6;
  --ia-error-message-padding: .7rem .8rem .75rem;
  --ia-error-message-margin: .65rem 0 .85rem;
  --ia-error-field-border: 2px solid #c75100;

  /* Headings inside dialogue (approximate page scale) */
  --ia-heading1-font-size: 1.5rem;
  --ia-heading2-font-size: 1.2rem;
  --ia-heading3-font-size: 1.05rem;
  --ia-heading4-font-size: .9rem;

  /* Fields */
  --ia-field-border: 1px solid #c9d3d1;
  --ia-field-label-font-weight: 600;
  --ia-field-label-font-color: #2d3936;
  --ia-field-background-color: #fbfdfc;
  --ia-field-background-color-focus: #ffffff;

  /* Presentation / help blocks */
  --ia-presentation-background-color: #f0f5f8;
  --ia-presentation-padding: .9rem 1rem 1rem;
  --ia-help-text-background-color: #f0f5f8;
  --ia-help-text-font-size: .75rem;
  --ia-help-text-margin: .5rem 0 .75rem;
  --ia-help-text-padding: .55rem .65rem .6rem;
  --ia-help-text-border: 1px solid #d9dde1;

  /* Choice controls */
  --ia-radio-button-size: 18px;
  --ia-radio-button-label-gap: .5rem;
  --ia-checkbox-size: 18px;

  /* Summary view */
  --ia-summary-value-text-align: left;
  --ia-summary-checkbox-value-justify-content: flex-start;
  --ia-summary-value-font-weight: 600;

  /* Attachments */
  --ia-attachment-module-border: 1px dashed #c9d3d1;
}