/* SmartVal — Swedish Fintech Aesthetic */
:root {
  --primary: #0052CC;
  --primary-dark: #003D99;
  --primary-light: #E6F0FF;
  --accent: #00B268;
  --accent-light: #E6F9F0;
  --text: #1A1A2E;
  --text-secondary: #5A6478;
  --bg: #F8F9FC;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --primary: #4D9AFF;
  --primary-dark: #80B8FF;
  --primary-light: #1A2744;
  --accent: #34D399;
  --accent-light: #1A2E28;
  --text: #E2E8F0;
  --text-secondary: #94A3B8;
  --bg: #0F172A;
  --white: #1E293B;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { color: var(--text-secondary); }

/* Layout */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}
[data-theme="dark"] .site-header { background: rgba(30,41,59,0.92); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo svg { width: 28px; height: 28px; }

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: var(--transition); }
.nav-links a:hover { color: var(--primary); }

.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  cursor: pointer; font-size: 1.1rem; transition: var(--transition);
}
.theme-toggle:hover { background: var(--primary-light); }

/* Hero */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 { margin-bottom: 16px; }
.hero p { font-size: 1.15rem; max-width: 600px; margin: 0 auto 30px; }
.hero-badges { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.hero-badge {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.social-proof {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.pulse { display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Chat Widget */
.chat-section {
  padding: 20px 0 50px;
}

.chat-container {
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.chat-header {
  background: var(--primary);
  color: white;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-avatar {
  width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.chat-header-text h3 { color: white; font-size: 1rem; }
.chat-header-text span { font-size: 0.8rem; opacity: 0.8; }

.chat-messages {
  padding: 24px;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msgIn 0.3s ease-out;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.bot .msg-avatar { background: var(--primary-light); }
.user .msg-avatar { background: var(--accent-light); }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.bot .msg-bubble { background: var(--bg); color: var(--text); border-bottom-left-radius: 4px; }
.user .msg-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 20px;
}

.chat-option {
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  color: var(--text);
  font-family: var(--font);
}
.chat-option:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.chat-input-wrap {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  gap: 10px;
  display: none;
}
.chat-input-wrap.active { display: flex; }
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text);
}
.chat-input:focus { border-color: var(--primary); }
.chat-send {
  background: var(--primary); color: white; border: none; border-radius: 50%;
  width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem; transition: var(--transition);
}
.chat-send:hover { background: var(--primary-dark); }

/* Results */
.results-section {
  padding: 40px 0 60px;
  display: none;
}
.results-section.active { display: block; }

.results-header {
  text-align: center;
  margin-bottom: 30px;
}
.results-header h2 { margin-bottom: 8px; }

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 780px;
  margin: 0 auto;
}

.result-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.result-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.result-card.best-match { border-color: var(--accent); }
.result-card.best-match::before {
  content: '🏆 Bästa matchning';
  position: absolute;
  top: 0; left: 0; right: 0;
  background: var(--accent);
  color: white;
  text-align: center;
  padding: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.result-card.best-match { padding-top: 48px; }

.card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.card-logo {
  width: 64px; height: 40px; border-radius: 8px; object-fit: contain;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.7rem; color: var(--primary); border: 1px solid var(--border);
}

.card-title h3 { margin-bottom: 2px; }
.card-title span { font-size: 0.82rem; color: var(--text-secondary); }

.card-match {
  margin-left: auto;
  text-align: center;
}
.match-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}
.match-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

.card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.stat { text-align: center; }
.stat-value { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

.card-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.perk-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

.card-actions { display: flex; gap: 10px; align-items: center; }

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-accent:hover { background: #009A56; }

.btn-outline {
  background: none;
  border: 2px solid var(--border);
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  text-decoration: none;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #F59E0B;
  margin-left: auto;
}

/* Compare Mode */
.compare-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 14px 28px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 200;
  box-shadow: var(--shadow-xl);
  transition: bottom 0.3s ease;
  font-size: 0.9rem;
}
.compare-bar.active { bottom: 24px; }
.compare-bar button { background: var(--accent); color: white; border: none; padding: 8px 20px; border-radius: 100px; cursor: pointer; font-weight: 600; font-size: 0.85rem; }

/* Compare checkbox */
.compare-check {
  display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-secondary); cursor: pointer;
}
.compare-check input { accent-color: var(--primary); }

/* SEO Content */
.seo-content {
  padding: 60px 0;
  max-width: 780px;
  margin: 0 auto;
}
.seo-content h2 { margin-bottom: 16px; }
.seo-content p { margin-bottom: 16px; font-size: 0.95rem; }
.seo-content ul { padding-left: 24px; margin-bottom: 16px; }
.seo-content li { margin-bottom: 8px; font-size: 0.92rem; color: var(--text-secondary); }

/* FAQ */
.faq-section { padding: 40px 0 60px; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-q {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--text-secondary); transition: var(--transition); }
.faq-q.open::after { content: '−'; }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}
.faq-a.open { max-height: 300px; padding-top: 12px; }

/* Calculator */
.calculator {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 500px;
  margin: 30px auto;
}
.calc-row { margin-bottom: 18px; }
.calc-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.calc-row input[type="range"] { width: 100%; accent-color: var(--primary); }
.calc-row .range-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-secondary); }
.calc-result {
  text-align: center;
  padding: 20px;
  background: var(--primary-light);
  border-radius: var(--radius);
  margin-top: 20px;
}
.calc-result .big-number { font-size: 2rem; font-weight: 800; color: var(--primary); }
.calc-result .label { font-size: 0.82rem; color: var(--text-secondary); }

/* Email capture */
.email-capture {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 40px 0;
}
.email-capture h2 { color: white; margin-bottom: 10px; }
.email-capture p { color: rgba(255,255,255,0.85); margin-bottom: 20px; }
.email-form { display: flex; gap: 10px; max-width: 450px; margin: 0 auto; }
.email-form input {
  flex: 1; padding: 12px 18px; border: 2px solid rgba(255,255,255,0.3); border-radius: 100px;
  background: rgba(255,255,255,0.15); color: white; font-size: 0.9rem; outline: none; font-family: var(--font);
}
.email-form input::placeholder { color: rgba(255,255,255,0.6); }
.email-form button {
  background: white; color: var(--primary); border: none; padding: 12px 24px; border-radius: 100px;
  font-weight: 700; cursor: pointer; white-space: nowrap; font-family: var(--font);
}

/* Trust bar */
.trust-bar {
  display: flex;
  gap: 30px;
  justify-content: center;
  padding: 30px 0;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; color: var(--text); }
.footer-col a { display: block; color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; margin-bottom: 6px; transition: var(--transition); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  font-size: 0.85rem;
}
.cookie-banner.hidden { display: none; }
.cookie-banner p { color: var(--text-secondary); max-width: 500px; }
.cookie-accept {
  background: var(--primary); color: white; border: none; padding: 10px 24px;
  border-radius: 100px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: var(--font);
}

/* Comparison modal */
.compare-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.compare-modal.active { display: flex; }
.compare-modal-inner {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  padding: 30px;
}
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.compare-table th { text-align: left; padding: 10px; border-bottom: 2px solid var(--border); font-weight: 600; }
.compare-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.compare-close {
  float: right; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary);
}

/* Loading dots */
.typing-indicator span {
  display: inline-block; width: 8px; height: 8px; background: var(--text-secondary); border-radius: 50%;
  animation: typing 1.4s infinite; margin: 0 2px;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Responsive */
@media (max-width: 640px) {
  .hero { padding: 40px 0 20px; }
  .chat-messages { padding: 16px; min-height: 240px; }
  .chat-options { padding: 0 16px 16px; }
  .result-card { padding: 16px; }
  .result-card.best-match { padding-top: 40px; }
  .card-stats { grid-template-columns: repeat(2, 1fr); }
  .card-top { flex-wrap: wrap; }
  .card-match { margin-left: 0; }
  .card-actions { flex-wrap: wrap; }
  .email-form { flex-direction: column; }
  .nav-links { gap: 12px; }
  .cookie-banner { flex-direction: column; text-align: center; gap: 12px; }
  .compare-bar { width: calc(100% - 40px); }
}
