/* ── SEO-Analyse spesifikke stiler ─────────────────────────────────────────
   Bygger på det eksisterende designsystemet i style.css
   Fonter, farger, .glass, .btn og .container arves derfra.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Seksjons­synlighet (alle seksjoner skjult som standard) ─────────────── */

.seo-hero,
.loading-section,
.report-section {
  display: none;
}

.seo-hero.active,
.loading-section.active,
.report-section.active {
  display: block;
}

/* ── Hero / Inngang ─────────────────────────────────────────────────────── */

.seo-hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.seo-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.seo-hero .hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

/* ── URL-søkeboks ────────────────────────────────────────────────────────── */

.url-form-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.url-input-group {
  display: flex;
  gap: 0;
  background: #fff;
  border: 2px solid var(--glass-border);
  border-radius: 50px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), var(--card-shadow);
}

.url-input-group input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.5rem;
  font-family: var(--font-main);
  font-size: 1.05rem;
  color: var(--text-color);
  background: transparent;
  min-width: 0;
}

.url-input-group input::placeholder {
  color: var(--text-muted);
}

.url-input-group .btn-analyse {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 0.85rem 1.8rem;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0 50px 50px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.url-input-group .btn-analyse:hover { opacity: 0.9; }
.url-input-group .btn-analyse:disabled { opacity: 0.6; cursor: not-allowed; }

.url-input-group .btn-analyse .arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.url-input-group .btn-analyse:not(:disabled):hover .arrow {
  transform: translateX(4px);
}

.url-form-hint {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Loading-seksjon ─────────────────────────────────────────────────────── */

.loading-section {
  padding: 130px 0 80px;
  text-align: center;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 2rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-steps {
  list-style: none;
  max-width: 400px;
  margin: 0 auto;
  text-align: left;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.97rem;
  color: var(--text-muted);
  transition: all 0.3s;
  margin-bottom: 4px;
}

.loading-step.active {
  color: var(--text-color);
  background: rgba(99, 102, 241, 0.06);
  font-weight: 600;
}

.loading-step.done {
  color: #22c55e;
}

.loading-step .step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.loading-step.active .step-icon {
  border-color: var(--primary);
  color: var(--primary);
  animation: pulse-icon 1s ease-in-out infinite;
}

.loading-step.done .step-icon {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
}

@keyframes pulse-icon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(99,102,241,0); }
}

/* ── Feilmelding ─────────────────────────────────────────────────────────── */

.error-box {
  display: none;
  max-width: 540px;
  margin: 2rem auto;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  color: #dc2626;
  font-size: 0.97rem;
  text-align: left;
  line-height: 1.5;
}

.error-box.active { display: block; }

/* ── Rapport-seksjon ─────────────────────────────────────────────────────── */

.report-section {
  padding: 110px 0 80px;
}

/* ── Score-banner ────────────────────────────────────────────────────────── */

.score-banner {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 3rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.score-donut-wrap {
  flex-shrink: 0;
  position: relative;
}

.score-donut {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
}

.score-donut .track {
  fill: none;
  stroke: rgba(99, 102, 241, 0.1);
  stroke-width: 14;
}

.score-donut .fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 408;
  stroke-dashoffset: 408;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke 0.4s;
}

.score-donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.score-number {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-color);
}

.score-of {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.score-banner-text { flex: 1; min-width: 240px; }

.score-banner-text h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.score-banner-text .summary-text {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.score-legend {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.red    { background: #ef4444; }
.legend-dot.yellow { background: #f59e0b; }
.legend-dot.green  { background: #22c55e; }

/* ── JS-render-advarsel ──────────────────────────────────────────────────── */

.js-render-notice {
  display: none;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: #92400e;
  line-height: 1.5;
}
.js-render-notice.active { display: block; }

/* ── Topp 3 å fikse ──────────────────────────────────────────────────────── */

.top-fixes {
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.06));
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.top-fixes h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fix-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fix-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.fix-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.fix-content { flex: 1; }

.fix-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.fix-category {
  display: inline-block;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(99,102,241,0.1);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.fix-rec {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Kategori-seksjoner (accordion) ──────────────────────────────────────── */

.categories-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.cat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.cat-card:hover { box-shadow: var(--card-shadow-hover); }

.cat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99,102,241,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-icon svg { color: var(--primary); }

.cat-title-wrap { flex: 1; min-width: 0; }

.cat-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
}

.cat-score-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cat-score-bar-bg {
  width: 80px;
  height: 6px;
  background: rgba(99,102,241,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.cat-score-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
  width: 0%;
}

.cat-score-num {
  font-size: 0.88rem;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
  color: var(--text-muted);
}

.cat-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.3s;
}

.cat-card.open .cat-chevron { transform: rotate(180deg); }

.cat-body {
  display: none;
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.cat-card.open .cat-body { display: block; }

/* ── Checks ──────────────────────────────────────────────────────────────── */

.checks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
}

.check-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
  border: 1px solid transparent;
}

.check-item.pass { background: rgba(34,197,94,0.05);  border-color: rgba(34,197,94,0.15); }
.check-item.warn { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.15); }
.check-item.fail { background: rgba(239,68,68,0.05);  border-color: rgba(239,68,68,0.15);  }

.check-status-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.75rem;
  font-weight: 900;
}

.check-status-icon.pass { background: #22c55e; color: #fff; }
.check-status-icon.warn { background: #f59e0b; color: #fff; }
.check-status-icon.fail { background: #ef4444; color: #fff; }

.check-content { flex: 1; min-width: 0; }

.check-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.check-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.check-rec {
  display: flex;
  gap: 6px;
  margin-top: 0.55rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-color);
  background: rgba(99,102,241,0.06);
  border-radius: 6px;
  padding: 8px 10px;
}

.check-rec::before {
  content: '→';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Farger basert på score ──────────────────────────────────────────────── */

.score-red    { color: #ef4444; }
.score-yellow { color: #f59e0b; }
.score-green  { color: #22c55e; }

.bar-red    { background: #ef4444; }
.bar-yellow { background: #f59e0b; }
.bar-green  { background: #22c55e; }

/* ── Lead-capture seksjoner ──────────────────────────────────────────────── */

.lead-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.lead-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 2rem;
}

.lead-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.lead-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.lead-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.lead-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--glass-border);
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-color);
  background: rgba(255,255,255,0.8);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.lead-form input:focus { border-color: var(--primary); }
.lead-form input::placeholder { color: var(--text-muted); }

.lead-form .full-row { grid-column: 1 / -1; }

.lead-consent {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.lead-success {
  display: none;
  color: #22c55e;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  background: rgba(34,197,94,0.08);
  border-radius: 8px;
  margin-top: 0.75rem;
}

.lead-success.active { display: block; }

.lead-error {
  display: none;
  color: #dc2626;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.lead-error.active { display: block; }

.cta-card {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cta-card h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.75rem; }
.cta-card p  { opacity: 0.88; font-size: 0.95rem; line-height: 1.55; margin-bottom: 2rem; flex: 1; }

.btn-white {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  border-radius: 50px;
  padding: 0.85rem 1.8rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.97rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  width: fit-content;
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-white .arrow { transition: transform 0.2s; }
.btn-white:hover .arrow { transform: translateX(4px); }

/* ── Rapport-footer ──────────────────────────────────────────────────────── */

.report-footer-note {
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: 1.5rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 1rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .seo-hero { padding: 100px 0 60px; }

  .url-input-group { flex-direction: column; border-radius: 16px; }
  .url-input-group input { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--glass-border); }
  .url-input-group .btn-analyse { border-radius: 0 0 14px 14px; justify-content: center; padding: 0.9rem; }

  .score-banner { flex-direction: column; align-items: flex-start; gap: 1.5rem; padding: 1.75rem; }
  .score-donut-wrap { align-self: center; }

  .lead-section { grid-template-columns: 1fr; }

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

  .cat-score-bar-bg { display: none; }

  .cat-header { padding: 1rem 1.1rem; }
  .cat-body   { padding: 0 1.1rem 1.1rem; }
}
