/* LoveFlow — app styles. Mobil-først PWA. Theme arver index.html-tokens. */
:root {
  /* Visuel identitet "Nær" (valgt 2026-06-15) */
  --bg: #F4F2FB;
  --card: #FFFFFF;
  --accent: #6E6BD0;
  --accent-soft: #ECEBFA;
  --accent-dark: #5754AD;
  --accent-2: #FF8E7C;
  --accent-2-soft: #FFE3DC;
  --accent-2-dark: #C14E38;   /* læsbar koral til tekst/ned-trend (WCAG AA på hvid) */
  --text: #2E2D3A;
  --muted: #756F86;
  --border: #E7E4F4;
  --error: #D2483D;
  --success: #42A578;
  --warn: #C98A3A;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Display-font (Poppins) på overskrifter + mærke */
.app-header h1, .wordmark, .screen-title, .card h2, .card h3, .kpi-card .score {
  font-family: 'Poppins', sans-serif; font-weight: 600;
}
.wordmark { color: var(--text); }
.wordmark .lp2 { color: var(--accent); }
.brand-row { display: flex; align-items: center; gap: .5rem; }

/* ---- App scaffold ---- */
#app { display: none; min-height: 100vh; }
#app.active { display: block; }
.app-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top) + .75rem) 1rem .75rem;
  display: flex; align-items: center; justify-content: space-between;
}
.app-header h1 { font-size: 1.15rem; margin: 0; color: var(--accent); letter-spacing: -.01em; }
.app-header .sub { font-size: .75rem; color: var(--muted); }
.app-main {
  max-width: 540px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 1.25rem) 1rem calc(var(--nav-h) + env(safe-area-inset-bottom) + 1.5rem);
}

/* ---- Bottom nav ---- */
.app-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.app-nav button {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: .68rem; padding: 6px 0;
}
.app-nav button .ico { font-size: 1.25rem; line-height: 1; }
.app-nav button.active { color: var(--accent); }

/* ---- Cards & generic ---- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.1rem 1.15rem; margin-bottom: .9rem;
  box-shadow: 0 8px 18px rgba(110,107,208,.10);
}
/* Dashboard-top (som designoplæg): parnavne + dato + overlappende avatarer */
.app-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: .25rem 0 1.1rem; }
.app-couple { font-family: 'Poppins', sans-serif; font-size: 1.6rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; line-height: 1.1; }
.app-date { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.app-avatars { display: flex; flex: none; }
.app-avatars .av { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--bg); font-size: 14px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; }
.app-avatars .av:nth-child(2) { margin-left: -11px; }

/* Check-in CTA = lavendel hero (mærke-ikon + tekst + pil) */
.checkin-hero {
  background: linear-gradient(135deg,#6E6BD0,#8482E0); color: #fff;
  border-radius: 18px; padding: 14px 15px; margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  box-shadow: 0 10px 22px rgba(110,107,208,.28);
}
.checkin-hero .ci-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.2); }
.checkin-hero .ci-t { font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600; line-height: 1.2; }
.checkin-hero .ci-s { font-size: 12px; opacity: .88; margin-top: 2px; }
.checkin-hero .ci-go { margin-left: auto; font-size: 19px; }

.sec-head { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--muted); margin: 4px 2px 11px; display: flex; align-items: center; justify-content: space-between; }
.sec-head a { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--accent); cursor: pointer; font-weight: 600; }
.card h2, .card h3 { margin: 0 0 .4rem; }
.screen-title { font-size: 1.4rem; margin: .25rem 0 1rem; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.stack > * + * { margin-top: .6rem; }
.pill {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .72rem; font-weight: 600;
}
.pill.gray { background: #eee; color: var(--muted); }
.placeholder-note {
  font-size: .72rem; color: var(--warn); background: #fffbea;
  border: 1px solid #f3e6b3; border-radius: 8px; padding: .35rem .55rem; margin-bottom: .75rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75em 1.1em; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 1rem; font-weight: 600;
  cursor: pointer; width: 100%; text-decoration: none;
}
.btn.secondary { background: var(--accent-soft); color: var(--accent-dark); }
.btn.ghost { background: none; color: var(--muted); border: 1px solid var(--border); }
.btn.danger { background: #fbeaea; color: var(--error); }
.btn.sm { width: auto; padding: .45em .8em; font-size: .85rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
input[type=text], input[type=email], textarea, select {
  width: 100%; padding: .7em .8em; font-size: 1rem; font: inherit;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
textarea { resize: vertical; }

/* ---- Scale 1-5 selector ---- */
.scale { display: flex; gap: .4rem; margin-top: .4rem; }
.scale button {
  flex: 1; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; font-size: 1.1rem; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: transform .08s ease;
}
.scale button.sel { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.05); }
.scale-labels { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); margin-top: .25rem; }
.q-block { margin-bottom: 1.3rem; }
.q-block .prompt { font-weight: 600; }

/* ---- KPI cards ---- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .8rem; cursor: pointer; box-shadow: 0 6px 14px rgba(110,107,208,.08); }
.kpi-card .name { font-weight: 600; font-size: .9rem; line-height: 1.25; color: var(--text); }
.kpi-card .score { font-family: 'Poppins', sans-serif; font-size: 1.7rem; font-weight: 700; margin-top: .35rem; display: flex; align-items: baseline; gap: 5px; }
.kpi-card .score .trend { font-size: .85rem; font-weight: 600; }
.kpi-card .spark { display: block; width: 100%; height: 22px; margin-top: 9px; }
.trend { font-size: .8rem; font-weight: 600; }
.trend.up { color: var(--success); } .trend.down { color: var(--accent-2-dark); } .trend.flat { color: var(--muted); }

/* ---- list rows ---- */
.list-row {
  display: flex; align-items: center; gap: .75rem; padding: .8rem 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.list-row:last-child { border-bottom: 0; }
.list-row .emoji { font-size: 1.5rem; }
.list-row .meta { flex: 1; min-width: 0; }
.list-row .meta .t { font-weight: 600; }
.list-row .meta .d { font-size: .82rem; color: var(--muted); }
.list-row .chev { color: var(--muted); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: #ccc; border-radius: 999px; transition: .2s; }
.switch .sl::before { content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .sl { background: var(--accent); }
.switch input:checked + .sl::before { transform: translateX(18px); }

.status-msg { font-size: .9rem; margin-top: .5rem; }
.status-msg.error { color: var(--error); }
.status-msg.success { color: var(--success); }
.status-msg.info { color: var(--muted); }

.spinner { text-align: center; color: var(--muted); padding: 2rem 0; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty .big { font-size: 2.5rem; margin-bottom: .5rem; }

.compare-row { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.compare-row .q { font-size: .88rem; }
.compare-row .v { font-weight: 700; width: 2rem; text-align: center; }
.compare-head { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.match { color: var(--success); } .diverge { color: var(--warn); }

.sparkline { display: flex; align-items: flex-end; gap: 4px; height: 80px; margin: .6rem 0; }
.sparkline .bar { flex: 1; background: var(--accent-soft); border-radius: 4px 4px 0 0; position: relative; min-height: 3px; }
.sparkline .bar.you { background: var(--accent); }
.back-link { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: .9rem; padding: 0; margin-bottom: .5rem; }

.seg { display: inline-flex; background: var(--accent-soft); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: .7rem; }
.seg button { border: 0; background: none; padding: .35em .75em; border-radius: 8px; font-size: .82rem; color: var(--accent-dark); cursor: pointer; }
.seg button.active { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(110,107,208,.18); }

.md h1,.md h2,.md h3 { line-height: 1.25; }
.md p { margin: .6rem 0; }
.md ul,.md ol { padding-left: 1.2rem; }

/* Onboarding-intro */
.intro { padding-top: .25rem; }
.intro-h { font-family: 'Poppins', sans-serif; font-size: 1.4rem; margin: 0 0 .4rem; color: var(--text); }
.intro-sub { color: var(--muted); font-size: .92rem; line-height: 1.5; margin: 0 0 1.1rem; }
.intro-step { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .85rem; }
.intro-ic { flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; }
.intro-ic.coral { background: var(--accent-2-soft); color: var(--accent-2-dark); }
.intro-st { font-weight: 600; font-size: .95rem; color: var(--text); }
.intro-sd { color: var(--muted); font-size: .83rem; line-height: 1.4; }
.intro-note { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; font-size: .78rem; color: var(--muted); line-height: 1.45; margin: .7rem 0 1rem; }
.intro .btn { margin-top: .1rem; }
.app-nav .ico svg { display: block; }

/* ============================================================
   Feedback / Flag-system (DevTodo) — element-level feedback.
   Flag-knap sidder i hjørnet af hvert flagget element; klik
   åbner modal der skriver til den delte app_feedback-backlog.
   ============================================================ */
.flag-host { position: relative; }
.flag-btn {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: transparent; color: var(--muted);
  font-size: 12px; line-height: 1; padding: 0; cursor: pointer; opacity: .28; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.flag-host:hover > .flag-btn, .flag-btn:hover, .flag-btn:focus {
  opacity: 1; background: var(--accent-soft); color: var(--accent); outline: none;
}
.flag-btn.is-marked { opacity: 1; color: var(--accent-2-dark); }
/* Skærm-niveau flag i toppen (overordnet feedback på hele skærmen) */
.flag-screen {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 .6rem;
  font-size: .72rem; color: var(--muted); background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  cursor: pointer; transition: color .15s ease, background .15s ease;
}
.flag-screen:hover { color: var(--accent); }

/* Modal */
.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(42,26,35,.45);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 1000;
}
.fb-modal { background: var(--card); border-radius: 16px; padding: 1.25rem; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(46,45,58,.25); }
.fb-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.fb-modal-head h2 { margin: 0; font-size: 1.1rem; }
.fb-modal-close { border: none; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.fb-ctx { color: var(--muted); font-size: .82rem; margin: 0 0 .6rem; }
.fb-ctx strong { color: var(--text); }
.fb-modal textarea, .fb-modal select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: .6em; font: inherit; background: #fff; color: var(--text);
}
.fb-modal label { display: block; font-size: .82rem; color: var(--muted); margin: .5rem 0 .25rem; }
.fb-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .85rem; }
.fb-cancel, .fb-submit { padding: .5em 1.1em; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; font: inherit; }
.fb-cancel { background: none; color: var(--muted); }
.fb-submit { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.fb-submit:disabled { opacity: .5; cursor: not-allowed; }
.fb-msg { font-size: .82rem; margin: .55rem 0 0; min-height: 1em; }
.fb-msg.error { color: var(--error); }
.fb-msg.ok { color: var(--success); }

/* DevTodo backlog-liste */
.dt-add { margin-bottom: 1rem; }
.dt-add textarea, .dt-add select { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: .6em; font: inherit; background: #fff; color: var(--text); }
.dt-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 .8rem; }
.dt-chip { border: 1px solid var(--border); background: var(--card); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: .78rem; cursor: pointer; }
.dt-chip.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); font-weight: 600; }
.dt-item { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .55rem; background: var(--card); }
.dt-item .dt-text { font-size: .92rem; color: var(--text); }
.dt-item .dt-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: .45rem; font-size: .72rem; color: var(--muted); }
.dt-badge { border-radius: 6px; padding: 1px 7px; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.dt-badge.cat { background: var(--accent-soft); color: var(--accent-dark); }
.dt-badge.st-open { background: var(--accent-2-soft); color: var(--accent-2-dark); }
.dt-badge.st-in_progress { background: #FFF1D6; color: var(--warn); }
.dt-badge.st-done { background: #DBF1E6; color: var(--success); }
.dt-badge.st-wontfix { background: #eee; color: var(--muted); }
.dt-target { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.dev-link { display: inline-block; margin-top: 1rem; color: var(--muted); font-size: .78rem; cursor: pointer; }
.dev-link:hover { color: var(--accent); }
