/* Formuläret ska läsas som en kallelse, inte som ett frågeformulär:
   sammanhållen prosa, serif, knappa marginaler och inga kortrutor.
   Frågetexten är en inledning ("Du är välkommen till") och de valda
   alternativen fullbordar meningen. */

:root {
  --bg: #f7f2ea;
  --bg2: #efe5d8;
  --ink: #221d18;
  --ink-soft: #574d44;
  --muted: #8e8378;
  --line: #ddd1c2;
  --accent: #a4462a;
  --accent-soft: #f4e7df;
  --radius: 7px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: linear-gradient(168deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font: 17px/1.5 ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  -webkit-text-size-adjust: 100%;
}

.bf-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 26px 15px 40px;
}

/* --- kallelsens huvud --- */
.bf-title {
  margin: 0 0 18px;
  font-size: clamp(23px, 5.6vw, 29px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -.005em;
  text-align: center;
  white-space: pre-wrap;
}
.bf-title::after {
  content: "";
  display: block;
  width: 46px; height: 1px;
  margin: 15px auto 0;
  background: var(--line);
}

/* --- ett block per fråga, utan ruta --- */
.bf-q {
  margin: 0 0 17px;
  padding: 0;
  border: 0;
  background: none;
}
.bf-q[hidden] { display: none; }

/* framtoning när nästa fråga avslöjas */
.bf-in { animation: bf-rise .3s ease both; }
@keyframes bf-rise {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bf-in { animation: none; }
}

.bf-qtext {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.bf-hint {
  margin: -1px 0 5px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--muted);
}

/* --- alternativ utan bild: nästan ren text --- */
.bf-opts { display: grid; gap: 1px; }

.bf-opt {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 5px 9px;
  margin-left: -9px;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.bf-opt:hover { background: rgba(34, 29, 24, .035); }
.bf-opt.sel { background: var(--accent-soft); }

.bf-opt-txt {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
  transition: color .12s;
}
.bf-opt.sel .bf-opt-txt { color: var(--accent); font-weight: 600; }

/* --- markörer: små och diskreta --- */
.bf-mark {
  flex: 0 0 auto;
  position: relative;
  width: 14px; height: 14px;
  align-self: center;
  border: 1.5px solid #c6b8a8;
  background: transparent;
  transition: border-color .12s, background .12s;
}
.bf-mark.radio { border-radius: 50%; }
.bf-mark.check { border-radius: 3px; }
.sel .bf-mark { border-color: var(--accent); background: var(--accent); }
.sel .bf-mark.radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--bg);
}
.sel .bf-mark.check::after {
  content: ""; position: absolute; left: 3.5px; top: .5px;
  width: 4px; height: 7.5px;
  border: solid var(--bg); border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

/* --- bildalternativ: tätt rutnät, tunna ramar --- */
/* Tre i bredd redan på mobil för 3/5/6 alternativ — bilderna ska vara
   illustrationer i en kallelse, inte formulärets tyngdpunkt. */
.bf-grid { display: grid; gap: 7px; grid-template-columns: 1fr 1fr; margin-top: 2px; }
.bf-grid[data-n="1"] { grid-template-columns: 1fr; max-width: 230px; }
.bf-grid[data-n="2"], .bf-grid[data-n="4"] { max-width: 340px; }
@media (min-width: 360px) {
  .bf-grid[data-n="3"], .bf-grid[data-n="5"], .bf-grid[data-n="6"] {
    grid-template-columns: repeat(3, 1fr);
  }
}

.bf-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .4);
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  transition: border-color .12s, background .12s;
}
.bf-card:hover { border-color: #c9b9a6; }
.bf-card.sel { border-color: var(--accent); background: var(--accent-soft); }

.bf-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  background: #ece3d8;
  filter: saturate(.85);
  transition: filter .12s;
}
.bf-card.sel img { filter: none; }

.bf-card-foot { display: flex; align-items: center; gap: 7px; padding: 0 3px 2px; }
.bf-card-txt {
  flex: 1; min-width: 0;
  font-size: 14.5px; line-height: 1.3;
  color: var(--muted);
  word-break: break-word;
}
.bf-card.sel .bf-card-txt { color: var(--accent); font-weight: 600; }
.bf-card.noimg { justify-content: center; min-height: 62px; }

/* --- datum & tid --- */
.bf-dt input {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.bf-dt input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.bf-locked {
  padding: 7px 11px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
  color: var(--accent);
}

.bf-tz { margin: 4px 1px 0; font-size: 12.5px; font-style: italic; color: var(--muted); }

/* --- avslut --- */
.bf-submit {
  width: 100%;
  margin-top: 20px;
  padding: 12px 18px;
  font: 600 16.5px/1 inherit;
  color: #fdf9f4;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter .12s, opacity .15s;
}
.bf-submit:hover:not([disabled]) { filter: brightness(1.07); }
.bf-submit[disabled] {
  opacity: .3;
  cursor: default;
  filter: grayscale(.5);
}

.bf-msg {
  margin-top: 10px; padding: 9px 11px;
  border-radius: var(--radius); font-size: 14.5px;
  background: #fbe9e6; color: #85291b; border: 1px solid #eec9c2;
}
.bf-empty { color: var(--muted); font-style: italic; }

.bf-done {
  padding: 30px 18px;
  text-align: center;
}
.bf-done .tick {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--accent);
  position: relative;
}
.bf-done .tick::after {
  content: ""; position: absolute; left: 16px; top: 11px;
  width: 10px; height: 19px;
  border: solid var(--bg); border-width: 0 3px 3px 0;
  transform: rotate(42deg);
}
.bf-done p { margin: 0; font-size: 17px; line-height: 1.45; white-space: pre-wrap; }
