/* Inloggning, nytt lösenord och onboarding */

/* ---------- Inloggning ---------- */
.auth {
  min-height: 100vh;
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.hero {
  position: relative;
  border-radius: 32px;
  background: var(--feature-bg);
  border: 1px solid var(--feature-border);
  color: var(--on-feature);
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-brand svg { color: var(--accent); }

.hero-body { display: flex; flex-direction: column; gap: 32px; }

.hero h1 {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-body p {
  max-width: 440px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--on-feature-2);
}

.hero-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: #8A919C; }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-box {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--tabs-bg);
}

.tab {
  height: 44px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-card); }

.auth-head { display: flex; flex-direction: column; gap: 8px; }
.auth-head h2 { font-size: 32px; font-weight: 400; letter-spacing: -0.02em; }
.auth-head p { font-size: 15px; line-height: 1.5; color: var(--text-2); }

.fine-print { font-size: 13px; line-height: 1.5; color: var(--text-2); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; padding: 16px; gap: 24px; }
  .hero { padding: 28px; border-radius: 24px; }
  .hero-visual, .hero-body p { display: none; }
  .hero h1 { font-size: 32px; }
  .auth-panel { align-items: flex-start; }
}

/* ---------- Inloggning: rörelse, info och verktyg ----------
   Undantag från regeln om inga oändliga animationer: bara transform och opacity på några få
   element, så det kostar nästan inget. Stängs av vid "minska rörelse". */
.hero::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 62%);
  opacity: .5;
  pointer-events: none;
}
.hero > * { position: relative; }

.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* Tema och språk: ett litet glasreglage uppe i hörnet */
.auth-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--on-feature) 14%, transparent);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--on-feature) 6%, transparent);
}
.auth-tools button {
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--on-feature-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.auth-tools .tool-btn { padding: 0; width: 32px; }
.auth-tools button:hover { color: var(--on-feature); background: color-mix(in srgb, var(--on-feature) 10%, transparent); }
.auth-tools .tool-lang[aria-pressed="true"] { color: var(--on-feature); background: color-mix(in srgb, var(--on-feature) 16%, transparent); }
.tool-sep { width: 1px; height: 16px; margin: 0 4px; background: color-mix(in srgb, var(--on-feature) 18%, transparent); }

/* Omloppsbanan runt björnen */
.hero-visual { position: relative; width: 300px; max-width: 100%; aspect-ratio: 1; align-self: flex-start; }
.orbit { width: 100%; height: 100%; overflow: visible; }
.core-a { stop-color: var(--accent); stop-opacity: .35; }
.core-b { stop-color: var(--accent); stop-opacity: 0; }
.orbit-line { fill: none; stroke: color-mix(in srgb, var(--on-feature) 16%, transparent); stroke-width: 1; }
.orbit-line.is-dashed { stroke-dasharray: 2 7; }
.orbit-track { fill: none; stroke: color-mix(in srgb, var(--on-feature) 8%, transparent); stroke-width: 8; }
.orbit-arc { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 380 578; }
.orbit-dot { fill: var(--on-feature); }
.orbit-dot.is-dim { opacity: .5; }
.orbit-dot.is-accent { fill: var(--accent); }
.orbit-stars circle { fill: var(--on-feature); opacity: .5; }
.orbit-ring, .orbit-glow { transform-box: view-box; transform-origin: 160px 160px; }
.orbit-bear {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  transform: translate(-50%, -52%);
}

.orbit-a { animation: orbit-spin 70s linear infinite; }
.orbit-b { animation: orbit-spin 46s linear infinite reverse; }
.orbit-c { animation: orbit-spin 28s linear infinite; }
.orbit-arc { animation: orbit-draw 1.6s var(--ease-out) both; }
.orbit-glow { animation: orbit-breathe 5s ease-in-out infinite alternate; }
.orbit-stars circle { animation: orbit-twinkle 3.2s ease-in-out infinite alternate; }
.orbit-stars circle:nth-child(2n) { animation-delay: -1.6s; animation-duration: 4.1s; }
.orbit-stars circle:nth-child(3n) { animation-delay: -.8s; }
.orbit-bear { animation: bear-float 6s ease-in-out infinite alternate; }

@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes orbit-draw { from { stroke-dasharray: 0 578; } }
@keyframes orbit-breathe { from { opacity: .55; transform: scale(.94); } to { opacity: 1; transform: scale(1.06); } }
@keyframes orbit-twinkle { from { opacity: .15; } to { opacity: .8; } }
@keyframes bear-float { from { transform: translate(-50%, -52%); } to { transform: translate(-50%, -58%); } }

/* Info som rullar */
.facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 460px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--on-feature) 12%, transparent);
  border-radius: var(--r-card-sm);
  background: color-mix(in srgb, var(--on-feature) 5%, transparent);
  cursor: pointer;
  user-select: none;
}
.facts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.facts-kind { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.facts-dots { display: flex; margin: -8px -6px -8px 0; }
/* Knappen är större än pricken så att den är lätt att träffa med fingret */
.facts-dots button { width: 16px; height: 24px; padding: 0; border: none; background: transparent; display: grid; place-items: center; cursor: pointer; }
.facts-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--on-feature) 22%, transparent); transition: background .3s, transform .3s; }
.facts-dots button:hover i { background: color-mix(in srgb, var(--on-feature) 55%, transparent); }
.facts-dots button.is-on i { background: var(--on-feature); transform: scale(1.25); }
@media (max-width: 900px) { .facts-dots button { width: 18px; height: 32px; } }
.facts-text { min-height: 3em; font-size: 15px; line-height: 1.5; color: var(--on-feature) !important; }
.facts-kind, .facts-text { transition: opacity .35s ease, transform .35s ease; }
.facts.is-out .facts-kind, .facts.is-out .facts-text { opacity: 0; transform: translateY(6px); }

@media (max-width: 900px) {
  .facts { padding: 12px 14px; }
  .facts-text { font-size: 14px; min-height: 4.5em; }
  .hero::before { width: 320px; height: 320px; }
}
/* Språkbyte: formuläret tonas snabbt ut, och efter omladdningen visas sidan direkt utan intro */
body.is-switching .auth-box, body.is-switching .hero-body, body.is-switching .facts { opacity: 0; transition: opacity .12s ease; }
.no-intro .hero, .no-intro .auth-box, .no-intro .orbit-arc { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .orbit-ring, .orbit-arc, .orbit-glow, .orbit-stars circle, .orbit-bear { animation: none !important; }
}

/* ---------- Onboarding ---------- */
.ob {
  min-height: 100vh;
  padding: 0 72px 48px;
  display: flex;
  flex-direction: column;
}

.ob-header {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ob-progress {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}
.ob-progress span { height: 4px; border-radius: var(--r-pill); background: var(--line-strong); transition: background .4s var(--ease-out); }
.ob-progress span.is-done { background: var(--accent); }

.ob-grid {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 48px;
  align-items: center;
  padding: 40px 0;
}

.ob-question {
  grid-column: span 7;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.ob-intro { display: flex; flex-direction: column; gap: 14px; }
.ob-step { color: var(--accent); font-size: 13px; }

.ob-intro h1 {
  font-size: 46px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.ob-intro p {
  max-width: 620px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-3);
}

.ob-input-row { display: flex; align-items: center; gap: 12px; }

.ob-input {
  flex-grow: 1;
  height: 64px;
  padding: 0 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  font-size: 20px;
  transition: border-color .15s, box-shadow .15s;
}
.ob-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }

.ob-suffix { font-size: 17px; color: var(--text-2); white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}
.chip:hover { border-color: var(--text); }

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option {
  min-height: 68px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 18px;
  border: 1.5px solid var(--line-strong);
  background: var(--glass);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.option:hover { border-color: var(--text-2); }
.option-dot {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
}
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--surface); }
.option[aria-pressed="true"] .option-dot { border-color: var(--accent); background: var(--accent); }

.ob-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.back-button {
  height: 48px;
  padding: 0 20px 0 0;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-3);
  cursor: pointer;
}
.back-button:disabled { color: var(--text-faint); cursor: default; }

.btn-next { height: 52px; padding: 0 28px; font-size: 15px; }
.btn-next:disabled { background: var(--text-muted); border-color: var(--text-muted); opacity: 1; }

.ob-profile {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ob-profile-head { display: flex; align-items: center; gap: 12px; }
.ob-profile-head h2 { font-size: 17px; font-weight: 500; }
.ob-profile-head span { font-size: 13px; color: var(--text-2); }

.ob-profile dl { margin: 0; display: flex; flex-direction: column; }
.ob-profile dl div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  border-bottom: 1px solid var(--subtle);
}
.ob-profile dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-2); }
.ob-profile dd { margin: 0; font-size: 15px; text-align: right; color: var(--text-muted); }
.ob-profile dd.is-set { color: var(--text); }
.ob-profile dd.is-current { color: var(--accent); }
.ob-profile p { font-size: 13px; line-height: 1.6; color: var(--text-3); }

@media (max-width: 900px) {
  .ob { padding: 0 16px 32px; }
  .ob-header { height: 72px; }
  .ob-grid { grid-template-columns: 1fr; gap: 32px; align-items: start; padding: 32px 0; }
  .ob-question, .ob-profile { grid-column: auto; }
  .ob-intro h1 { font-size: 32px; }
  .options { grid-template-columns: 1fr; }
}

/* Startfrågorna: hushållets inkomster, en rad per inkomst */
.income-list { display: flex; flex-direction: column; gap: 10px; }
.income-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 36px; align-items: center; gap: 10px; }
.income-row .ob-input { height: 54px; padding: 0 16px; font-size: 17px; border-radius: 14px; width: 100%; min-width: 0; }
.income-amount { display: flex; align-items: center; gap: 8px; }
.income-amount .ob-input { text-align: right; }
.income-amount .ob-suffix { font-size: 15px; }
.income-remove { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--text-3); font-size: 14px; cursor: pointer; }
.income-remove:hover { background: var(--subtle); color: var(--text); }
.income-remove[hidden] { display: block; visibility: hidden; }
@media (max-width: 600px) {
  .income-row { grid-template-columns: minmax(0, 1fr) 118px 30px; gap: 6px; }
  .income-row .ob-input { height: 46px; padding: 0 12px; font-size: 16px; border-radius: 12px; }
  .income-amount { gap: 4px; }
  .income-amount .ob-suffix { font-size: 13px; }
  .income-remove { width: 30px; height: 30px; }
}

/* Startfrågorna: ett yrke per inkomst */
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); align-items: center; gap: 12px; }
.job-name { overflow: hidden; font-size: 15px; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.job-row .ob-input { width: 100%; min-width: 0; height: 54px; padding: 0 16px; font-size: 17px; border-radius: 14px; }
@media (max-width: 600px) {
  .job-row { grid-template-columns: 1fr; gap: 4px; }
  .job-name { font-size: 13px; }
  .job-row .ob-input { height: 46px; padding: 0 12px; font-size: 16px; border-radius: 12px; }
}

/* Startfrågorna öppnade från bekräftelsemejlet */
.ob-confirmed[hidden] { display: none; }
.ob-confirmed { margin-bottom: 8px; font-size: 13px; line-height: 1.5; }

/* Avbryt uppe till höger i startfrågorna */
.ob-header-end { display: flex; align-items: center; gap: 14px; }
.ob-cancel { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.ob-cancel:hover { color: var(--text); border-color: var(--line-strong); background: var(--subtle); }
@media (max-width: 600px) {
  .ob-header-end .label { display: none; }
}

/* Kodfältet när man går med i någons ekonomi */
.ob-code { max-width: 260px; font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
