/* Assento designsystem: farver, skrift og firkantede blokke. */
@font-face {
  font-family: 'Tobias';
  src: url('../assets/fonts/Tobias-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Variable';
  src: url('../assets/fonts/InterVariable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --assento-blue: #1d4555;
  --assento-blue-70: #4f6c7d;
  --blue-grey: #a1b4bf;
  --assento-blue-30: #cbd3db;
  --assento-blue-10: #e4e9ed;
  --sand: #ebe6dc;
  --white: #ffffff;
  --black: #000000;
  --peach: #fac294;
  --bordeaux: #4b333e;

  --font-display: 'Tobias', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter Variable', 'Inter', Arial, system-ui, sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 32px;
  --space-4: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  color: var(--assento-blue);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; }
h1 { font-size: 40px; line-height: 46px; }
h2 { font-size: 32px; line-height: 38px; }
h3 { font-size: 22px; line-height: 28px; }
p { margin: 0 0 var(--space-2); }
a { color: inherit; }

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

/* ---- Knapper (firkantede, ingen afrunding) ---- */
.knap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid var(--assento-blue);
  border-radius: 0;
  background: var(--assento-blue);
  color: var(--white);
  font: 600 16px/20px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}
.knap:hover { background: #163745; }
.knap--accent { background: var(--peach); border-color: var(--peach); color: var(--assento-blue); }
.knap--accent:hover { background: #f5b27c; }
.knap--sekundaer { background: transparent; color: var(--assento-blue); }
.knap--sekundaer:hover { background: var(--assento-blue-10); }
.knap--fare { background: transparent; color: var(--bordeaux); border-color: var(--bordeaux); }
.knap--fare:hover { background: #f1ebee; }
.knap[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---- Formularfelter ---- */
.felt { display: grid; gap: var(--space-1); margin-bottom: var(--space-2); }
.felt label { font-weight: 600; }
.felt .hjaelp { font-size: 14px; line-height: 20px; color: var(--assento-blue-70); }
input[type='text'], input[type='password'], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--assento-blue-70);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: 16px/22px var(--font-sans);
}
textarea { min-height: 120px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--assento-blue) 50%), linear-gradient(135deg, var(--assento-blue) 50%, transparent 50%); background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--assento-blue); outline-offset: 0; border-color: var(--assento-blue); }

.fejl {
  padding: 12px var(--space-2);
  background: var(--bordeaux);
  color: var(--white);
  margin-bottom: var(--space-2);
}

/* ---- Testbånd ---- */
.testbaand {
  background: var(--peach);
  color: var(--assento-blue);
  font-size: 14px;
  line-height: 20px;
  padding: 6px var(--space-2);
  text-align: center;
}
.testbaand button { font: inherit; text-decoration: underline; background: none; border: 0; color: inherit; cursor: pointer; padding: 0 4px; }

/* ==== Login ==== */
.login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login__brand {
  background: var(--sand);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login__ikon { width: min(320px, 60%); margin: var(--space-4) auto 0; display: block; }
.login__titel { font-size: 48px; line-height: 52px; margin-bottom: var(--space-2); }
.login__logo { width: 220px; display: block; }
.login__form-side {
  position: relative;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-3);
}
.login__brandmark { position: absolute; top: var(--space-3); right: var(--space-3); width: 64px; }
.login__form { width: 100%; max-width: 380px; }
.login__form h2 { margin-bottom: var(--space-1); }
.login__form .intro { color: var(--assento-blue-70); margin-bottom: var(--space-3); }
.login__form .knap { width: 100%; margin-top: var(--space-2); }
.login__persondata { font-size: 13px; line-height: 18px; color: var(--assento-blue-70); margin-top: var(--space-3); }

@media (max-width: 1000px) {
  .login { grid-template-columns: 1fr; min-height: auto; }
  .login__brand { padding: var(--space-3) var(--space-2); flex-direction: row; align-items: center; gap: var(--space-2); }
  .login__ikon { width: 52px; margin: 0; flex: none; }
  .login__brand > div { min-width: 0; }
  .login__titel { font-size: 22px; line-height: 28px; margin-bottom: var(--space-1); overflow-wrap: anywhere; }
  .login__logo { width: 120px; }
  .login__form-side { padding: var(--space-3) var(--space-2) var(--space-4); align-items: flex-start; min-height: calc(100vh - 140px); }
  .login__brandmark { display: none; }
}

/* ==== Portal ==== */
.side { max-width: 1240px; margin: 0 auto; padding: var(--space-3) var(--space-3) var(--space-4); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.topbar__adresse { display: flex; align-items: center; gap: var(--space-2); }
.topbar__adresse img { width: 56px; height: auto; flex: none; }
.topbar__projekt { font-size: 14px; line-height: 20px; color: var(--assento-blue-70); margin: 0; }

.retningslinjer { background: var(--sand); padding: var(--space-3); margin-bottom: var(--space-3); }
.retningslinjer h2 { margin-bottom: var(--space-2); color: var(--black); }
.retningslinjer .intro { max-width: 760px; color: var(--black); }
.retningslinjer details { margin-bottom: var(--space-2); }
.retningslinjer summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.retningslinjer__afsnit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); padding-top: var(--space-2); color: var(--black); }
.retningslinjer__afsnit h3 { font-size: 20px; line-height: 26px; margin-bottom: var(--space-1); color: var(--assento-blue); }
.retningslinjer__afsnit ul { margin: 0; padding-left: 20px; }
.retningslinjer__afsnit li { margin-bottom: 4px; }
.retningslinjer__handling { display: flex; justify-content: flex-end; }

.datoer { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-4); }
.dato-blok { padding: var(--space-2) var(--space-3); }
.dato-blok__stor { font-family: var(--font-display); font-size: 30px; line-height: 36px; display: block; }
.dato-blok__lille { font-family: var(--font-display); font-size: 18px; line-height: 24px; }
.dato-blok--eftersyn { background: var(--peach); color: var(--assento-blue); }
.dato-blok--frist { background: var(--bordeaux); color: var(--white); text-align: right; }

.mangler h2 { margin-bottom: var(--space-2); }
.laast-besked { background: var(--assento-blue); color: var(--white); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }

.mangel-tabel { width: 100%; border-collapse: separate; border-spacing: 12px; margin: 0 -12px; table-layout: fixed; }
.mangel-tabel th {
  background: var(--assento-blue);
  color: var(--white);
  font: 400 18px/22px var(--font-display);
  padding: 16px;
  text-align: center;
}
.mangel-tabel th:nth-child(1) { width: 13%; }
.mangel-tabel th:nth-child(2) { width: 19%; }
.mangel-tabel th:nth-child(3) { width: 16%; }
.mangel-tabel th:nth-child(5) { width: 20%; }
.mangel-tabel td { background: var(--assento-blue-10); color: var(--black); padding: 16px; vertical-align: middle; overflow-wrap: anywhere; }
.mangel-tabel td.nr { background: var(--assento-blue); color: var(--white); text-align: center; font-weight: 600; }
.mangel-tabel tbody tr { cursor: pointer; }
.mangel-tabel tbody tr:hover td:not(.nr) { background: var(--assento-blue-30); }
.mangel-tabel tbody tr:focus-visible { outline: 3px solid var(--assento-blue); }
.beskrivelse-kort { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.filer-mini { display: flex; gap: var(--space-1); justify-content: center; flex-wrap: wrap; }
.filer-mini img { width: 48px; height: 48px; object-fit: cover; display: block; }
.pdf-maerke {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border: 1px solid var(--assento-blue); color: var(--assento-blue);
  font-size: 12px; font-weight: 700; background: var(--white);
}
.ingen-filer { color: var(--assento-blue-70); font-size: 14px; text-align: center; display: block; }

.tom { background: var(--assento-blue-10); padding: var(--space-3); color: var(--black); }

.tilfoej {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-1);
  padding: 10px 12px 10px 20px;
  border: 2px dashed var(--assento-blue);
  background: transparent;
  color: var(--assento-blue);
  font: 400 20px/24px var(--font-display);
  cursor: pointer;
}
.tilfoej:hover { background: var(--assento-blue-10); }
.tilfoej__plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--assento-blue); color: var(--white);
  font: 300 30px/1 var(--font-sans);
}

.bundtekst { margin-top: var(--space-4); max-width: 900px; font-size: 14px; line-height: 21px; font-style: italic; color: var(--black); }
.bundtekst strong { font-style: italic; }
.sidefod { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.sidefod__persondata { font-size: 13px; line-height: 18px; color: var(--assento-blue-70); max-width: 640px; margin: 0; }
.sidefod img { width: 72px; flex: none; }

.status { position: fixed; left: 50%; bottom: var(--space-3); transform: translateX(-50%); background: var(--assento-blue); color: var(--white); padding: 12px 20px; z-index: 50; max-width: calc(100% - 32px); }

/* ---- Dialog ---- */
dialog.mangel-dialog {
  width: min(640px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  border: 0;
  border-radius: 0;
  padding: 0;
  background: var(--white);
  color: var(--assento-blue);
}
dialog.mangel-dialog::backdrop { background: rgba(29, 69, 85, 0.55); }
.dialog__hoved { background: var(--assento-blue); color: var(--white); padding: var(--space-2) var(--space-3); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.dialog__hoved h2 { font-size: 26px; line-height: 32px; }
.dialog__luk { background: none; border: 0; color: var(--white); font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.dialog__krop { padding: var(--space-3); }
.dialog__id { font-size: 14px; line-height: 20px; color: var(--assento-blue-70); margin-bottom: var(--space-2); }
.dialog__fod { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: space-between; padding: 0 var(--space-3) var(--space-3); }
.dialog__fod .hoejre { display: flex; gap: var(--space-2); margin-left: auto; }

.filvaelger input[type='file'] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filliste { list-style: none; margin: 0 0 var(--space-1); padding: 0; display: grid; gap: var(--space-1); }
.filliste li { display: flex; align-items: center; gap: var(--space-2); background: var(--assento-blue-10); padding: var(--space-1); }
.filliste img, .filliste .pdf-maerke { width: 56px; height: 56px; object-fit: cover; flex: none; }
.filliste .navn { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 20px; color: var(--black); }
.filliste .navn small { display: block; color: var(--assento-blue-70); }
.filliste button { background: none; border: 0; color: var(--bordeaux); font: 600 14px var(--font-sans); cursor: pointer; padding: 8px; text-decoration: underline; }
.filliste a { color: var(--assento-blue); font-size: 14px; }

@media (max-width: 760px) {
  .side { padding: var(--space-2) var(--space-2) var(--space-4); }
  h1 { font-size: 28px; line-height: 34px; }
  h2 { font-size: 26px; line-height: 32px; }

  /* Adressen er den største overskrift. Alle andre overskrifter er en fast andel af den,
     så de skalerer med skærmbredden og aldrig bliver større end adressen. */
  :root { --titel: clamp(19px, 5.6vw, 28px); }
  .side h2, .dialog__hoved h2 { font-size: calc(var(--titel) * 0.9); line-height: 1.25; }
  .dato-blok__stor { font-size: calc(var(--titel) * 0.85); line-height: 1.25; }
  .dato-blok__lille { font-size: 16px; line-height: 22px; }
  .tilfoej { font-size: calc(var(--titel) * 0.85); line-height: 1.25; }
  .retningslinjer__afsnit h3 { font-size: max(16px, calc(var(--titel) * 0.8)); line-height: 1.3; }

  /* Topbjælke: adressen på én linje, Log ud som lille knap */
  .topbar { align-items: center; gap: var(--space-1); margin-bottom: var(--space-2); }
  .topbar__adresse { gap: 12px; min-width: 0; }
  .topbar__adresse > div { min-width: 0; }
  .topbar__adresse img { width: 36px; }
  .topbar h1 { font-size: var(--titel); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar__projekt { font-size: 13px; line-height: 18px; }
  .topbar .knap { flex: none; min-height: 36px; padding: 6px 12px; font-size: 14px; line-height: 18px; white-space: nowrap; border-width: 1px; }
  .retningslinjer { padding: var(--space-2); }
  .retningslinjer__afsnit { grid-template-columns: 1fr; }
  .retningslinjer__handling .knap { width: 100%; }
  .datoer { grid-template-columns: 1fr; gap: var(--space-2); margin-bottom: var(--space-3); }
  .dato-blok { padding: 12px var(--space-2); }
  .dato-blok--frist { text-align: left; }

  /* Tabellen bliver til kort på mobil */
  .mangel-tabel, .mangel-tabel tbody, .mangel-tabel tr, .mangel-tabel td { display: block; width: 100%; }
  .mangel-tabel { border-spacing: 0; margin: 0; }
  .mangel-tabel thead { display: none; }
  .mangel-tabel tr { margin-bottom: var(--space-2); background: var(--assento-blue-10); }
  .mangel-tabel td { padding: 6px var(--space-2); background: transparent; }
  .mangel-tabel td::before { content: attr(data-label); display: block; font-size: 12px; line-height: 16px; color: var(--assento-blue-70); font-weight: 600; }
  .mangel-tabel td.nr { text-align: left; padding: 10px var(--space-2); }
  .mangel-tabel td.nr::before { color: var(--assento-blue-30); }
  .mangel-tabel td:last-child { padding-bottom: var(--space-2); }
  .filer-mini { justify-content: flex-start; }
  .ingen-filer { text-align: left; }
  .tilfoej { width: 100%; justify-content: space-between; }
  .dialog__krop { padding: var(--space-2); }
  .dialog__fod { padding: 0 var(--space-2) var(--space-2); }
  .dialog__fod .knap { flex: 1; }
  .dialog__fod .hoejre { width: 100%; }
  .sidefod img { width: 48px; }
}
