/**
 * Publika sidornas designsystem.
 *
 * Paletten är hämtad direkt ur logotypen: de tre frågetecknen (blå, rosa,
 * citron) och den svarta ordbilden. Delas av startsidan (valen), /privat och
 * /business så de inte glider isär.
 */

:root {
  --blue: #3146F1;
  --blue-deep: #2233C4;
  --pink: #EF6E94;
  --pink-deep: #C7405F;
  --citron: #CFD130;
  --citron-deep: #A5A81F;
  --ink: #0B0B12;
  --ink-soft: #23242E;
  --paper: #FFFFFF;
  --mist: #F4F5FA;
  --line: #E4E6F0;
  --muted: #5C6070;
  --radius: 16px;
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.container { width: min(1120px, 100% - 3rem); margin-inline: auto; }

/* ============ Knappar ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn--blue {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 24px rgba(49, 70, 241, 0.28);
}
.btn--blue:hover {
  background: var(--blue-deep);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(49, 70, 241, 0.34);
}

.btn--pink {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 8px 24px rgba(239, 110, 148, 0.3);
}
.btn--pink:hover {
  background: var(--pink-deep);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(239, 110, 148, 0.36);
}

.btn--ink {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 24px rgba(11, 11, 18, 0.22);
}
.btn--ink:hover {
  background: var(--ink-soft);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(11, 11, 18, 0.28);
}

.btn--citron { background: var(--citron); color: var(--ink); }
.btn--citron:hover { background: #DCDE45; transform: translateY(-1px); }

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--line);
}
.btn--outline:hover { border-color: var(--ink); }

/* ============ Nav ============ */

.nav { padding: 1.25rem 0; }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand img { height: 38px; width: auto; display: block; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav__link { color: var(--muted); transition: color 0.2s ease; }
.nav__link:hover { color: var(--ink); }

.nav__login {
  padding: 0.55rem 1.35rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.nav__login:hover { border-color: var(--ink); }

/* ============ Typografi ============ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--citron);
  box-shadow: 0 0 0 4px rgba(207, 209, 48, 0.25);
}

.section { padding: 5.5rem 0; }
.section--mist { background: var(--mist); }

.section-head { max-width: 56ch; margin-bottom: 3rem; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 0.75rem;
}
.section-sub { color: var(--muted); font-size: 1.05rem; }

/* ============ Spelkod ============ */

.joinbox {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.25rem;
  max-width: 460px;
  box-shadow: 0 12px 40px rgba(11, 11, 18, 0.06);
}
.joinbox__label {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  display: block;
}
.joinbox__row { display: flex; gap: 0.6rem; }
.joinbox__input {
  flex: 1;
  min-width: 0;
  background: var(--mist);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.joinbox__input::placeholder { color: #9AA0B4; letter-spacing: 0.16em; }
.joinbox__input:focus { outline: none; border-color: var(--blue); background: var(--paper); }

/* ============ Footer ============ */

.footer { padding: 3rem 0 2.2rem; background: var(--paper); }
.footer__grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.2rem;
}
.footer__desc { color: var(--muted); font-size: 0.92rem; max-width: 34ch; margin-top: 0.9rem; }
.footer__links {
  list-style: none;
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
.footer__links a, .footer__links button {
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}
.footer__links a:hover, .footer__links button:hover { color: var(--ink); }
.footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #8B90A2;
}
.footer__bottom a { color: var(--muted); }

/* ============ Konto-modal ============ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 18, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  overflow-y: auto;
}
.modal-backdrop.is-open { display: flex; }

.modal {
  background: var(--paper);
  border-radius: 20px;
  width: min(430px, 100%);
  padding: 2rem;
  box-shadow: 0 30px 80px rgba(11, 11, 18, 0.25);
  margin: auto;
}

/* ---------- XL: information till vänster, konto till höger ---------- */

.modal--xl {
  position: relative;
  width: min(940px, 100%);
  padding: 0;
  overflow: hidden;
}

.modal__grid {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
}

/* Infosidan bär rosa — färgen på valet den hör till. Blått och citron
   används som sekundära accenter på stegen. */
.modal__info {
  background: linear-gradient(150deg, var(--pink) 0%, #E05A83 60%, var(--pink-deep) 100%);
  color: #fff;
  padding: clamp(1.75rem, 3vw, 2.6rem);
  display: flex;
  flex-direction: column;
}

/* Inloggning gäller båda kontotyperna — den panelen är därför mörk och
   färgneutral i stället för att bära rosa (privat) eller blått (organisation). */
.modal__info--neutral {
  background: linear-gradient(150deg, var(--ink-soft) 0%, var(--ink) 100%);
  justify-content: center;
}
.modal__info--neutral .modal__info-eyebrow { opacity: 0.6; }

.modal__info-text {
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.88;
}

.modal__info[hidden] { display: none; }

.modal__info-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.modal__info-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 1.5rem;
}

.modal__steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 0 0 auto;
  padding: 0;
}
.modal__steps li { display: flex; gap: 0.85rem; align-items: flex-start; }
.modal__steps strong { display: block; font-weight: 700; margin-bottom: 0.1rem; }
.modal__steps span span, .modal__steps li > span:last-child {
  font-size: 0.93rem;
  line-height: 1.4;
}
.modal__steps li > span:last-child { opacity: 0.92; }

.modal__step-num {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
}
.modal__step-num--blue { background: var(--blue); color: #fff; }
.modal__step-num--citron { background: var(--citron); color: var(--ink); }
.modal__step-num--white { background: #fff; color: var(--pink-deep); }

.modal__info-note {
  margin-top: 1.75rem;
  font-size: 0.88rem;
  opacity: 0.9;
}
.modal__info-note a { text-decoration: underline; text-underline-offset: 3px; }
.modal__info-note a:hover { opacity: 0.8; }

.modal__forms { padding: clamp(1.5rem, 2.5vw, 2.25rem); }

.modal__close--float {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  z-index: 2;
  color: var(--muted);
}
.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.modal__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.modal__close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
}
.modal__close:hover { color: var(--ink); }

.modal__tabs {
  display: flex;
  gap: 0.3rem;
  background: var(--mist);
  border-radius: 999px;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
}
.modal__tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal__tab:hover { color: var(--ink); }
.modal__tab.is-active { background: var(--blue); color: #fff; }
.modal--xl .modal__tab.is-active { background: var(--pink); color: #fff; }
/* Inloggningsfliken hör inte till någon quiztyp — håll den i bläck. */
.modal--xl .modal__tab[data-tab="login"].is-active { background: var(--ink); }

.modal__pane[hidden] { display: none; }
/* Rubrik i formulärspalten när modalen körs utan flikar (enkelspårigt läge). */
.modal__pane-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.modal__lead { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.2rem; }

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.field input {
  width: 100%;
  background: var(--mist);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.98rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input::placeholder { color: #9AA0B4; }
.field input:focus { outline: none; border-color: var(--blue); background: var(--paper); }
.modal--xl .field input:focus { border-color: var(--pink); }
.modal--xl .modal__pane[data-pane="login"] .field input:focus { border-color: var(--ink); }
.modal--xl .modal__forgot:hover { color: var(--pink-deep); }
.modal--xl .modal__register a { color: var(--pink-deep); }

.modal__forgot {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
  margin: -0.3rem 0 1.2rem;
}
.modal__forgot:hover { color: var(--blue); }
.modal .btn { width: 100%; }

.modal__divider { border-top: 1px solid var(--line); margin: 1.5rem 0 1.2rem; }
.modal__register {
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.modal__register a { color: var(--blue); font-weight: 600; }
.modal__register a:hover { text-decoration: underline; }

/* ============ Responsivt ============ */

@media (max-width: 960px) {
  .nav__link--hideable { display: none; }
}

/* XL-modalen staplas: informationen först, konto under. */
@media (max-width: 820px) {
  .modal__grid { grid-template-columns: 1fr; }
  .modal__info { padding: 1.5rem 1.4rem; }
  .modal__info-title { margin-bottom: 1.1rem; }
  .modal__steps { gap: 0.85rem; }
  .modal__info-note { margin-top: 1.25rem; }
  .modal__forms { padding: 1.4rem; }
}
@media (max-width: 520px) {
  .joinbox__row { flex-direction: column; }
  .brand img { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
