/* =========================================
   1. NULLSTILLING & VARIABLER
   ========================================= */
:root {
  --color-primary: #123646;
  --color-cta: #25D366;
  --color-cta-hover: #1da851;
  --color-slate: #2c3e50;

  --color-bg: #FFFFFF;
  --color-bg-light: #F0F4F8;
  --color-bg-inkasso: #F8F9FA;

  --header-height: 80px;
  --border-radius-card: 16px;
  --border-radius-btn: 50px;
}

html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: var(--color-bg);
  padding-top: var(--header-height);
  padding-bottom: 140px; /* plass til floating */
}

img { max-width: 100%; }
a { text-decoration: none; color: inherit; }

.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

/* =========================================
   2. HEADER & NAVIGASJON
   ========================================= */
.main-header {
  background-color: #FFFFFF;
  height: var(--header-height);
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Desktop: stor logo */
.logo-img { height: 130px; width: auto; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 25px;
}

/* Språkvelger */
.lang-selector { position: relative; cursor: pointer; }

.current-lang {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.current-lang-flag {
  width: 38px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lang-arrow { font-size: 0.8rem; color: #666; }

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 10px;
  min-width: 120px;
  z-index: 1001;
}

.lang-selector:hover .lang-dropdown { display: flex; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #333;
  padding: 5px;
  border-radius: 4px;
  transition: background 0.2s;
}

.lang-option:hover { background-color: #f5f5f5; }

.lang-option img {
  width: 20px;
  border-radius: 2px;
  border: 1px solid #eee;
}

/* Hamburger */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1002;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -8px); }

/* Drawer */
.nav-links {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background-color: white;
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  padding-top: 100px;
  transition: right 0.3s ease;
  z-index: 1001;
}

.nav-links.active { right: 0; }

.nav-links a {
  padding: 20px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 1px solid #f9f9f9;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background-color: #f0f4f8;
  color: var(--color-cta);
  padding-left: 35px;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
}

.overlay.active { display: block; }

/* =========================================
   3. HERO
   ========================================= */
.hero {
  background-color: var(--color-primary);
  color: #FFFFFF;
  padding: 60px 0 80px 0;
  text-align: center;
  border-bottom-left-radius: 50% 30px;
  border-bottom-right-radius: 50% 30px;
  margin-bottom: 50px;
  position: relative;
}

.hero h1 { font-size: 2.2rem; line-height: 1.2; margin-bottom: 20px; }

.hero p.hero-sub {
  max-width: 600px;
  margin: 0 auto 30px;
  font-size: 1.15rem;
  color: rgba(255,255,255,0.9);
}

.hero .micro-text {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  margin-top: 15px;
}

/* CTA-knapp */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  font-weight: 700;
  border-radius: var(--border-radius-btn);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 1.2rem;
  background-color: var(--color-cta);
  color: #fff;
  border: 4px solid #FFFFFF;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  text-decoration: none;
  gap: 10px;
}

.btn-whatsapp:hover { transform: scale(1.02); background-color: var(--color-cta-hover); }
.btn-whatsapp i { font-size: 1.8rem; }

.flag-icon {
  width: 22px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* =========================================
   4. GARANTIER
   ========================================= */
.promises-section {
  padding: 30px 0 60px 0;
  margin-top: -80px;
  position: relative;
  z-index: 10;
}

.promises-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.promise-card {
  background: white;
  padding: 25px;
  border-radius: var(--border-radius-card);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.promise-icon {
  width: 70px;
  height: 70px;
  background-color: #EBF1F5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.8rem;
  margin-bottom: 15px;
  position: relative;
}

.featured-promise { border: 2px solid var(--color-cta); background-color: #fafffc; }
.featured-promise .promise-icon { width: 90px; height: 90px; font-size: 2.5rem; color: var(--color-cta); }

/* =========================================
   5. INNHOLDSEKSJONER
   ========================================= */
.content-section-container,
.inkasso-section-container {
  padding: 60px 0;
  border-radius: 30px;
  margin: 40px 0;
  text-align: center;
  overflow: hidden;
  scroll-margin-top: 90px;
  border: 1px solid rgba(0,0,0,0.03);
}

.content-section-container { background-color: var(--color-bg-light); }
.inkasso-section-container { background-color: var(--color-bg-inkasso); }

.content-header-block,
.inkasso-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px 20px 60px 20px;
  margin-bottom: -30px;
  position: relative;
  z-index: 1;
}

.content-header-block {
  background-color: var(--color-primary);
  color: white;
  border-radius: 20px;
}

.content-header-block h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: white;
  line-height: 1.1;
}

.inkasso-text-col h2 {
  font-size: 2rem;
  color: var(--color-slate);
  margin-bottom: 10px;
}

.inkasso-text-col p {
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

.header-graphic,
.inkasso-graphic {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  position: relative;
}

.header-graphic {
  background-color: rgba(255,255,255,0.1);
  border: 3px solid rgba(255,255,255,0.2);
  color: white;
}

.inkasso-graphic {
  width: 170px;
  height: 170px;
  background-color: #E9ECEF;
  color: var(--color-slate);
  border: 4px solid white;
  font-size: 4rem;
}

.sub-icon,
.sub-icon-alert {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-graphic .sub-icon {
  bottom: 5px;
  right: 5px;
  font-size: 2rem;
  background-color: var(--color-cta);
  width: 50px;
  height: 50px;
  border: 3px solid var(--color-primary);
}

.inkasso-graphic .sub-icon-alert {
  top: 0;
  right: 0;
  color: #d9534f;
  font-size: 2.2rem;
  background: white;
  padding: 2px;
}

.content-cards,
.inkasso-stack {
  width: 90%;
  margin: 0 auto;
}

.content-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  position: relative;
  z-index: 2;
}

.inkasso-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 700px;
}

.content-card,
.inkasso-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  text-align: left;
}

.inkasso-card {
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s;
}

.inkasso-card:hover { transform: translateY(-2px); }

.content-card-icon,
.inkasso-icon-wrapper {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  background-color: #EBF1F5;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.inkasso-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: var(--color-slate);
}

.section-cta-wrapper { margin-top: 30px; }

/* =========================================
   6. TAG CLOUD
   ========================================= */
.services-cloud-section { padding: 40px 0 60px 0; text-align: center; }
.services-cloud-section h2 { font-size: 1.8rem; color: var(--color-primary); margin-bottom: 30px; }

.services-cloud-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 950px;
  margin: 0 auto;
}

.service-tag {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #555;
  cursor: default;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  white-space: nowrap;
  transition: all 0.2s;
}

.service-tag:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
  background-color: #fcfcfc;
}

/* =========================================
   7. FOOTER
   ========================================= */
.main-footer {
  background-color: var(--color-primary);
  color: white;
  padding: 60px 20px;
  text-align: center;
  margin-top: 40px;
}

.main-footer .legal-notice {
  font-size: 0.95rem;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto 30px auto;
}

.company-info {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 30px;
  font-size: 0.9rem;
  opacity: 0.7;
}

.company-info strong {
  display: block;
  margin-bottom: 10px;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* =========================================
   8. FLOATING (DEFAULT / DESKTOP)
   ========================================= */
.floating-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  width: 270px;
  animation: floatIn 1s ease-out, hoverFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 15px 30px rgba(18, 54, 70, 0.25));
}

@keyframes hoverFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.floating-unit-wrapper {
  background: white;
  border: 4px solid var(--color-primary);
  border-radius: 24px;
  overflow: hidden;
}

.cta-bubble {
  background: #fff;
  color: #333;
  padding: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  position: relative;
}

.bubble-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #f0f0f0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: background 0.2s;
}

.bubble-close:hover { background: #e0e0e0; }

.bubble-langs {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 8px;
  line-height: 1.5;
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.bubble-langs span { display: block; }

.floating-cta {
  background: var(--color-cta);
  color: white;
  padding: 15px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  border-top: 4px solid var(--color-primary);
  transition: background-color 0.2s;
}

.floating-cta:hover { background-color: var(--color-cta-hover); }
.floating-cta .main-text { font-weight: 800; font-size: 1.1rem; }

@keyframes floatIn {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   9. MEDIA QUERIES (DESKTOP)
   ========================================= */
@media (min-width: 768px) {
  .hero h1 { font-size: 3.5rem; }

  .promises-grid {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 1100px;
  }

  .content-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: 800px;
  }

  .content-header-block,
  .inkasso-header {
    flex-direction: row;
    text-align: left;
    padding-left: 40px;
    justify-content: center;
  }

  .header-text-col,
  .inkasso-text-col {
    align-items: flex-start;
    text-align: left;
    padding-left: 20px;
  }

  .inkasso-text-col p { margin: 0; }
}

/* =========================================================
   10. MOBIL FLOATING – HARD RESET (NY)
   - Stor boble over
   - Språk roterer (JS styrer .active)
   - Rund WhatsApp-knapp uten hvit ellipse
   ========================================================= */
@media (max-width: 767px) {

  /* =========================================================
     LOGO-STØRRELSE I HEADER PÅ MOBIL
     👉 Endre kun tallet (40–56px) for ønsket størrelse.
     ========================================================= */
  .logo-img { height: 90px; width: auto; }

  /* Plass i bunn */
  body { padding-bottom: 140px !important; }

  /* Hvis floatingUnit ble skjult av X tidligere */
  #floatingUnit { display: block !important; }

  .floating-container {
    position: fixed !important;
    right: 14px !important;
    bottom: 14px !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    z-index: 9999 !important;
    filter: none !important;
    animation: none !important;
  }

  /* Wrapper: nullstill (mobil) */
  .floating-unit-wrapper {
    position: static !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  /* Boble (tving fixed for å alltid vises) */
  .cta-bubble {
    display: block !important;
    position: fixed !important;
    right: 14px !important;
    bottom: 92px !important; /* 60px knapp + luft */
    width: 270px !important;
    min-height: 72px !important;
    padding: 16px 16px !important;

    background: rgba(255,255,255,0.98) !important;
    border: 2px solid rgba(18,54,70,0.25) !important;
    border-radius: 22px !important;
    box-shadow: 0 18px 40px rgba(0,0,0,0.18) !important;
    backdrop-filter: blur(6px) !important;
    z-index: 10001 !important;
  }

  /* Fjern topptekst om den finnes */
  #ctaBubble > div:first-child { display: none !important; }

  .cta-bubble::after {
    content: "" !important;
    position: absolute !important;
    right: 22px !important;
    bottom: -10px !important;
    width: 16px !important;
    height: 16px !important;
    background: rgba(255,255,255,0.98) !important;
    transform: rotate(45deg) !important;
    border-right: 2px solid rgba(18,54,70,0.25) !important;
    border-bottom: 2px solid rgba(18,54,70,0.25) !important;
  }

  .bubble-close {
    position: absolute !important;
    top: -10px !important;
    right: -10px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 2px solid rgba(18,54,70,0.18) !important;
    box-shadow: 0 8px 18px rgba(0,0,0,0.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
  }

  /* Språk-linje: 1 synlig om gangen (JS styrer .active) */
  .bubble-langs {
    height: 1.6em !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .bubble-langs span {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;

    opacity: 0 !important;
    transform: translateY(10px) !important;
    transition: opacity .15s linear, transform .15s linear !important;

    font-size: 0.95rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
  }

  .bubble-langs span.active {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  /* WhatsApp-knapp (ren, rund) */
  .floating-cta {
    position: fixed !important;
    right: 14px !important;
    bottom: 14px !important;

    width: 60px !important;
    height: 60px !important;
    padding: 0 !important;

    border-radius: 50% !important;
    border: none !important;
    outline: none !important;

    background: var(--color-cta) !important;
    color: #fff !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-shadow: 0 16px 34px rgba(0,0,0,0.25) !important;
    z-index: 10002 !important;
  }

  /* Skjul tekst/flag/nummer i mobil-knappen */
  .floating-cta .text-container,
  .floating-cta .main-text,
  .floating-cta img { display: none !important; }

  /* Fjern hvit ellipse: nullstill icon-container */
  .floating-cta .icon-container {
    all: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .floating-cta .icon-container i {
    font-size: 30px !important;
    line-height: 1 !important;
    color: #fff !important;
  }
}
