/* AG verktøy: felles stil for alle verktøyene. Tokens fra AG-profilen. */
:root {
  --ag-black-700: #231f20;
  --ag-white: #ffffff;
  --ag-blue-300: #c7dee5;
  --ag-blue-100: #e9f2f5;
  --ag-salmon-100: #fdeae1;
  --ag-salmon-300: #fbd5c4;
  --ag-salmon-600: #f7966c;
  --ag-pear-300: #f9fade;
  --ag-gray-500: #b8c5c7;
  --ag-gray-700: #5b6366;

  --ink: var(--ag-black-700);
  --muted: var(--ag-gray-700);
  --line: var(--ag-gray-500);
  --bg: var(--ag-white);
  --surface: #f7f8f8;
  --focus: var(--ag-salmon-600);

  --font: "Euclid Circular B", "Euclid B", "Avenir Next", "Futura", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 12px;
  --pill: 999px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } body { font-size: 17px; } }

/* Topplinje */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 20px; }
.brand img { width: 40px; height: 40px; display: block; }
.top nav { margin-left: auto; display: flex; gap: 20px; font-size: 16px; }
.top nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .top nav a.valgfri { display: none; } }
.top nav a:hover { color: var(--ink); text-decoration: underline; }

h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 48px 0 12px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 0 0 8px; font-weight: 600; }
.lead { font-size: 20px; color: var(--muted); margin: 0 0 32px; max-width: 46em; }

/* Knapper */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px;
  font: inherit; font-weight: 600; font-size: 17px;
  border: 2px solid var(--ink); border-radius: var(--pill);
  background: var(--ink); color: var(--ag-white);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #000; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--ag-blue-100); }
.btn.link { border-color: transparent; background: transparent; color: var(--ink); text-decoration: underline; padding: 8px 4px; min-height: 0; font-weight: 500; }
.btn[hidden] { display: none; }
.btn:disabled { opacity: 0.5; cursor: wait; }

/* Skjema */
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.input {
  width: 100%; min-height: 56px; padding: 12px 18px;
  font: inherit; font-size: 19px; color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--radius); background: var(--bg);
}
.input::placeholder { color: #8a9294; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .input { flex: 1 1 320px; }

.notice { padding: 14px 18px; border-radius: var(--radius); margin: 20px 0 0; }
.notice.info { background: var(--ag-blue-100); }
.notice.feil { background: var(--ag-salmon-100); border-left: 6px solid var(--ag-salmon-600); }
.notice.ok { background: var(--ag-pear-300); }
.notice[hidden] { display: none; }

/* Forsiden: verktøykort */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 64px; }
.card {
  display: block; padding: 28px; border-radius: var(--radius); text-decoration: none;
  background: var(--ag-blue-300); min-height: 200px; transition: transform .15s ease;
}
.card:hover { transform: translateY(-2px); }
.card p { margin: 0; }
.card .ikon { font-size: 34px; line-height: 1; margin-bottom: 16px; display: block; }
.undertittel { display: block; font-size: 15px; font-weight: 600; letter-spacing: .02em; margin-bottom: 4px; }
.undertittel.stor { font-size: 18px; margin: 48px 0 0; }
.undertittel.stor + h1 { margin-top: 4px; }
.card.forslag { background: var(--ag-salmon-100); }
textarea.input { min-height: 160px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; gap: 22px; max-width: 720px; margin-bottom: 64px; }
.field .hjelp { display: block; font-weight: 400; color: var(--muted); font-size: 16px; margin-top: 2px; }
.honning { display: none; }
.card.kommer { background: var(--surface); color: var(--muted); border: 2px dashed var(--line); }
.card.kommer:hover { transform: none; }

/* Innlogging */
.login { max-width: 440px; margin: 10vh auto; padding: 0 16px; }
.login .brand { margin-bottom: 32px; }
.login form { display: grid; gap: 16px; }

.spinner { width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
