/* -----------------------------------------------
   Fritidskortet API - fritidskortet.dev
   -----------------------------------------------
   Palette derived from fritidskortet.se, layout
   modelled on ehalsomyndigheten.se
   ----------------------------------------------- */

:root {
  --color-primary: #5800ff;
  --color-primary-dark: #4600cc;
  --color-primary-light: #f7f3ff;
  --color-accent: #ff9680;
  --color-text: #1a1a2e;
  --color-text-secondary: #4e4e66;
  --color-bg: #ffffff;
  --color-bg-alt: #f4f3f8;
  --color-border: #d9d5e4;
  --font-heading: "Work Sans", system-ui, -apple-system, sans-serif;
  --font-body: "Lexend", system-ui, -apple-system, sans-serif;
  --max-w: 1040px;
  --radius: 4px;
}

/* ---- Reset ---- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; }

/* ---- Layout ---- */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 700px) {
  .container { padding: 0 2rem; }
}

/* ---- Skip link ---- */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
  padding: .5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  font-size: .875rem;
}
.skip-link:focus { left: 0; }

/* ---- Utility bar ---- */

.utility-bar {
  background: var(--color-text);
  color: rgba(255,255,255,.7);
  font-size: .8125rem;
  line-height: 1;
}
.utility-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
}
.utility-bar nav { display: flex; gap: 1.25rem; }
.utility-bar a {
  color: rgba(255,255,255,.7);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: color .15s;
}
.utility-bar a:hover { color: #fff; }
.utility-label { font-weight: 500; letter-spacing: .02em; }

/* ---- Header ---- */

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
}
.logo-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
}
.logo-api {
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* Navigation */
.main-nav { display: flex; align-items: center; gap: 1.75rem; }
.main-nav a {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color .15s;
}
.main-nav a:hover { color: var(--color-primary); }
.nav-cta {
  background: var(--color-primary);
  color: #fff !important;
  padding: .45rem 1.1rem;
  border-radius: var(--radius);
  transition: background .15s !important;
}
.nav-cta:hover { background: var(--color-primary-dark) !important; }

.menu-toggle { display: none; }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .95rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline {
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ---- Hero ---- */

.hero {
  background: var(--color-primary-light);
  padding: 3.5rem 0 4rem;
  border-bottom: 1px solid var(--color-border);
}
.hero .container {
  max-width: var(--max-w);
}
.hero-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: .75rem;
}
.hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: 1rem;
}
.hero-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 520px;
  margin-bottom: 1.75rem;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Feature card muted variant */
.feature-card-muted {
  border-style: dashed;
  background: var(--color-bg-alt);
}
.feature-card-muted .feature-icon { opacity: .5; }
.feature-card-muted h3 { color: var(--color-text-secondary); }

/* ---- Section base ---- */

.section { padding: 4.5rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-form { background: var(--color-primary-light); }
.section-intro { max-width: 600px; margin-bottom: 2.5rem; }
.section-intro h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1.25;
  margin-bottom: .65rem;
}
.section-intro p {
  color: var(--color-text-secondary);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* ---- Feature cards ---- */

.features-grid {
  display: grid;
  gap: 1.25rem;
}
.feature-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  background: var(--color-bg);
  transition: border-color .2s;
}
.feature-card:hover { border-color: var(--color-primary); }
.feature-icon {
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: .4rem;
}
.feature-card p {
  color: var(--color-text-secondary);
  font-size: .92rem;
  line-height: 1.6;
}

/* ---- Organisation grid ---- */

.org-grid {
  display: grid;
  gap: 1rem;
}
.org-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 2px;
  padding: 1.15rem 1.35rem;
  transition: border-left-color .2s, box-shadow .2s;
}
.org-card:hover {
  border-left-color: var(--color-accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.org-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: .25rem;
}
.org-card p {
  color: var(--color-text-secondary);
  font-size: .88rem;
  line-height: 1.55;
}
.org-note {
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--color-text-secondary);
}
.org-note a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.org-note a:hover { text-decoration: none; }

/* ---- Steps ---- */

.steps-grid {
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: .2rem;
}
.step-num {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}
.step h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  align-self: end;
}
.step p {
  color: var(--color-text-secondary);
  font-size: .9rem;
  line-height: 1.55;
}

/* ---- Form ---- */

.form-wrapper {
  max-width: 680px;
}
.form-row {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-group { display: flex; flex-direction: column; }
.form-group.full { margin-bottom: 1rem; }

label {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: .9rem;
  margin-bottom: .35rem;
  color: var(--color-text);
}
.req { color: var(--color-primary); }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  font-size: .95rem;
  color: var(--color-text);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(88,0,255,.1);
}
input::placeholder, textarea::placeholder {
  color: #aaa8b8;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234e4e66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.5rem;
}

textarea { resize: vertical; min-height: 100px; }

.form-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.form-note {
  font-size: .82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.btn-submit { min-width: 200px; }

/* Invalid state after attempted submit */
.was-validated input:invalid,
.was-validated select:invalid,
.was-validated textarea:invalid {
  border-color: #d64040;
}
.was-validated input:invalid:focus,
.was-validated select:invalid:focus,
.was-validated textarea:invalid:focus {
  box-shadow: 0 0 0 3px rgba(214,64,64,.12);
}

/* Success */
.form-success {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text);
}
.success-check {
  color: #1a9a5a;
  margin: 0 auto 1.25rem;
}
.form-success h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: .5rem;
}
.form-success p {
  color: var(--color-text-secondary);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ---- Products (lösningar) ---- */

.hero-compact { padding: 3rem 0 3.5rem; }
.hero-compact .hero-desc { margin-bottom: 0; }

.products {
  display: grid;
  gap: 2rem;
}
.product {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  overflow: hidden;
  position: relative;
  transition: border-color .2s;
}
.product:hover { border-color: var(--color-primary); }
.product-badge {
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .4rem 1.25rem;
  display: inline-block;
}
.product-body { padding: 2rem; }
.product-header { margin-bottom: 1rem; }
.product-header h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: .2rem;
}
.product-tagline {
  font-size: .9rem;
  color: var(--color-text-secondary);
}
.product-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  max-width: 600px;
}
.product-features {
  display: grid;
  gap: .6rem;
  margin-bottom: 2rem;
}
.product-features li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--color-text);
}
.product-features svg {
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 2px;
}
.product-actions { display: flex; gap: .75rem; }

.nav-active { color: var(--color-primary) !important; }

.cta-block {
  max-width: 560px;
}
.cta-block h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
  margin-bottom: .65rem;
}
.cta-block p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ---- Footer ---- */

.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  padding: 3.5rem 0 0;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
  margin-bottom: .5rem;
}
.footer-about p:last-child {
  font-size: .85rem;
  line-height: 1.6;
}
.footer-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  color: rgba(255,255,255,.9);
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.footer-links li + li, .footer-contact li + li { margin-top: .4rem; }
.footer-links a, .footer-contact a {
  color: rgba(255,255,255,.6);
  transition: color .15s;
}
.footer-links a:hover, .footer-contact a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: rgba(255,255,255,.4);
}
.footer-bottom nav { display: flex; gap: 1.25rem; }
.footer-bottom a { color: rgba(255,255,255,.4); transition: color .15s; }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }

/* --------------------------------------------------
   Responsive
   -------------------------------------------------- */

/* Tablet — 700px */
@media (min-width: 700px) {
  .hero { padding: 4.5rem 0 5rem; }
  .hero h1 { font-size: 2.5rem; }

  .features-grid { grid-template-columns: repeat(3, 1fr); }

  .org-grid { grid-template-columns: repeat(2, 1fr); }

  .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }

  .form-row { grid-template-columns: 1fr 1fr; }

  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }

  .products { grid-template-columns: repeat(2, 1fr); }
  .product-features { grid-template-columns: 1fr; }
}

/* Desktop — 1024px */
@media (min-width: 1024px) {
  .hero h1 { font-size: 2.75rem; }

  .org-grid { grid-template-columns: repeat(3, 1fr); }

  .steps-grid { grid-template-columns: repeat(4, 1fr); }

  .section { padding: 5.5rem 0; }
}

/* Mobile nav — below 700px */
@media (max-width: 699px) {
  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: 260px;
    background: var(--color-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 5rem 1.5rem 2rem;
    gap: 0;
    transform: translateX(100%);
    transition: transform .3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,.08);
    z-index: 150;
  }
  .main-nav a {
    padding: .85rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
  }
  .nav-cta {
    margin-top: .75rem;
    text-align: center;
    border-bottom: 0 !important;
  }
  body.nav-open .main-nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 200;
  }
  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform .25s, opacity .2s;
  }
  body.nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

}
