/* ─── Domän till salu ───────────────────────────────────────────────────────
   Typsnitt: Familjen Grotesk (SIL Open Font License), självhostat så att
   besökare inte skickar något till Google innan de har valt i cookiebannern.
   ------------------------------------------------------------------------ */
@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/familjen-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/familjen-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f5f5f2;
  --ink: #121212;
  --mute: #75756f;
  --faint: #b4b4ad;
  --red: #ff3d12;
  --red-ink: #c92a08;
  --pad: clamp(20px, 3.6vw, 56px);
  --font: "Familjen Grotesk", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--red-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ─── Topprad ─── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px var(--pad) 0;
  font-size: 15px;
}
.lang { display: flex; gap: 18px; }
.lang button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--mute);
  cursor: pointer;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ─── Domännamnet ───
   JS skalar texten så den fyller bredden exakt. CSS-värdet är bara en
   rimlig storlek tills dess. */
.domain {
  margin: clamp(48px, 10vh, 120px) 0 0;
  padding: 0 var(--pad);
  font-weight: 700;
  font-size: clamp(56px, 13vw, 220px);
  line-height: 0.82;
  letter-spacing: -0.055em;
}
.domain__fit {
  display: inline-block;
  white-space: nowrap;
  /* Optisk justering: de flesta gemener har luft till vänster */
  margin-left: -0.04em;
  padding-bottom: 0.26em;
}
.domain.is-wrapped .domain__fit { white-space: normal; overflow-wrap: anywhere; }
.domain__tld { color: var(--red); }

/* ─── Arket under rubriken ─── */
.sheet {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr);
  grid-template-areas:
    "intro  form"
    "seller form";
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 6vw, 96px);
  margin: 0 var(--pad);
  padding: 28px 0 clamp(56px, 9vh, 104px);
  border-top: 2px solid var(--ink);
}
.intro {
  grid-area: intro;
  margin: 0;
  max-width: 17em;
  font-size: 19px;
  line-height: 1.35;
}
.seller {
  grid-area: seller;
  align-self: end;
  margin-top: 40px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mute);
}
.seller p { margin: 0; }
.seller__label { color: var(--ink); }
.offer, .done { grid-area: form; }

/* ─── Formuläret som en mening ─── */
.offer { margin: 0; }
.line {
  margin: 0 0 0.5em;
  font-size: clamp(24px, 2.9vw, 40px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
}
.line__domain { font-weight: 700; }

.blank {
  display: inline-block;
  max-width: 100%;
  margin: 0 0.08em;
  padding: 0 0.1em;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  vertical-align: baseline;
  -webkit-appearance: none;
  appearance: none;
}
.blank::placeholder { color: var(--faint); font-weight: 500; opacity: 1; }
.blank:focus { outline: none; border-bottom-color: var(--red); }
.blank--amount { font-variant-numeric: tabular-nums; text-align: right; }
.blank--select {
  width: auto;
  padding-right: 0.85em;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23121212' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 0.1em center / 0.42em auto;
}
.is-invalid { border-bottom-color: var(--red); }

.more {
  display: block;
  margin: 28px 0 0;
  font-size: 15px;
  color: var(--mute);
}
.more textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--faint);
  border-radius: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  resize: none;
  overflow: hidden;
}
.more textarea:focus { outline: none; border-bottom-color: var(--ink); }

.submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 32px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
}
.check input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.check input:checked {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat center / 12px;
}
.check.is-invalid input { border-color: var(--red); }

.go {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 30px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.go:hover { background: var(--red); color: #fff; }
.go:disabled { opacity: 0.6; cursor: progress; }
.go span[aria-hidden] { transition: transform 0.15s; }
.go:hover span[aria-hidden] { transform: translateX(4px); }

.error { margin: 18px 0 0; color: var(--red-ink); font-size: 15px; }
.fine { margin: 18px 0 0; font-size: 14px; color: var(--mute); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ─── Tack ─── */
.done { outline: none; }
.done__text {
  margin: 0 0 24px;
  max-width: 22em;
  font-size: clamp(24px, 2.9vw, 40px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.done__text strong { font-weight: 700; }
.link {
  padding: 0;
  border: 0;
  background: none;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.link:hover { color: var(--red-ink); }

/* ─── Sidfot ─── */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px var(--pad) 22px;
  border-top: 1px solid var(--ink);
  font-size: 14px;
  color: var(--mute);
}
.foot p { margin: 0; }
.foot a { margin-left: 20px; color: var(--ink); text-decoration: none; }
.foot a:first-child { margin-left: 0; }
.foot a:hover { text-decoration: underline; color: var(--ink); }

/* ─── Integritetspolicy ─── */
.policy {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr);
  column-gap: clamp(32px, 6vw, 96px);
  margin: clamp(48px, 10vh, 120px) var(--pad) 0;
  padding-bottom: 96px;
}
.policy h1 {
  grid-column: 1 / -1;
  margin: 0 0 28px;
  padding-bottom: 0.1em;
  font-size: clamp(36px, 10.5vw, 150px);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.055em;
}
.policy__side {
  padding-top: 24px;
  border-top: 2px solid var(--ink);
  font-size: 15px;
  color: var(--mute);
}
.policy__side p { margin: 0 0 20px; }
.policy__side strong { color: var(--ink); font-weight: 400; }
.policy__body {
  max-width: 40em;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}
.policy__body article > h2:first-child { margin-top: 0; }
.policy h2 { margin: 40px 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.policy p, .policy li { line-height: 1.55; }
.policy ul { margin: 0; padding-left: 1.1em; }
.policy li { margin-bottom: 6px; }
.policy li::marker { content: "– "; }
.policy code { font-size: 0.92em; }
.policy__body strong { font-weight: 600; }

/* ─── Cookiebanner: samma funktion som avacti.com, sidans profil ─── */
.cookie-consent {
  position: fixed;
  left: var(--pad);
  bottom: 20px;
  z-index: 200;
  width: min(440px, calc(100vw - 2 * var(--pad)));
  padding: 20px 22px 18px;
  background: var(--ink);
  color: var(--paper);
  animation: cc-in 0.35s ease both;
}
@keyframes cc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cookie-consent__text { margin: 0 0 16px; font-size: 15px; line-height: 1.45; }
.cookie-consent__text a { color: inherit; }
.cookie-consent__text a:hover { color: var(--red); }
.cookie-consent__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.cookie-consent__btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 15px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.cookie-consent__btn:hover { color: var(--red); }
.cookie-consent__btn--main {
  order: -1;
  padding: 9px 16px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.cookie-consent__btn--main:hover { background: var(--red); color: #fff; }
.cookie-consent__options {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(245, 245, 242, 0.25);
}
.cc-opt {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(245, 245, 242, 0.7);
  cursor: pointer;
}
.cc-opt strong { display: block; color: var(--paper); font-weight: 600; }
.cc-opt input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--red); cursor: pointer; }
.cc-opt input:disabled { cursor: not-allowed; opacity: 0.5; }

/* ─── Mobil ─── */
@media (max-width: 820px) {
  .sheet {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "form" "seller";
    grid-template-rows: none;
    padding-top: 20px;
  }
  .intro { margin-bottom: 28px; max-width: none; }
  .seller { margin-top: 56px; }
  .policy { grid-template-columns: 1fr; }
  .policy__side { order: 2; margin-top: 48px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .domain { margin-top: 56px; }
  .line { font-size: 24px; line-height: 1.55; }
  .submit { flex-direction: column; align-items: stretch; }
  .go { justify-content: space-between; }
  .foot { flex-direction: column; }
  .cookie-consent { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
