/* =================================================================
   Signup form
   Paletten är hämtad ur loggan: bläck #231F20, is #A0DDF9, vitt.
   Två teman styrs av <html data-theme="light|dark">.
   ================================================================= */

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-latin-300-normal.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --ice:     #a0ddf9;
  --ice-dim: #7cc9ee;

  --edge:  2px;
  --shell: 660px;
}

/* ---------- Ljust tema: snö och dagsljus ---------- */
:root,
[data-theme="light"] {
  --bg:          #ffffff;
  --bg-tint:     #f2fafe;
  --field:       #ffffff;
  --line:        #d3e6f1;
  --line-strong: #231f20;
  --ink:         #16191c;
  --ink-soft:    #5c6771;
  --accent:      var(--ice);
  --accent-text: #0f5f85;
  --on-accent:   #16191c;
  --danger:      #a32017;
  --danger-bg:   #fdeceb;
  --danger-line: #d9534f;
  --shadow:      0 1px 2px rgba(35, 31, 32, 0.06);
  --show-in-light: block;
  --show-in-dark:  none;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg:          #0d0f12;
  --bg-tint:     #12161c;
  --field:       #1b2028;
  --line:        #2c333d;
  --line-strong: #46505c;
  --ink:         #eef4f7;
  --ink-soft:    #98a4b0;
  --accent:      var(--ice);
  --accent-text: var(--ice);
  --on-accent:   #0d0f12;
  --danger:      #ffb3ad;
  --danger-bg:   #2a1614;
  --danger-line: #c9524d;
  --shadow:      none;
  --show-in-light: none;
  --show-in-dark:  block;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 32px 20px 96px;
}

/* ---------- Sidhuvud ---------- */
.masthead {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
}

.mark {
  width: 46px;
  height: auto;
  flex: none;
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: 21px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
}

.wordmark b { font-weight: 500; }

.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--edge);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--bg-tint);
}

.theme-toggle svg { width: 15px; height: 15px; flex: none; }
.theme-toggle .icon-to-dark  { display: var(--show-in-light); }
.theme-toggle .icon-to-light { display: var(--show-in-dark); }
.theme-toggle .label-to-dark  { display: var(--show-in-light); }
.theme-toggle .label-to-light { display: var(--show-in-dark); }

@media (max-width: 520px) {
  .theme-toggle span:not(.sr) { display: none; }
  .theme-toggle { padding: 9px 11px; }
}

/* Fasetterad kant: samma vinklar som märket. */
.ridge {
  display: block;
  width: 100%;
  height: 10px;
  color: var(--accent);
  margin-bottom: 34px;
}

/* ---------- Rubrik ---------- */
.page-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.01em;
  line-height: 1.12;
}

.intro {
  margin: 0 0 34px;
  max-width: 48ch;
  color: var(--ink-soft);
}

/* ---------- Signaturen: fasetterade steg ---------- */
.progress { margin: 0 0 34px; }

.progress ol {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.progress li {
  display: flex;
  align-items: center;
  flex: 1;
}

.progress li:last-child { flex: none; }

.facet {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  flex: none;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  background: var(--line);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: background 0.2s;
}

.facet::after {
  content: '';
  grid-area: 1 / 1;
  display: block;
  width: 32px;
  height: 36px;
  background: var(--bg);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: background 0.2s;
}

.facet span {
  grid-area: 1 / 1;
  z-index: 1;
  color: var(--ink-soft);
  transition: color 0.2s;
}

.progress li.is-current .facet { background: var(--line-strong); }
.progress li.is-current .facet::after { background: var(--accent); }
.progress li.is-current .facet span { color: var(--on-accent); }

.progress li.is-done .facet { background: var(--ice-dim); }
.progress li.is-done .facet::after { background: var(--bg-tint); }
.progress li.is-done .facet span { color: var(--accent-text); }

.connector {
  height: 2px;
  flex: 1;
  background: var(--line);
  margin: 0 7px;
  transition: background 0.2s;
}

.progress li.is-done .connector { background: var(--ice-dim); }

.step-count {
  margin: 0;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Fält ---------- */
.field, .group { margin: 0 0 24px; }

.group {
  border: 0;
  padding: 0;
  min-inline-size: 0;
}

label, legend {
  display: block;
  padding: 0;
  margin: 0 0 7px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

label.sub {
  margin: 6px 0 0;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.req { color: var(--danger-line); margin-left: 3px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--edge);
  box-shadow: var(--shadow);
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 0.7; }

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
textarea:hover,
select:hover { border-color: var(--line-strong); }

textarea { resize: vertical; min-height: 104px; line-height: 1.5; }

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ice-dim);
  box-shadow: 0 0 0 3px rgba(160, 221, 249, 0.45);
}

:focus-visible {
  outline: 2px solid var(--ice-dim);
  outline-offset: 2px;
}

[aria-invalid="true"] {
  border-color: var(--danger-line);
  box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.2);
}

.row { margin-bottom: 12px; }
.row:last-child { margin-bottom: 0; }

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .row-2 { grid-template-columns: 1fr; }
}

.cell { min-width: 0; }

@media (min-width: 620px) {
  .field.half > input,
  .field.half > select { max-width: 390px; }
}

.help, .note {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.note {
  max-width: 62ch;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.note strong { color: var(--ink); font-weight: 600; }

.help a, .card a { color: var(--accent-text); }

.error {
  margin: 7px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

/* ---------- Reglaget ---------- */
input[type="range"] {
  width: 100%;
  max-width: 430px;
  height: 24px;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 22px;
  margin-top: -8px;
  background: var(--ice-dim);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 22px;
  border: 0;
  background: var(--ice-dim);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.range-value {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.range-value output {
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
}

/* ---------- Villkor ---------- */
.terms {
  margin-top: 32px;
  padding: 18px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--edge);
}

label.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  font-weight: 400;
  font-size: 15px;
  cursor: pointer;
}

label.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--ice-dim);
}

label.check.has-error span { color: var(--danger); }

/* ---------- Knappar ---------- */
.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.btn {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 13px 30px;
  border-radius: var(--edge);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
}

.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
  margin-right: auto;
}

.btn.ghost:hover { color: var(--ink); border-color: var(--line-strong); filter: none; }

.btn[disabled] { opacity: 0.55; cursor: progress; }

/* ---------- Meddelanden ---------- */
.alert {
  margin: 0 0 26px;
  padding: 13px 16px;
  border-radius: var(--edge);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
  font-size: 14.5px;
  border-left: 3px solid var(--danger-line);
}

.card {
  padding: 34px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--edge);
}

.card h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
}

.card p { margin: 0; color: var(--ink-soft); max-width: 52ch; }

/* ---------- Steg ---------- */
.js .step { display: none; }
.js .step.is-active { display: block; }

/* ---------- Tillgänglighet ---------- */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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