:root {
  /* Färg- och layoutvariabler. Dessa gör det lätt att ändra designen på ett ställe. */
  --navy: #1e3765;
  --blue: #2f5fa7;
  --sky: #6db5ff;
  --white: #fff;
  --ink: #17233a;
  --muted: #65738a;
  --line: #dbe6f5;
  --soft: #f4f8fd;
  --shadow: 0 18px 45px rgba(30, 55, 101, 0.16);
  --radius: 8px;
  --max: 1180px;
  --header: 78px;
}

* {
  /* Gör att padding och border räknas in i elementets totala bredd. */
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  /* Grundstil för hela sidan. */
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy);
  line-height: 1.1;
}

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.nav,
.section-inner {
  /* Gemensam maxbredd som håller innehållet snyggt centrerat. */
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.skip-link {
  /* Tillgänglighetslänk för personer som navigerar med tangentbord. */
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--white);
  background: var(--navy);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  /* Fast navigation som ligger kvar högst upp när man scrollar. */
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(219, 230, 245, 0.82);
  backdrop-filter: blur(16px);
  transition: 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(30, 55, 101, 0.1);
}

.nav {
  /* Flexbox placerar logotypen till vänster och menyn till höger. */
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand-logo {
  width: 190px;
  max-height: 66px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.nav-menu {
  /* Desktopmenyn ligger horisontellt. På mobil ändras den längre ned i media query. */
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--navy);
  font-weight: 700;
}

.nav-menu > a:not(.btn) {
  position: relative;
  padding-block: 8px;
}

.nav-menu > a:not(.btn)::after {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  content: "";
  background: var(--sky);
  transition: width 180ms ease;
}

.nav-menu > a:hover::after,
.nav-menu > a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  /* Mobilmenyknappen är dold på desktop och visas i media query. */
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px auto;
  background: var(--navy);
  transition: 180ms ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.btn {
  /* Återanvändbar knappstil för CTA-knappar. */
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  color: var(--white);
  background: var(--blue);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(47, 95, 167, 0.2);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  transition: 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--navy);
  border-color: var(--navy);
  transform: translateY(-1px);
}

.btn-small {
  min-height: 42px;
  padding: 10px 16px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: var(--navy);
  background: var(--white);
  border-color: var(--white);
}

.hero {
  /* Första stora sektionen med bakgrundsbild och säljande budskap. */
  position: relative;
  display: grid;
  min-height: 720px;
  align-items: center;
  padding-top: var(--header);
  color: var(--white);
  background: url("../images/hero-bakgrund.png") center / cover;
}

.hero-overlay {
  /* Mörk toning över bilden så vit text blir lätt att läsa. */
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72) 42%, rgba(255, 255, 255, 0.08) 72%),
    linear-gradient(180deg, rgba(30, 55, 101, 0.02), rgba(30, 55, 101, 0.18));
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-block: 96px 120px;
}

.hero-content > * {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--sky);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  color: #061a40;
  font-size: clamp(2.35rem, 6vw, 4.9rem);
}

.hero-lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: #071d45;
  font-size: 1.18rem;
  font-weight: 600;
  text-shadow: 0 1px 16px rgba(255, 255, 255, 0.72);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.trust-strip,
.section-blue {
  /* Mörkblå sektioner för förtroende och kontrast. */
  background: var(--navy);
}

.trust-grid,
.card-grid,
.benefit-list,
.split,
.about,
.contact-layout,
.footer-grid {
  /* Gemensamt grid-system för flera sektioner. */
  display: grid;
  gap: 18px;
}

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

.trust-grid div {
  min-height: 104px;
  padding: 24px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.trust-grid strong,
.trust-grid span {
  display: block;
}

.trust-grid strong {
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.trust-grid span,
.site-footer {
  color: rgba(255, 255, 255, 0.78);
}

.section-blue p {
  color: rgba(255, 255, 255, 0.9);
}

.section {
  /* Standardavstånd ovanför och under varje stor sektion. */
  padding: 96px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.section h2 {
  font-size: clamp(2rem, 4vw, 3.05rem);
}

.section-heading p,
.split p,
.about-panel p,
.contact-layout p,
.service-card p {
  color: var(--muted);
  font-size: 1.04rem;
}

.card-grid {
  /* Fyra tjänstekort på desktop. */
  grid-template-columns: repeat(4, 1fr);
}

.service-card,
.about-panel,
.quote-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.service-card {
  min-height: 260px;
  padding: 26px;
  box-shadow: 0 12px 30px rgba(30, 55, 101, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.service-card:hover {
  box-shadow: 0 18px 42px rgba(30, 55, 101, 0.13);
  transform: translateY(-3px);
}

.service-icon {
  width: 74px;
  height: 74px;
  margin-bottom: 22px;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.service-card h3,
.benefit-list h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
}

.service-card p,
.benefit-list p,
.footer-bottom p {
  margin: 0;
}

.section-blue h2,
.section-blue h3 {
  /* Rubriker i mörka sektioner behöver vara vita. */
  color: var(--white);
}

.split {
  grid-template-columns: 0.8fr 1.2fr;
  gap: 54px;
  align-items: start;
}

.benefit-list {
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.benefit-list article {
  min-height: 162px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
}

.benefit-list p {
  color: rgba(255, 255, 255, 0.86);
}

.about {
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
}

.about-panel,
.quote-panel,
.quote-form {
  padding: 34px;
}

.about-panel {
  background: var(--soft);
}

.quote-panel {
  display: grid;
  align-items: end;
  color: var(--white);
  background: linear-gradient(145deg, var(--blue), var(--navy));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quote-panel p {
  margin: 0;
  color: var(--white);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
}

.gallery-section {
  background: var(--white);
}

.gallery {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.gallery-track {
  display: grid;
}

.gallery-slide {
  position: relative;
  display: none;
  min-height: 560px;
  margin: 0;
}

.gallery-slide.is-active {
  display: block;
}

.gallery-slide img {
  width: 100%;
  height: 560px;
  object-fit: cover;
}

.gallery-slide figcaption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  max-width: 620px;
  padding: 16px 18px;
  color: var(--white);
  background: rgba(30, 55, 101, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  font-weight: 700;
}

.gallery-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-size: 2.2rem;
  line-height: 1;
  transform: translateY(-50%);
  transition: 180ms ease;
}

.gallery-btn:hover,
.gallery-btn:focus-visible {
  background: var(--white);
  transform: translateY(-50%) scale(1.04);
}

.gallery-btn-prev {
  left: 18px;
}

.gallery-btn-next {
  right: 18px;
}

.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.gallery-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.gallery-dot.is-active {
  width: 28px;
  background: var(--white);
  border-radius: 999px;
}

.contact-section {
  background: var(--soft);
}

.rut-section,
.faq-section {
  /* Ljusa informationssektioner för RUT och FAQ. */
  background: var(--soft);
}

.rut-layout {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 34px;
  align-items: center;
}

.rut-layout p,
.faq-list p {
  color: var(--muted);
}

.rut-card {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--sky);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(30, 55, 101, 0.08);
}

.rut-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 1.1rem;
}

.faq-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 44px;
  align-items: start;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  /* details/summary ger klickbara FAQ-frågor utan JavaScript. */
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(30, 55, 101, 0.06);
}

.faq-list summary {
  padding: 18px 20px;
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin: 0;
  padding: 0 20px 20px;
}

.contact-layout {
  grid-template-columns: 0.9fr 1.1fr;
  gap: 44px;
  align-items: start;
}

.contact-details {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  color: var(--navy);
  font-weight: 800;
}

.quote-form {
  /* Formuläret är visuellt framhävt eftersom sidan ska konvertera till offertförfrågningar. */
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.form-row label {
  color: var(--navy);
  font-weight: 800;
}

.form-row input,
.form-row select,
.form-row textarea {
  /* Samma grundstil för alla formulärfält. */
  width: 100%;
  padding: 14px 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #cbd9ec;
  border-radius: var(--radius);
  outline: none;
  transition: 180ms ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(109, 181, 255, 0.22);
}

.form-submit {
  width: 100%;
  border: 0;
  cursor: pointer;
}

.form-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--blue);
  font-weight: 800;
}

.site-footer {
  /* Sidfot med företagets kontaktinformation. */
  background: #13294f;
}

.footer-grid {
  grid-template-columns: 1fr auto;
  gap: 36px;
  padding: 54px 0;
}

.footer-logo {
  width: 210px;
  max-height: none;
  padding: 10px;
  background: var(--white);
  border-radius: var(--radius);
}

.footer-grid p {
  max-width: 420px;
  margin: 18px 0 0;
}

address {
  display: grid;
  gap: 8px;
  font-style: normal;
}

address strong,
address a:hover,
address a:focus-visible {
  color: var(--white);
}

.footer-bottom {
  padding: 18px 20px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 980px) {
  /* Surfplatta och mindre: gör navigationen till en mobilmeny. */
  .nav-toggle {
    display: grid;
  }

  .nav-menu {
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(var(--header) + 10px);
    display: grid;
    gap: 6px;
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: 180ms ease;
  }

  .nav-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-menu a {
    padding: 12px;
  }

  .nav-menu .btn {
    margin-top: 8px;
  }

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

  .split,
  .about,
  .rut-layout,
  .faq-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  /* Mobil: mindre avstånd och en kolumn i de flesta sektioner. */
  :root {
    --header: 72px;
  }

  .nav,
  .section-inner {
    width: min(calc(100% - 28px), var(--max));
  }

  .brand-logo {
    width: 138px;
    max-height: 58px;
  }

  .hero {
    min-height: 650px;
    background-position: 58% center;
  }

  .hero-content {
    padding-block: 84px 86px;
  }

  .hero-lead {
    font-size: 1.02rem;
  }

  .hero-actions,
  .hero-actions .btn {
    width: 100%;
  }

  .section {
    padding: 70px 0;
  }

  .card-grid,
  .trust-grid,
  .benefit-list {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: auto;
  }

  .about-panel,
  .quote-panel,
  .quote-form {
    padding: 24px;
  }

  .quote-panel p {
    font-size: 1.18rem;
  }

  .gallery-slide,
  .gallery-slide img {
    min-height: 420px;
    height: 420px;
  }

  .gallery-slide figcaption {
    left: 14px;
    right: 14px;
    bottom: 46px;
    padding: 13px 14px;
    font-size: 0.92rem;
  }

  .gallery-btn {
    width: 42px;
    height: 42px;
  }

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

@media (prefers-reduced-motion: reduce) {
  /* Respekterar användare som valt minskade animationer i sitt system. */
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
