/* ========================================
   KassaGo V3 – Huvudstil
   ======================================== */

/* ----------- Färgtema (Ljust läge) ----------- */
:root {
  --accent: #ff7a00;
  --accent-hover: #ff9633;

  --bg: #f8f5f2;
  --bg-alt: #ffffff;
  --text: #2a2623;
  --muted: #5c5651;

  --border: #e2dbd5;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --maxw: 1200px;
}

/* ----------- Mörkt läge ----------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --bg-alt: #222;
    --text: #f3f3f3;
    --muted: #c9c9c9;

    --border: #333;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  }
}

/* ========================================
   Grundläggande layout
   ======================================== */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
}
img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
section { padding: 3rem 0; }

h1, h2, h3 { line-height: 1.3; margin-top: 0; }
h2 {
  font-size: 1.6rem;
  border-left: 5px solid var(--accent);
  padding-left: .6rem;
  margin-bottom: 1rem;
}
h3.accent {
  border-left: 2px solid var(--accent);
  padding-left: .6rem;
  margin-bottom: 1rem;
}

/* ========================================
   Header och navigation
   ======================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(26, 26, 26, 0.9); }
}
.site-header.scrolled { box-shadow: var(--shadow); }
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
}
.logo { height: 36px; }

.nav-toggle {
  background: transparent;
  border: 1px solid var(--border);
  padding: .4rem .6rem;
  border-radius: var(--radius);
  font-size: 1.2rem;
  color: var(--text);
}
.nav-list {
  list-style: none;
  margin: 0; padding: .5rem;
  display: none;
  background: var(--bg-alt);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: absolute;
  right: 1rem;
  top: 60px;
}
.nav-list.open { display: block; }
.nav-list a {
  display: block;
  padding: .6rem .9rem;
  border-radius: var(--radius);
  color: var(--text);
}
.nav-list a:hover { background: var(--border); }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-list {
    display: flex !important;
    position: static;
    box-shadow: none;
    background: transparent;
    gap: 1.2rem;
    align-items: center;
  }
  .nav-list a:hover {
    background: transparent;
    text-decoration: underline;
  }
}

/* ========================================
   Knappar
   ======================================== */
.btn {
  display: inline-block;
  padding: .8rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { background: var(--border); }
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.15);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  position: relative;
  margin-top: 64px;
  overflow: hidden;
  border-bottom: 3px solid var(--accent);
  margin-bottom: 37px;
}

.hero-media {
  height: 45vh;
  min-height: 320px;
  background: url('../img/hero.jpg') center/cover no-repeat;
  position: relative;
  will-change: background-position;
  transition: background-position 0.1s ease-out;
}

/* 🔸 Gradient overlay */
.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0.10) 60%,
    rgb(255 134 0 / 20%) 100%
  );
  z-index: 1;
}

/* 🔸 Text ovanpå overlay */
.hero-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  z-index: 2;
  padding: 1rem;
}

.hero h1 {
  font-size: clamp(3.4rem, 3.5vw, 2.2rem);
  text-shadow: 0 3px 12px rgba(0,0,0,0.6);
  margin-bottom: 1.2rem;
}
@media (max-width: 800px) {
  .hero h1 { font-size: clamp(1.4rem, 2.5vw, 3.4rem); }
  .hero-media::before {
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.40) 60%,
    rgb(255 134 0 / 20%) 100%
  );
  z-index: 1;
}
}

/* ========================================
   Text & bilder (växelvis layout)
   ======================================== */
.seo-text p, .seo-text li { color: var(--text); }
.seo-text ul { padding-left: 1.3rem; }

.text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.text-block.reverse { flex-direction: column; }
.text-block .text { flex: 1; }
.text-block .image { flex: 1; width: 100%; }

.text-block img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.text-block img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

@media (min-width: 900px) {
  .text-block { flex-direction: row; }
  .text-block.reverse { flex-direction: row-reverse; }
  .text-block .text { padding: 0 2rem; }
}

/* ========================================
   Demoformulär
   ======================================== */
.demo-card {
  background: #fdfaf7;
  border-top: 3px solid var(--accent);
}
@media (prefers-color-scheme: dark) {
  .demo-card { background: #1f1a15; }
}
.demo-card-inner {
  background: var(--bg-alt);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.demo-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.demo-form input, .demo-form textarea {
  width: 100%;
  padding: .8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.demo-form input:focus, .demo-form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,122,0,0.25);
}

/* ========================================
   FAQ / Priser / Kalkylator
   ======================================== */
.faq {
  border-top: 3px solid var(--accent);
  margin-top: 2rem;
}
.faq-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.faq-q {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 1.2rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.faq-q:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-alt));
  color: var(--accent);
}
.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.faq-q[aria-expanded="true"] .faq-icon {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: rotate(45deg);
}
.faq-a {
  padding: 0 1.4rem 1.2rem;
  animation: fadeIn 0.3s ease;
  color: var(--text);
}
.faq-a ul {
  padding-left: 1.4rem;
  margin: 0.6rem 0;
}
.faq-a li { margin-bottom: 0.4rem; color: var(--text); }

@media (prefers-color-scheme: dark) {
  .faq-item {
    background: #242424;
    border-color: #383838;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  }
  .faq-q:hover { background: rgba(255, 122, 0, 0.1); }
  .faq-icon { background: #1a1a1a; border-color: #444; }
  .faq-a { background: #1c1c1c; }
}

.pricing { padding-top: 5rem; }
.pricing-intro { color: var(--muted); margin-bottom: 1rem; }

.calc-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-top: .8rem;
}
.calc-grid label {
  display: grid;
  gap: .4rem;
  font-weight: 600;
}
.calc-grid input {
  width: 100%;
  padding: .8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.calc-result {
  background: color-mix(in srgb, var(--bg) 90%, var(--bg-alt));
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: .9rem;
}
.calc-result #kv_resultat,
.calc-result #pg_resultat,
.calc-result #ar_resultat {
  font-size: 1.1rem;
  font-weight: 700;
}

@media (min-width: 800px) {
  .calc-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  #pg_kassor, #ar_kassor { grid-column: auto; }
  .calc-result { grid-column: 1 / -1; }
}

/* Hjälp mig välja rätt */
.choose-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1rem auto;
}
.choose-grid label { display: grid; gap: .3rem; font-weight: 600; }
.choose-grid select {
  padding: .8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.choose-grid button { justify-self: center; width: fit-content; }
.cp-result {
  margin-top: 2rem;
  display: none;
  justify-content: center;
}
.cp-box {
  background: var(--bg-alt);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 600px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}
.cp-box h3 { color: var(--accent); margin-top: 0; }
.cp-box .muted { margin-top: .8rem; font-size: .9rem; }

@media (min-width: 800px) {
  .choose-grid { grid-template-columns: repeat(3,1fr); }
  #cp_calc { grid-column: 1 / -1; }
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer a { color: var(--accent); }

/* ========================================
   Modal & Cookie-banner
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}
.modal-content {
  background: var(--bg-alt);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.8rem;
  width: min(90%, 480px);
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  animation: popIn 0.25s ease;
}
.modal-content h2 { margin-top: 0; color: var(--accent); margin-bottom: 0.6rem; }
.modal-content p { margin-bottom: 1rem; color: var(--text); }
.modal-content .btn { margin-top: 0.6rem; width: 100%; }

.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.08);
  padding: 0.8rem 1rem;
  z-index: 1500;
  animation: slideUp 0.4s ease;
}
.cookie-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.cookie-inner span {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #272727;
    border-color: #3b3b3b;
  }
  .cookie-banner {
    background: #1f1f1f;
    border-color: #333;
  }
}

/* ========================================
   Animationer
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s ease forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; opacity: 1; transform: none; }
}

/* ========================================
   Responsivitet
   ======================================== */
@media (min-width: 1000px) {
  h1 { font-size: 2.2rem; }
  section { padding: 4rem 0; }
}
