/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #F5BB11;
  --gold-dim: rgba(245, 187, 17, 0.15);
  /* --accent / --accent-soft default to Sidcom gold. Per-integration pages
     override these on <body> via inline style to brand the detail view. */
  --accent: #F5BB11;
  --accent-soft: rgba(245, 187, 17, 0.15);
  --bg: #0a0a0a;
  --surface: #111;
  --surface-hover: #1a1a1a;
  --border: #222;
  --text: #e8e8e8;
  --text-dim: #888;
  --green: #4ade80;
  --radius: 12px;
  --max-w: 900px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Grid background (all pages) ──────────────────────────── */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, #ffffff06 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff06 1px, transparent 1px);
  background-size: 2rem 2rem;
  background-position: center center;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 100%);
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
}

.logo img { height: 28px; }

nav { display: flex; gap: 1.5rem; font-size: 0.9rem; }
nav a { color: var(--text-dim); }
nav a:hover { color: var(--text); text-decoration: none; }

/* ── Main ──────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ── Hero (index) ──────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero h1 span { color: var(--gold); }

.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

/* ── Integration cards ─────────────────────────────────────── */
.integrations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card:hover {
  border-color: var(--gold);
  background: var(--surface-hover);
  text-decoration: none;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.card-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }

.card h3 { font-size: 1rem; font-weight: 600; }

.card p { font-size: 0.85rem; color: var(--text-dim); margin: 0; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-live { background: rgba(74, 222, 128, 0.15); color: var(--green); }
.badge-soon { background: var(--gold-dim); color: var(--gold); }

/* ── Detail page ───────────────────────────────────────────── */
.detail { max-width: 680px; }

.detail-logo { margin-bottom: 1.75rem; padding: 0.5rem 0; }
/* Partner logo at the top of the detail page — sized to feel like a brand
   header. Fortnox safe-zone (width of "F") is preserved by the padding. */
.detail-logo img { height: 64px; min-height: 22px; width: auto; }

@media (max-width: 600px) {
  .detail-logo img { height: 48px; }
}

.detail h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.disclaimer {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.disclaimer-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
  opacity: 0.75;
}

/* Install tabs (Claude Desktop / Claude Code / Claude CLI) */
.tabs {
  margin-bottom: 2rem;
}
.tabs > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tab-labels {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.tab-labels label {
  padding: 0.55rem 1rem;
  cursor: pointer;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}
.tab-labels label:hover {
  color: var(--text);
}
.tab-panel {
  display: none;
}
.tabs > input[value="desktop"]:checked ~ .tab-panels .tab-panel[data-tab="desktop"],
.tabs > input[value="code"]:checked ~ .tab-panels .tab-panel[data-tab="code"],
.tabs > input[value="cli"]:checked ~ .tab-panels .tab-panel[data-tab="cli"] {
  display: block;
}
.tabs > input[value="desktop"]:checked ~ .tab-labels label[for$="-desktop"],
.tabs > input[value="code"]:checked ~ .tab-labels label[for$="-code"],
.tabs > input[value="cli"]:checked ~ .tab-labels label[for$="-cli"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.install-demo {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  background: var(--surface);
  display: block;
}
.connector-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.connector-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}
.connector-link svg {
  opacity: 0.75;
}

.detail .lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.detail h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
  color: var(--text);
  padding-left: 0.7rem;
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}

.detail h2:first-of-type { margin-top: 0; }

.detail p, .detail li {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.detail ul, .detail ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.detail li { margin-bottom: 0.35rem; }

.detail > code,
.detail li > code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  font-size: 0.82rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── URL box (call-to-action, animated glow) ──────────────── */
.url-box-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.url-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  max-width: 100%;
  border-radius: var(--radius);
}

/* Soft accent halo behind the URL box — replaces the rave-y conic gradient. */
.url-box .glow {
  position: absolute;
  inset: -8px -6px;
  z-index: 0;
  border-radius: calc(var(--radius) + 4px);
  background: radial-gradient(60% 60% at 50% 50%, var(--accent-soft), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}

/* Legacy decorative layers — hidden but kept so existing HTML still renders. */
.url-box .darkBorderBg,
.url-box .white,
.url-box .border { display: none; }

.url-box-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  width: 100%;
  transition: border-color 0.2s;
}

.url-box:hover .url-box-inner {
  border-color: var(--accent);
}

.url-box-url {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1rem;
  color: #e8e8e8;
  background: none;
  border: none;
  outline: none;
  cursor: text;
  min-width: 0;
}

.url-box-copy {
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid #333;
  border-radius: 8px;
  color: var(--text-dim);
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  font-family: inherit;
}

.url-box-copy:hover { color: var(--accent); border-color: var(--accent); }

/* ── Code card (terminal-style) ───────────────────────────── */
.code-card {
  background: #1e293b;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0.75rem 0 1.25rem;
  border: 1px solid #334155;
}

.code-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 40px;
  position: relative;
  border-bottom: 1px solid #334155;
}

.code-card-title {
  font-size: 0.78rem;
  color: #7dd3fc;
  font-weight: 600;
  position: relative;
}

.code-card-title::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #7dd3fc;
}

.code-card-copy {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.code-card-copy:hover { color: #94a3b8; }

.code-card-body {
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

.code-card-line {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  line-height: 1.7;
}

.code-card-line .chevron {
  color: #f472b6;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.code-card-body code {
  background: none;
  border: none;
  padding: 0;
  color: #f8fafc;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre;
  display: block;
}

/* ── Tags / labels ────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1.25rem;
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  background: rgba(255,255,255,0.05);
  border: 1px solid #333;
  color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--text);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.back:hover { color: var(--text); text-decoration: none; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

footer a { color: var(--text-dim); }
footer a:hover { color: var(--text); }

/* ── About partner (Fortnox boilerplate, etc.) ────────────── */
.about-partner {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.about-partner h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--accent);
  color: var(--text);
}

.about-partner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.about-partner-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 100% at 0% 0%, var(--accent-soft), transparent 60%);
  pointer-events: none;
  opacity: 0.55;
}

.about-partner-card > * { position: relative; }

.about-partner-logo {
  display: block;
  height: 32px;
  min-height: 22px;
  width: auto;
  margin: 0 0 1rem;
  /* Fortnox safe zone: keep at least 1× "F" of space around the logo. */
}

.about-partner-card p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0 0 0.9rem;
}

.about-partner-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}
.about-partner-link:hover {
  text-decoration: underline;
}
.about-partner-link svg {
  opacity: 0.85;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 0.95rem; }
  main { padding: 2rem 1.25rem; }
  header { padding: 1rem 1.25rem; }
  .url-box-url { font-size: 0.85rem; }
  .url-box-inner { padding: 0.85rem 1rem; }
}

/* Language switcher in nav */
nav .lang-switch {
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 0.75rem;
}
nav .lang-switch .lang-active { color: var(--gold); font-weight: 600; }
nav .lang-switch .lang-other { color: #94a3b8; text-decoration: none; }
nav .lang-switch .lang-other:hover { color: var(--gold); }

/* Legal disclaimer on TOS / Privacy */
.legal-disclaimer { color: #94a3b8; font-size: 0.85rem; margin-top: -0.25rem; }

/* ────────────────────────────────────────────────────────────
   Light theme — used on partner detail pages whose brand guide
   expects a light background (Fortnox marketplace look-and-feel).
   Activated via <body data-theme="light"> from templates.ts.
   ──────────────────────────────────────────────────────────── */
body[data-theme="light"] {
  /* Fortnox-inspired palette. The accent variables stay whatever the
     integration set them to (Fortnox green by default). */
  --bg: #F5EFE6;            /* beige page background */
  --surface: #FFFFFF;       /* white cards */
  --surface-hover: #FBF8F2;
  --border: #E5DDD0;
  --text: #013824;          /* Fortnox dark green for body text */
  --text-dim: #5A6B62;
  --coral: #E97852;         /* Fortnox marketplace coral accent */
}

body[data-theme="light"] .grid-bg {
  background-image:
    linear-gradient(to right, rgba(1, 56, 36, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(1, 56, 36, 0.04) 1px, transparent 1px);
}

body[data-theme="light"] header {
  border-bottom-color: var(--border);
}
body[data-theme="light"] .logo { color: var(--text); }
body[data-theme="light"] nav a { color: var(--text-dim); }
body[data-theme="light"] nav a:hover { color: var(--text); }
body[data-theme="light"] nav .lang-switch {
  border-left-color: rgba(1, 56, 36, 0.15);
}
body[data-theme="light"] nav .lang-switch .lang-active {
  color: var(--accent);
}
body[data-theme="light"] nav .lang-switch .lang-other { color: var(--text-dim); }
body[data-theme="light"] nav .lang-switch .lang-other:hover { color: var(--accent); }

body[data-theme="light"] footer {
  border-top-color: var(--border);
  color: var(--text-dim);
}
body[data-theme="light"] footer a { color: var(--text-dim); }
body[data-theme="light"] footer a:hover { color: var(--text); }

body[data-theme="light"] a { color: var(--accent); }

/* Detail h1 + lead — match Fortnox marketplace headings */
body[data-theme="light"] .detail h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
body[data-theme="light"] .detail .lead {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--coral);
  line-height: 1.3;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

body[data-theme="light"] .detail h2 {
  color: var(--text);
  border-left-color: var(--accent);
}

body[data-theme="light"] .detail p,
body[data-theme="light"] .detail li {
  color: var(--text-dim);
}

body[data-theme="light"] .back {
  color: var(--text-dim);
  font-weight: 500;
}
body[data-theme="light"] .back:hover { color: var(--text); }

/* Disclaimer pill — softer, on white */
body[data-theme="light"] .disclaimer {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-dim);
}

/* URL box — white card with green halo */
body[data-theme="light"] .url-box .glow {
  background: radial-gradient(60% 60% at 50% 50%, var(--accent-soft), transparent 70%);
}
body[data-theme="light"] .url-box-inner {
  background: #FFFFFF;
  border-color: var(--border);
}
body[data-theme="light"] .url-box-url {
  color: var(--text);
}
body[data-theme="light"] .url-box-copy {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-dim);
}
body[data-theme="light"] .url-box-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Code card — keep terminal vibe but lighter */
body[data-theme="light"] .code-card {
  background: #013824;
  border-color: #013824;
}
body[data-theme="light"] .code-card-header {
  border-bottom-color: rgba(255,255,255,0.1);
}

/* Inline code in body text */
body[data-theme="light"] .detail > code,
body[data-theme="light"] .detail li > code {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

/* Install tabs */
body[data-theme="light"] .tab-labels {
  border-bottom-color: var(--border);
}
body[data-theme="light"] .tab-labels label {
  color: var(--text-dim);
}
body[data-theme="light"] .tab-labels label:hover { color: var(--text); }
body[data-theme="light"] .connector-link {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
body[data-theme="light"] .connector-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}
body[data-theme="light"] .install-demo {
  background: var(--surface);
  border-color: var(--border);
}

/* Tags / scopes — pill chips on white */
body[data-theme="light"] .tag {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
body[data-theme="light"] .tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* About-partner card — beige variant, no extra surface contrast */
body[data-theme="light"] .about-partner {
  border-top-color: var(--border);
}
body[data-theme="light"] .about-partner h2 {
  color: var(--text);
}
body[data-theme="light"] .about-partner-card {
  background: var(--surface);
  border-color: var(--border);
}
body[data-theme="light"] .about-partner-card::before {
  background: radial-gradient(80% 100% at 0% 0%, var(--accent-soft), transparent 60%);
  opacity: 0.4;
}
body[data-theme="light"] .about-partner-card p {
  color: var(--text-dim);
}
body[data-theme="light"] .about-partner-link {
  color: var(--accent);
}

/* Detail-logo padding scales down a touch on light bg */
body[data-theme="light"] .detail-logo {
  padding: 0.25rem 0;
}
