/* Aðgengisvakt – stílar. Hönnun: róleg, stofnanaleg, háir litaskil.
   Allir litir prófaðir fyrir ≥ 4,5:1 (texti) og ≥ 3:1 (rammar/fókus). */

:root {
  color-scheme: light dark;
  --bg: #f7f7f4;
  --bg-alt: #ecece7;
  --surface: #ffffff;
  --text: #1b2230;
  --muted: #4a5468;
  --brand: #0b4f8a;      /* 7,5:1 á --bg */
  --brand-text: #ffffff;
  --border: #b9bfc9;
  --focus: #b3261e;      /* 5,9:1 á --bg */
  --ok: #1d6b3a;
  --warn: #8a4b00;
  --err: #b3261e;
  --max: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --bg-alt: #1a1e27;
    --surface: #1f242f;
    --text: #e9ebef;
    --muted: #b8bfcc;
    --brand: #9cc8f2;    /* 10:1 á --bg */
    --brand-text: #0c1a2a;
    --border: #4d5565;
    --focus: #ffd166;
    --ok: #7fd49a;
    --warn: #f2b86b;
    --err: #ff9b8f;
  }
}

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

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}

/* Hoppa yfir í efni */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -100%;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--brand);
  color: var(--brand-text);
  text-decoration: underline;
  border-radius: 0.25rem;
}
.skip-link:focus { top: 0.5rem; }

a { color: var(--brand); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 0.15em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); margin-top: 0; }
h3 { font-size: 1.2rem; }
p, ul, ol, dl, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: 0.35rem; }
small, .small { font-size: 0.9rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; max-width: 60ch; }
.measure { max-width: 68ch; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Haus */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 0.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
}
.brand svg { width: 1.75rem; height: 1.75rem; flex: none; }
.brand:hover { text-decoration: underline; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
}
.site-nav li { margin: 0; }
.site-nav a { display: inline-block; padding: 0.35rem 0; color: var(--text); }
.site-nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 0.15em; }

main { flex: 1; }
section, .section { padding-block: clamp(2rem, 6vw, 4rem); }
.section-alt { background: var(--bg-alt); }
.section-tight { padding-block: clamp(1.25rem, 3vw, 2rem); }

/* Hnappar */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--brand);
  border-radius: 0.375rem;
  background: var(--brand);
  color: var(--brand-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover { text-decoration: underline; }
.btn-secondary { background: transparent; color: var(--brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 8vw, 5rem); }
.hero .eyebrow {
  display: inline-block;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* Frestur */
.deadline {
  border: 2px solid var(--brand);
  border-radius: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
}
.deadline p:last-child, .deadline ul:last-child { margin-bottom: 0; }
.deadline .big { font-size: clamp(1.4rem, 1rem + 2vw, 2rem); font-weight: 700; margin: 0 0 0.5rem; }

/* Spjöld */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}
.card h3 { margin-top: 0; }
.card .price { font-size: 1.35rem; font-weight: 700; margin: 0.25rem 0 0.75rem; }
.card .price small { font-weight: 400; color: var(--muted); }
.card ul { flex: 1; }
.card .btn { align-self: flex-start; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1.25rem; margin: 0; }
.steps li::before {
  content: counter(step);
  display: inline-block;
  width: 2rem; height: 2rem; line-height: 2rem;
  text-align: center;
  border-radius: 50%;
  background: var(--brand); color: var(--brand-text);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.steps h3 { font-size: 1.1rem; }

.checks { list-style: none; padding: 0; }
.checks li { padding-left: 1.75rem; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* Eyðublað */
form { max-width: 40rem; }
.field { margin-bottom: 1.25rem; }
label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.hint { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], input[type="url"], textarea, select {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.375rem;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
}
input:focus-visible, textarea:focus-visible { border-color: var(--brand); }
input[aria-invalid="true"] { border-color: var(--err); }
.error { color: var(--err); font-weight: 700; margin-top: 0.35rem; }
.error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 1rem; padding: 1rem; border-radius: 0.375rem; border: 2px solid var(--border); background: var(--surface); }
.form-status:empty { display: none; }
.form-status.ok { border-color: var(--ok); }
.form-status.err { border-color: var(--err); }

/* Töflur */
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 700; margin-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-alt); }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }

/* Merkingar */
.tag { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 0.25rem; border: 1px solid currentColor; font-size: 0.85rem; font-weight: 700; }
.tag-high { color: var(--err); }
.tag-mid { color: var(--warn); }
.tag-low { color: var(--ok); }
.notice {
  border-left: 4px solid var(--brand);
  background: var(--surface);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.notice p:last-child { margin-bottom: 0; }

.score {
  display: inline-block;
  border: 3px solid var(--brand);
  border-radius: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.score strong { font-size: 2rem; display: block; line-height: 1; }

/* Algengar spurningar */
.faq h3 { margin-top: 1.75rem; }
.faq h3:first-of-type { margin-top: 0; }

/* Fótur */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 2rem;
  font-size: 0.95rem;
}
.site-footer .cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.site-footer p:last-child { margin-bottom: 0; }

dl.def dt { font-weight: 700; margin-top: 0.75rem; }
dl.def dd { margin: 0.15rem 0 0; }

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

@media print {
  .site-header, .site-footer, .skip-link, .btn-row { display: none; }
  body { background: #fff; color: #000; }
}

.notice-top { margin-top: 1.5rem; }
.meta { color: var(--muted); font-size: 0.95rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; margin-bottom: 1.25rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95em; background: var(--bg-alt); padding: 0.05em 0.3em; border-radius: 0.2em; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
