/* ==========================================================
   Printstugan
   Färger: grafit (byggkammare), filamentgul (accent), ljus plåt (bakgrund)
   ========================================================== */
:root {
  --paper: #F2F4F1;
  --surface: #FFFFFF;
  --ink: #1C2320;
  --graphite: #26302C;
  --graphite-2: #313D38;
  --filament: #FFC93C;
  --filament-deep: #D9A400;
  --filament-shadow: #B38700;
  --line: #D3D9D3;
  --muted: #56615B;
  --error: #B42318;
  --error-bg: #FDECEA;
  --on-filament: #1C2320;     /* text på gula ytor, samma i båda lägena */
  --bg-subtle: #E3E7E3;
  --border-input: #B9C2BB;
  --hover: #E8ECE8;
  --note: #FFF4CF;
  --rail: #AEB8B1;
  --frame: #C3CBC5;
  --ghost-layer: #5E6862;
  --when: #7D6100;
  --preview-glow: #FFFFFF;
  --raised: #FFFFFF;
  --mark-tak: #D9A400;
  color-scheme: light;

  --font: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 20px;
  --r-md: 12px;
  --r-sm: 8px;
  --wrap: 1180px;
}

/* Mörkt läge: följer enhetens inställning, eller valet i menyn (data-theme på <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121715; --surface: #1B221F; --ink: #ECEFEC; --graphite: #222B27; --graphite-2: #2C3732;
    --line: #2E3833; --muted: #A3ADA6; --error: #FFB4A8; --error-bg: #3A1F1B;
    --bg-subtle: #242D29; --border-input: #3F4A45; --hover: #232B27; --note: #3A3217;
    --rail: #4A5650; --frame: #3A4540; --ghost-layer: #4E5B55; --when: #E6BC45; --preview-glow: #27302C; --raised: #34413B; --mark-tak: #FFC93C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121715; --surface: #1B221F; --ink: #ECEFEC; --graphite: #222B27; --graphite-2: #2C3732;
  --line: #2E3833; --muted: #A3ADA6; --error: #FFB4A8; --error-bg: #3A1F1B;
  --bg-subtle: #242D29; --border-input: #3F4A45; --hover: #232B27; --note: #3A3217;
  --rail: #4A5650; --frame: #3A4540; --ghost-layer: #4E5B55; --when: #E6BC45; --preview-glow: #27302C; --raised: #34413B; --mark-tak: #FFC93C;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.875rem, 3.4vw, 2.625rem); }
h3 { font-size: 1.1875rem; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; }
em { font-style: normal; color: var(--muted); font-weight: 400; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-sm);
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- Knappar: lager under knappen ---------- */
.btn {
  --lift: 0px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--font);
  text-decoration: none; color: var(--on-filament);
  background: var(--filament);
  border: 0; border-radius: var(--r-md);
  padding: 16px 24px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--filament-deep), 0 6px 0 var(--filament-shadow);
  transform: translateY(var(--lift));
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { --lift: -1px; box-shadow: 0 4px 0 var(--filament-deep), 0 8px 0 var(--filament-shadow); }
.btn:active { --lift: 4px; box-shadow: 0 1px 0 var(--filament-deep), 0 2px 0 var(--filament-shadow); }
.btn[disabled] { opacity: .6; cursor: progress; }
/* Samma lager under som den gula knappen, i grått, så att knapparna står på samma linje */
.btn-ghost {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink), 0 3px 0 var(--ghost-layer), 0 6px 0 var(--rail);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--ink), 0 4px 0 var(--ghost-layer), 0 8px 0 var(--rail); }
.btn-ghost:active { box-shadow: inset 0 0 0 2px var(--ink), 0 1px 0 var(--ghost-layer), 0 2px 0 var(--rail); }
.btn-small { padding: 10px 16px; font-size: .9375rem; box-shadow: 0 2px 0 var(--filament-deep), 0 4px 0 var(--filament-shadow); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark { fill: var(--ink); }
.brand-mark .tak { fill: var(--mark-tak); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:not(.btn):hover { color: var(--ink); }

/* Knapp för ljust/mörkt läge */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink); padding: 0; flex: none;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.is-dark .theme-toggle .icon-sun { display: block; }
.is-dark .theme-toggle .icon-moon { display: none; }

/* ---------- Hero: texten och skrivaren står på samma byggplatta ---------- */
.hero { padding: 48px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: end; }
.hero-copy { padding-bottom: 36px; }
.hero h1 {
  font-size: clamp(2.75rem, 6.4vw, 5.75rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  max-width: 10.5ch;
}
.lead { margin-top: 28px; font-size: 1.25rem; line-height: 1.5; color: var(--muted); max-width: 30rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.printer { margin: 0; }
.printer svg { width: 100%; height: auto; display: block; overflow: visible; }
.frame line { stroke: var(--frame); stroke-width: 2; stroke-linecap: round; }
#layers rect { transform-box: fill-box; transform-origin: left center; }
.rail { fill: var(--rail); }
.carriage { fill: var(--ink); }
.fan { fill: #3A4540; }
.nozzle { fill: #C79A2E; }
.glow { fill: var(--filament); opacity: 0; transition: opacity .3s; }
.printing .glow { opacity: 1; }
.dimension { opacity: 0; transition: opacity .6s ease; }
.dimension.show { opacity: 1; }
.dim-line, .dim-tick { stroke: var(--ink); stroke-width: 1.5; }
.dim-label { font: 600 15px var(--font); fill: var(--ink); }

/* Byggplattan: ett band tvärs över hela sidan, med PEI-plattans prickar */
.plate {
  height: 16px;
  border-radius: 4px;
  background:
    radial-gradient(circle, #4E5B55 1px, transparent 1.4px) 0 0 / 10px 8px,
    var(--graphite);
}
.hero-facts { margin-top: 20px; color: var(--muted); font-size: .9375rem; }

/* ---------- Börja med det du har ---------- */
.starts { padding: 40px 0 104px; }
.starts h2 { margin-bottom: 40px; }
.start-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.start { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.start p { color: var(--muted); max-width: 32ch; }
.start-link {
  margin-top: auto; padding-top: 6px;
  font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px;
  text-decoration-color: var(--filament-deep);
}
.start:hover .start-link { text-decoration-color: var(--ink); }
.examples { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); max-width: 70ch; }

/* Det kunden faktiskt har med sig: en fil, en länk eller en lapp */
.artifact { height: 92px; display: flex; align-items: center; margin-bottom: 14px; }
.file-chip, .link-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px 12px 12px; font-size: .9375rem; max-width: 100%;
  box-shadow: 0 1px 0 var(--line);
}
.file-glyph {
  flex: none; width: 34px; height: 42px; border-radius: 4px;
  background: linear-gradient(225deg, var(--paper) 0 9px, var(--filament) 9px);
  position: relative;
  display: grid; place-items: end center; padding-bottom: 5px;
  font-size: .625rem; font-weight: 700; color: var(--on-filament);
}
.file-chip strong, .link-chip strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip small, .link-chip small { display: block; color: var(--muted); font-size: .8125rem; }
.link-glyph {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--paper);
  display: grid; place-items: center;
}
.link-glyph svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; }
.note {
  background: #FFF1B8; color: var(--on-filament); padding: 14px 18px 16px; border-radius: 3px;
  transform: rotate(-1.6deg);
  box-shadow: 0 6px 14px -8px rgba(28, 35, 32, .35);
  font-size: .9375rem; line-height: 1.35; max-width: 250px;
}
.note small { display: block; margin-top: 4px; color: #6B5A1F; font-size: .8125rem; }

/* ---------- Galleri ---------- */
.gallery { padding: 0 0 104px; }
.demo-note { display: inline-block; margin: -20px 0 24px; padding: 6px 12px; border-radius: 8px; background: var(--note); font-size: .875rem; font-weight: 500; }
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
.gallery-item button {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: zoom-in; border-radius: 16px;
}
.gallery-item button:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
.gallery-item img {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; background: var(--bg-subtle);
  transition: transform .25s ease;
}
.gallery-item button:hover img { transform: translateY(-3px); }
.gallery-caption { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; margin-top: 14px; }
.gallery-caption strong { font-size: 1.0625rem; font-weight: 600; }
.gallery-caption span { color: var(--muted); font-size: .9375rem; grid-column: 1; }
.gallery-caption em { grid-column: 2; grid-row: 1; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

.lightbox { padding: 0; border: 0; border-radius: 20px; max-width: min(960px, calc(100% - 32px)); width: 100%; background: var(--surface); color: var(--ink); }
.lightbox::backdrop { background: rgba(28, 35, 32, .72); }
.lightbox-inner { display: grid; grid-template-columns: 1.1fr 1fr; }
.lightbox img { width: 100%; height: 100%; max-height: 80vh; object-fit: cover; display: block; background: var(--bg-subtle); }
.lightbox-text { padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.lightbox-text h3 { font-size: 1.625rem; }
.lb-details { color: var(--muted); }
.lightbox-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 16px; }

/* ---------- Omdömen ---------- */
.reviews { padding: 0 0 104px; }
.reviews-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 32px; }
.reviews-score { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; }
.reviews .demo-note { margin-top: -12px; }
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 18px; height: 18px; fill: var(--bg-subtle); }
.stars svg.on { fill: var(--filament); }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.review {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 12px;
}
.review blockquote { margin: 0; font-size: 1.0625rem; line-height: 1.55; }
.review-by { margin-top: auto; font-size: .9375rem; }
.review-by span { color: var(--muted); margin-left: 6px; }
.review-reply { border-left: 3px solid var(--filament); padding-left: 12px; font-size: .9375rem; }
.review-reply strong { display: block; font-size: .8125rem; color: var(--muted); }
.review-reply p { margin-top: 2px; }
@media (max-width: 860px) {
  .review-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -20px; padding: 0 20px 8px; scrollbar-width: none; }
  .review-list::-webkit-scrollbar { display: none; }
  .review { flex: 0 0 82%; scroll-snap-align: start; }
}

/* Språkval i menyn */
.lang-link { font-weight: 600 !important; color: var(--ink) !important; }
@media (max-width: 860px) { .nav a.lang-link { display: inline; font-size: .9375rem; } }

/* ---------- Enkla sidor: följ beställning och omdöme ---------- */
.page-simple .site-header { border-bottom-color: var(--line); }
.simple-main { max-width: 760px; padding: 56px 0 80px; display: grid; gap: 20px; }
.simple-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; }
.simple-card:focus { outline: none; }
.simple-card h1 { font-size: clamp(1.875rem, 4vw, 2.5rem); letter-spacing: -0.03em; }
.simple-kicker { color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.simple-intro { color: var(--muted); margin: 12px 0 24px; max-width: 56ch; }
.simple-msg { padding: 14px 16px; border-radius: var(--r-sm); background: var(--note); }
.simple-msg.is-ok { background: var(--bg-subtle); }
.stack-form { display: grid; gap: 4px; }
.stack-form .btn { justify-self: start; margin-top: 12px; }
.simple-back a { color: var(--muted); }

.status-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-head h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
.status-cancelled { padding: 4px 10px; border-radius: 999px; background: var(--error-bg); color: var(--error); font-weight: 600; font-size: .875rem; }
.status-now { margin-top: 10px; font-size: 1.125rem; }
.status-facts { margin-top: 6px; color: var(--muted); }
.status-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; }
.status-steps li { position: relative; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; color: var(--muted); }
.status-steps li::before { content: ""; position: absolute; left: 13px; top: -10px; height: 20px; width: 2px; background: var(--line); }
.status-steps li:first-child::before { display: none; }
.status-steps .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.status-steps li.done, .status-steps li.current { color: var(--ink); }
.status-steps li.done .dot { background: var(--ink); border-color: var(--ink); }
.status-steps li.done::before { background: var(--ink); }
.status-steps li.current .dot { background: var(--filament); border-color: var(--filament-deep); box-shadow: 0 0 0 5px color-mix(in srgb, var(--filament) 30%, transparent); }
.status-steps li.current::before { background: var(--ink); }
.status-steps li > span:last-child { color: var(--muted); font-size: .875rem; }
.status-steps.is-cancelled li:not(.done) { opacity: .45; }
.status-result .btn { margin-top: 24px; }
.status-review-done { margin-top: 20px; font-weight: 600; }

.star-field { border: 0; padding: 0; margin: 0 0 12px; }
.star-field legend { font-weight: 600; font-size: .9375rem; padding: 0; margin-bottom: 6px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; padding: 2px; border-radius: 6px; }
.star-input svg { width: 36px; height: 36px; fill: var(--bg-subtle); stroke: var(--border-input); stroke-width: 1; transition: fill .1s; }
.star-input input:checked ~ label svg,
.star-input label:hover svg, .star-input label:hover ~ label svg { fill: var(--filament); stroke: var(--filament-deep); }
.star-input input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (max-width: 600px) { .simple-card { padding: 22px 18px; } .simple-main { padding-top: 28px; } }

/* ---------- Om oss ---------- */
.about { padding: 104px 0 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; }
.about-grid.no-photo { grid-template-columns: minmax(0, 760px); }
.about-photo { margin: 0; }
.about-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; background: var(--bg-subtle); }
.about-text { margin-top: 20px; display: grid; gap: 16px; font-size: 1.125rem; line-height: 1.6; max-width: 58ch; }
.about-contact { margin-top: 28px; color: var(--muted); }
.about-contact a { color: var(--ink); text-decoration-color: var(--filament-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }

@media (max-width: 860px) {
  .gallery-grid {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: -20px; padding: 0 20px 8px; scrollbar-width: none;
  }
  .gallery-grid::-webkit-scrollbar { display: none; }
  .gallery-item { flex: 0 0 76%; scroll-snap-align: start; }
  .lightbox-inner { grid-template-columns: 1fr; }
  .lightbox img { max-height: 50vh; }
  .lightbox-text { padding: 22px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { max-width: 420px; }
}

/* ---------- Beställning ---------- */
.order-section { background: var(--surface); padding: 96px 0; border-block: 1px solid var(--line); }
.section-head { margin-bottom: 44px; max-width: 760px; }
.section-head p { color: var(--muted); max-width: 52ch; margin-top: 14px; font-size: 1.125rem; }

.order { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: start; }
.order-steps { display: grid; gap: 20px; }
.step {
  margin: 0; padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  min-width: 0;
}
.step legend {
  float: left; width: 100%;
  display: flex; align-items: center; gap: 12px;
  font-size: 1.375rem; font-weight: 700; letter-spacing: -0.015em;
  margin-bottom: 22px; padding: 0;
}
.step legend + * { clear: both; }
.step-no {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-size: 1rem;
}

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; background: var(--bg-subtle); border-radius: var(--r-md); margin-bottom: 20px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 11px 8px; border-radius: var(--r-sm); font-weight: 600; font-size: .9375rem; color: var(--muted); }
.segmented input:checked + span { background: var(--raised); color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); }
.segmented input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.drop {
  display: grid; gap: 6px; place-items: center; text-align: center;
  padding: 40px 20px;
  border: 2px dashed var(--rail); border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--ink); }
.drop.over { background: var(--note); }
.drop:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.drop-title { font-weight: 600; font-size: 1.0625rem; }
.drop-title u { text-decoration-color: var(--filament-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.drop-hint { color: var(--muted); font-size: .9375rem; }

.file-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.file-list:empty { display: none; }
.file-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: .9375rem;
}
.file-list .f-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-list .f-meta { color: var(--muted); margin-left: auto; white-space: nowrap; }
.file-list button { border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; text-decoration: underline; }
.file-list button:hover { color: var(--ink); }
.file-list .warn { color: var(--error); }

.hint { margin-top: 10px; color: var(--muted); font-size: .9375rem; }
.note-box { margin-top: 4px; padding: 14px 16px; background: var(--note); border-radius: var(--r-sm); font-size: .9375rem; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 600; font-size: .9375rem; }
.field input, .field textarea {
  font: inherit; color: var(--ink);
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-input); border-radius: var(--r-sm);
  background: var(--surface);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--filament); outline-offset: 0; border-color: var(--ink); }
.field input.invalid, .check input.invalid { border-color: var(--error); outline: 2px solid var(--error); }
.file-plain { padding: 10px !important; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.group { margin-bottom: 26px; }
.group:last-child { margin-bottom: 0; }
.group-label { font-weight: 600; margin-bottom: 10px; font-size: .9375rem; }
.group-value { font-weight: 400; color: var(--muted); margin-left: 6px; }
.group-row { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: start; }

.choices { display: grid; gap: 10px; }
.choices-3 { grid-template-columns: repeat(3, 1fr); }
.choices-2 { grid-template-columns: repeat(2, 1fr); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-body {
  display: grid; gap: 4px; height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-input); border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.choice-title { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.choice-price { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.choice-desc { color: var(--muted); font-size: .875rem; line-height: 1.4; }
.choice input:hover + .choice-body { border-color: var(--ink); }
.choice input:checked + .choice-body { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), 0 3px 0 var(--filament); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice input:disabled + .choice-body { opacity: .45; cursor: not-allowed; }
.compact .choice-body { padding: 12px 14px; }

.size-icon { width: 60px; height: 46px; margin-bottom: 6px; overflow: visible; }
.size-icon rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.75; }
.size-icon line { stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.choice input:checked + .choice-body .size-icon rect { fill: var(--filament); }

.measured {
  margin-bottom: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--ink); border-radius: var(--r-md);
  font-size: .9375rem;
}
.measured strong { font-variant-numeric: tabular-nums; }
.measured.too-big { border-color: var(--error); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span {
  display: block; width: 44px; height: 44px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(128, 138, 132, .45);
  transition: box-shadow .12s;
}
.swatch-any span { background: conic-gradient(#D0342C, #FFC93C, #2E8B57, #2457C5, #7B4FB8, #D0342C); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 5px; }

.stepper { display: inline-flex; border: 1px solid var(--border-input); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.stepper button { width: 46px; border: 0; background: none; font: 600 1.25rem/1 var(--font); cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--paper); }
.stepper input {
  background: var(--surface);
  width: 64px; text-align: center; border: 0; border-inline: 1px solid var(--line);
  font: 600 1.0625rem var(--font); padding: 12px 4px; color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.group-row .hint { max-width: 22ch; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: .9375rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.form-error { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--error-bg); color: var(--error); font-weight: 500; }

.hidden-field { position: absolute; left: -9999px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3D-förhandsvisning av kundens fil */
.preview {
  margin: 14px 0 0; border-radius: var(--r-md); overflow: hidden; position: relative;
  background:
    radial-gradient(circle at 50% 38%, var(--preview-glow) 0, var(--paper) 70%),
    var(--surface);
  border: 1px solid var(--line);
}
.preview canvas { display: block; width: 100%; aspect-ratio: 16 / 10; cursor: grab; touch-action: none; }
.preview canvas:active { cursor: grabbing; }
.preview canvas:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.preview figcaption {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); font-size: .875rem;
}
.preview figcaption span:first-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.preview-hint { color: var(--muted); }
.preview-fallback { display: none; margin: 0; padding: 16px; color: var(--muted); font-size: .9375rem; }
.preview.no-3d canvas, .preview.no-3d .preview-hint { display: none; }
.preview.no-3d .preview-fallback { display: block; }

/* Rabattkod i summeringen */
.code-box { margin: -8px 0 18px; }
.code-toggle, .code-applied button {
  border: 0; background: none; padding: 0; font: inherit; font-size: .875rem; color: #D5DCD7;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--filament); cursor: pointer;
}
.code-toggle:hover, .code-applied button:hover { color: #fff; }
.code-form { display: flex; gap: 8px; margin-top: 10px; }
.code-form input {
  flex: 1; min-width: 0; font: 600 .9375rem var(--font); letter-spacing: .04em; text-transform: uppercase;
  padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid #4E5B55; background: #1E2622; color: #fff;
}
.code-form input::placeholder { text-transform: none; letter-spacing: 0; color: #8C978F; font-weight: 400; }
.code-form input:focus { outline: 3px solid var(--filament); outline-offset: 0; border-color: var(--filament); }
.code-msg { margin: 8px 0 0; font-size: .875rem; color: #FFB4A8; }
.code-msg:empty { display: none; }
.code-applied { margin: 0; font-size: .875rem; color: #fff; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.code-applied span::before { content: "✓ "; color: var(--filament); font-weight: 700; }
.turnstile:not(:empty) { margin-top: 16px; }

/* Summering */
.summary { position: sticky; top: 96px; }
.summary-inner {
  background: var(--graphite); color: #EEF1EE;
  border-radius: var(--r-lg);
  padding: 28px;
}
.summary h3 { font-size: 1.25rem; margin-bottom: 18px; color: #fff; }
.lines { margin: 0; display: grid; gap: 0; }
.lines div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #3D4944; font-size: .9375rem; }
.lines dt { color: #AEB9B2; }
.lines dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.lines .discount dd { color: var(--filament); }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 20px 0 8px; }
.total span { color: #AEB9B2; }
.total output { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.sum-note { font-size: .875rem; color: #AEB9B2; margin-bottom: 22px; }
.sum-after { margin-top: 16px; font-size: .875rem; color: #AEB9B2; }

.thanks {
  max-width: 640px; margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 40px;
  display: grid; gap: 14px;
}
.thanks h3 { font-size: 1.75rem; }
.thanks .btn { justify-self: start; }
.thanks-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.pay { display: grid; gap: 10px; padding: 16px; background: var(--surface); border-radius: var(--r-md); }

.price-bar { display: none; }

/* ---------- Så funkar det ---------- */
/* Stegen som en utskrift som går från början till klar */
.how { padding: 104px 0; }
.how h2 { margin-bottom: 44px; }
.timeline {
  list-style: none; padding: 46px 0 0; margin: 0; position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
}
.timeline::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, var(--filament) 0 7px, var(--filament-deep) 7px 8px);
}
.timeline li { position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: -46px; width: 3px; height: 26px;
  background: var(--ink); border-radius: 2px;
}
.when { display: block; font-weight: 700; color: var(--when); margin-bottom: 6px; }
.timeline h3 { margin-bottom: 8px; }
.timeline p { color: var(--muted); max-width: 30ch; }

/* ---------- Material ---------- */
.materials { padding: 96px 0; background: var(--graphite); color: #EEF1EE; }
.materials .section-head p { color: #AEB9B2; }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid #3D4944; }
.mat-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.mat-table th, .mat-table td { text-align: left; padding: 20px 24px; vertical-align: top; }
.mat-table thead th { font-size: .875rem; font-weight: 600; color: #AEB9B2; border-bottom: 1px solid #3D4944; }
.mat-table tbody tr + tr { border-top: 1px solid #3D4944; }
.mat-table tbody th { font-size: 1.25rem; white-space: nowrap; }
.mat-table tbody th span { display: block; font-size: .875rem; font-weight: 500; color: var(--filament); margin-top: 4px; }
.mat-table td:nth-child(2) { max-width: 36ch; color: #D5DCD7; }
.mat-table td:last-child { font-weight: 600; white-space: nowrap; }

/* Mobil: varje material blir ett eget kort i stället för en bred tabell att scrolla i sidled */
@media (max-width: 720px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .mat-table { min-width: 0; display: block; }
  .mat-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mat-table tbody { display: grid; gap: 12px; }
  .mat-table tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 14px 16px; padding: 20px; border: 1px solid #3D4944; border-radius: var(--r-lg); }
  .mat-table tbody tr + tr { border-top: 1px solid #3D4944; }
  .mat-table th, .mat-table td { padding: 0; }
  .mat-table tbody th { grid-column: 1; grid-row: 1; }
  .mat-table td:last-child { grid-column: 2; grid-row: 1; text-align: right; font-size: 1.0625rem; }
  .mat-table td:nth-child(2) { grid-column: 1 / -1; max-width: none; }
  .mat-table td:nth-child(3), .mat-table td:nth-child(4) { padding-top: 14px; border-top: 1px solid #3D4944; font-weight: 600; }
  .mat-table td:nth-child(4) { text-align: right; }
  .mat-table td:nth-child(3)::before, .mat-table td:nth-child(4)::before {
    content: attr(data-label); display: block; margin-bottom: 4px; font-size: .8125rem; font-weight: 500; color: #AEB9B2;
  }
}

.finish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; }
.finish { display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto 1fr; column-gap: 20px; row-gap: 6px; align-items: start; }
.finish-sample { grid-row: span 2; height: 96px; border-radius: var(--r-md); }
.finish p { color: #AEB9B2; }
.finish-standard { background: repeating-linear-gradient(180deg, #F0B92E 0 5px, #D9A21F 5px 6px, #F7C640 6px 7px); }
.finish-smooth { background: linear-gradient(180deg, #FFD15A, #EDB42A); }

/* ---------- FAQ ---------- */
.faq { padding: 104px 0; }
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.faq-intro { position: sticky; top: 104px; }
.faq-intro p { margin: 16px 0 24px; color: var(--muted); font-size: 1.125rem; max-width: 30ch; }
.faq-groups { display: grid; gap: 40px; }
.faq-group h3 { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-bottom: 12px; }

/* Ämnesflikar: ett ämne i taget */
.faq-tabs { display: grid; gap: 6px; margin: 0 0 28px; max-width: 320px; }
.faq-tabs button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%;
  font: 600 1rem var(--font); color: var(--ink); text-align: left;
  padding: 13px 16px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.faq-tabs button:hover { background: var(--hover); }
.faq-tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--ink); box-shadow: 0 3px 0 var(--filament); }
.faq-tabs button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.faq-count { font-size: .875rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.faq-groups.is-tabbed .faq-group h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.faq-groups.is-tabbed .faq-group:not([hidden]) { animation: faq-in .2s ease; }

.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.faq details + details { margin-top: 10px; }
.faq details:hover { border-color: var(--border-input); }
.faq details[open] { border-color: var(--ink); box-shadow: 0 3px 0 var(--filament); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 18px 18px 18px 22px; font-weight: 600; font-size: 1.0625rem; border-radius: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.faq summary::after {
  content: ""; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background:
    linear-gradient(var(--ink) 0 0) center / 12px 2px no-repeat,
    linear-gradient(var(--ink) 0 0) center / 2px 12px no-repeat,
    var(--paper);
  transition: transform .2s ease, background-color .2s;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
  background:
    linear-gradient(var(--on-filament) 0 0) center / 12px 2px no-repeat,
    linear-gradient(var(--on-filament) 0 0) center / 2px 12px no-repeat,
    var(--filament);
}
.faq-answer { padding: 0 22px 20px; }
.faq-answer p { color: var(--muted); max-width: 62ch; line-height: 1.6; }
.faq details[open] .faq-answer { animation: faq-in .2s ease; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  /* Rubrik, text, ämnen, frågor och sist knappen, i en kolumn */
  .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .faq-intro { display: contents; }
  .faq-intro h2 { order: 1; }
  .faq-intro p { order: 2; max-width: none; margin: 12px 0 20px; }
  .faq-tabs { order: 3; }
  .faq-groups { order: 4; margin-top: 16px; }
  .faq-intro .btn { order: 5; justify-self: start; margin-top: 24px; }
  /* Flikarna blir en rad som går att svepa i sidled */
  .faq-tabs {
    display: flex; max-width: none; gap: 8px; margin: 0 -20px; padding: 0 20px 4px;
    overflow-x: auto; scrollbar-width: none;
  }
  .faq-tabs::-webkit-scrollbar { display: none; }
  .faq-tabs button { width: auto; flex: none; padding: 10px 14px; border-color: var(--line); background: var(--surface); }
  .faq-count { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 56px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; align-items: start; }
.footer-inner p { color: var(--muted); margin-top: 8px; }
.footer-col h2 { font-size: 1rem; letter-spacing: 0; }
.footer-inner a:not(.brand) { color: var(--ink); text-decoration-color: var(--filament-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr 1fr; } .footer-inner > :first-child { grid-column: 1 / -1; } }

/* ---------- Responsivt ---------- */
@media (max-width: 1020px) {
  .order { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 860px) {
  .hero { padding-top: 20px; }
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-copy { padding-bottom: 8px; }
  .printer { width: min(100%, 380px); margin-left: auto; }
  .start-grid { grid-template-columns: 1fr; gap: 40px; }
  .finish-grid { grid-template-columns: 1fr; }
  /* Tidslinjen blir lodrät */
  .timeline { grid-template-columns: 1fr; padding: 0 0 0 40px; gap: 32px; }
  .timeline::before { left: 0; right: auto; top: 4px; bottom: 4px; width: 12px; height: auto;
    background: repeating-linear-gradient(180deg, var(--filament) 0 7px, var(--filament-deep) 7px 8px); }
  .timeline li::before { left: -40px; top: 10px; width: 26px; height: 3px; }
  .nav a:not(.btn) { display: none; }
  .nav { gap: 10px; }

  .price-bar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
    padding: 12px 12px 12px 18px;
    background: var(--graphite); color: #fff; border-radius: 16px;
    box-shadow: 0 10px 30px rgba(28, 35, 32, .25);
    transform: translateY(140%); transition: transform .25s ease;
  }
  .price-bar span { color: #AEB9B2; font-size: .875rem; }
  .price-bar strong { font-size: 1.25rem; margin-right: auto; font-variant-numeric: tabular-nums; }
  .price-bar.show { transform: none; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .step { padding: 20px 16px; }
  .choices-3 { grid-template-columns: 1fr; }
  .segmented { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .group-row { grid-template-columns: 1fr; gap: 22px; }
  .finish { grid-template-columns: 88px 1fr; }
  .thanks { padding: 28px 20px; }
  .order-section { padding-bottom: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
