@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url('/fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url('/fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #F4F6F1; --ink: #15231D; --muted: #4A5A52; --green: #1F5C45; --tint: #DDE8DF;
  --card: #FFFFFF; --rec: #FF6B4A; --danger: #B3261E;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', var(--body);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.45; }
body.dark { background: #0F1915; color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 9vw, 40px); }
h2 { font-size: 24px; }
p { margin: 0; }
a { color: var(--green); }

#app { min-height: 100dvh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px;
  padding: max(28px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
#app.wide { max-width: 760px; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--green); text-decoration: none; }
.ico { display: inline-flex; flex: none; }
.ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn { min-height: 56px; border: 2px solid var(--ink); border-radius: 16px; background: transparent; padding: 0 20px;
  font-weight: 600; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.small { min-height: 44px; border-radius: 12px; font-size: 15px; padding: 0 14px; }
.btn.ghost { border-color: transparent; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .option:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--rec); outline-offset: 2px; }
.block { width: 100%; }

.option { width: 100%; min-height: 76px; border: 2px solid var(--ink); border-radius: 16px; background: var(--card); padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; text-align: left; cursor: pointer; }
.option.primary { background: var(--green); border-color: var(--green); color: #fff; }
.option strong { display: block; font-size: 18px; }
.option span.sub { font-size: 14px; color: var(--muted); }
.option.primary span.sub { color: #fff; }

label { font-weight: 600; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; }
input[type=text], input[type=date], select, textarea { width: 100%; min-height: 56px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); padding: 12px 16px; font-size: 18px; }
textarea { min-height: 160px; resize: vertical; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.card { background: var(--card); border: 2px solid var(--tint); border-radius: 16px; padding: 18px; }
.prompt { background: var(--tint); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.prompt .q { font-family: var(--display); font-size: 22px; line-height: 1.2; }
.prompt .tag { font-size: 14px; font-weight: 600; color: var(--green); }
.error { color: var(--danger); font-weight: 600; }
.bar { height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--green); transition: width .2s; }
.badge { width: 72px; height: 72px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.badge svg { width: 36px; height: 36px; stroke-width: 2.5; }

/* Inspelning */
.rec-prompt { background: var(--green); border-radius: 16px; padding: 14px 18px; font-family: var(--display); font-size: 19px; line-height: 1.25; }
.stage { flex: 1; min-height: 240px; border-radius: 20px; background: #24332D; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; color: #C9D6CE; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage video.mirror { transform: scaleX(-1); }
.mic { width: 120px; height: 120px; border-radius: 50%; background: #1F5C45; display: flex; align-items: center; justify-content: center; color: #fff; }
.mic svg { width: 48px; height: 48px; }
.mic.live { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 22px rgba(255, 107, 74, .25); } }
@media (prefers-reduced-motion: reduce) { .mic.live { animation: none; } .bar > div { transition: none; } }
.rec-status { display: flex; justify-content: space-between; font-weight: 600; font-size: 15px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--rec); margin-right: 8px; }
body.dark .bar { background: #24332D; }
body.dark .bar > div { background: var(--rec); }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.controls .btn { color: #fff; min-height: 48px; padding: 0 8px; font-size: 15px; }
.shutter { width: 84px; height: 84px; border: 4px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.shutter span { width: 60px; height: 60px; border-radius: 50%; background: var(--rec); transition: all .15s; }
.shutter.on span { width: 32px; height: 32px; border-radius: 8px; }
.preview { width: 100%; max-height: 52dvh; border-radius: 20px; background: #000; }
audio.preview { background: transparent; }

/* Värdsidan */
.qr { width: 180px; flex: none; background: #fff; border-radius: 12px; padding: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.link { font-family: ui-monospace, monospace; font-size: 15px; word-break: break-all; }
.greeting { display: flex; flex-direction: column; gap: 12px; }
.greeting video { width: 100%; max-height: 70dvh; border-radius: 12px; background: #000; }
.greeting audio { width: 100%; }
.greeting img { max-width: 100%; border-radius: 12px; }
.greeting .msg { white-space: pre-wrap; font-size: 18px; }
.sign { display: none; }

@media print {
  body { background: #fff; }
  #app > *:not(.sign) { display: none !important; }
  .sign { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; padding-top: 60px; }
  .sign h1 { font-size: 48px; }
  .sign p { font-size: 24px; }
  .sign .qr { width: 360px; }
}
[hidden] { display: none !important; }

.notice { border: 2px solid var(--danger); background: #FCE9E7; color: #6E1510; border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }

/* Storage packages */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tier { position: relative; border: 2px solid var(--tint); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.tier.popular { border-color: var(--green); }
.tier .tag { position: absolute; top: -12px; left: 14px; background: var(--green); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tier-head strong { font-family: var(--display); font-size: 24px; }
.tier .price { font-weight: 600; }
.tier .btn { margin-top: auto; }
input[type=email] { width: 100%; min-height: 56px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); padding: 12px 16px; font-size: 18px; }
