/* =========================================
   TOKENS (theme)
========================================= */
:root {
  /* Colors (dark default) */
  --color-bg: #0b0e14;
  --color-bg-alt: #0f1320;
  --color-text: #e6eaf2;
  --color-muted: #9aa4b2;
  --color-brand: #39d98a;
  --color-brand-2: #3da7ff;
  --color-card: #121826;
  --color-card-border: #1a2234;

  /* Background grid */
  --grid-line-dark: rgba(255,255,255,0.04);
  --grid-line-light: rgba(0,0,0,0.08);
  --grid-diag-dark: rgba(61,167,255,0.15);
  --grid-diag-light: rgba(61,167,255,0.25);
  --grid-diag2-dark: rgba(57,217,138,0.15);
  --grid-diag2-light: rgba(57,217,138,0.25);

  /* Effects & layout */
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --container-max: 1100px;
  --section-padding: 72px;
  --radius: 12px;

  /* Typography */
  --font-main: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

/* Light theme token overrides (global, 1 izvor istine) */
html[data-theme="light"] {
  --color-bg: #f5f7fb;
  --color-bg-alt: #ebf0f8;
  --color-text: #111111;
  --color-muted: #4a4f57;
  --color-card: #ffffff;
  --color-card-border: rgba(0,0,0,.12);
}

/* =========================================
   BASE
========================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--color-text);
  background:
    linear-gradient(to right, var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(120deg, var(--grid-diag-dark) 20%, var(--grid-diag2-dark) 80%),
    linear-gradient(180deg, #0a0e17 0%, var(--color-bg) 100%);
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
}

/* Light: samo drugačija pozadina (tokeni već overridani gore) */
html[data-theme="light"] body {
  background:
    linear-gradient(to right, var(--grid-line-light) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-light) 1px, transparent 1px),
    linear-gradient(120deg, var(--grid-diag-light) 20%, var(--grid-diag2-light) 80%),
    linear-gradient(180deg, #f8f9fb 0%, #e8ecf5 100%);
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
}

/* anchor scroll offset za sticky header */
section[id] { scroll-margin-top: 80px; }

/* Utilities */
.muted { color: var(--color-muted); }
.small { font-size: .95rem; }
.tiny { font-size: .85rem; }
.hidden { display: none; }

/* =========================================
   LAYOUT
========================================= */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}
.section { padding: var(--section-padding) 0; }
.section.alt { background: var(--color-bg-alt); }
.section-head { margin-bottom: 24px; }
.section-head h2 { margin: 0 0 8px; font-size: 28px; }

/* =========================================
   HEADER & NAV
========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,14,23,.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
html[data-theme="light"] .site-header {
  background: rgba(255,255,255,.6);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;              /* ne prelamaj brand */
}
.pulse-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 0 12px var(--color-brand);
}
html[data-theme="light"] .logo { color: #000; }

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
  overflow-x: auto;           /* mob: horizontalni scroll */
  white-space: nowrap;        /* bez prelamanja */
  -webkit-overflow-scrolling: touch;
  padding: 0 4px;
}
.nav a {
  color: var(--color-text);
  text-decoration: none;
  opacity: .9;
}
.nav a:hover { opacity: 1; }

/* Scrollbar za nav (ne smeta ostalom) */
.nav::-webkit-scrollbar { height: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
html[data-theme="light"] .nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); }

.btn-outline {
  border: 1px solid var(--color-brand-2);
  padding: 8px 12px;
  border-radius: 10px;
}
.mode-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--color-text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* =========================================
   BUTTONS
========================================= */
.btn-primary,
.btn-secondary {
  display: inline-block;
  text-decoration: none;
  color: #000;                      /* kontrast na brand bg */
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: transform .05s ease;
}
.btn-primary { background: var(--color-brand); }
.btn-secondary { background: var(--color-brand-2); }
.btn-primary:active,
.btn-secondary:active { transform: translateY(1px); }

/* =========================================
   CARDS & GRID
========================================= */
.grid { display: grid; gap: 16px; }
.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 1fr;
}
.card {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow);
  transition: transform .08s ease, border-color .2s ease;
  height: 100%;
}
.card:hover { transform: translateY(-2px); border-color: #2b3650; }
.card h3 { margin: 0 0 6px; font-size: 20px; }
.card p { margin: 0; color: var(--color-muted); }
.card .pill {
  display: inline-block; margin-top: 10px; padding: 6px 10px;
  border-radius: 999px; background: rgba(61,167,255,.12);
  color: var(--color-brand-2); font-weight: 600; font-size: 12px;
}
.card.soon .badge {
  display: inline-block; margin-top: 12px; padding: 6px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(57,217,138,.12); color: var(--color-brand);
  border: 1px solid rgba(57,217,138,.35);
}

/* =========================================
   ABOUT
========================================= */
.about {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  align-items: center;
}
.about-media img {
  width: 100%; height: auto; max-width: 280px;
  margin: 0 auto; display: block;
  border-radius: 14px; border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow);
}

/* =========================================
   FORMS
========================================= */
.contact-form { margin-top: 8px; }
.form-grid { grid-template-columns: 1fr 1fr; }
label { display: block; }
label span { display: block; margin: 10px 0 6px; }
input, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius);
  background: #0e1320; color: var(--color-text);
  border: 1px solid var(--color-card-border); outline: none;
}
input:focus, textarea:focus { border-color: #38507a; }
.contact-form button { margin-top: 14px; }

/* =========================================
   FOOTER
========================================= */
.site-footer {
  padding: 26px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.socials { display: flex; gap: 12px; }
.social { color: goldenrod; text-decoration: none; }
.social:hover { color: var(--color-text); }

/* =========================================
   HERO 3D
========================================= */
.hero-3d {
  position: relative;
  padding: clamp(96px, 20vw, 180px) 0 clamp(48px, 8vw, 80px);
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background:
    radial-gradient(1200px 400px at 10% 120%, rgba(61,167,255,.12), transparent 60%),
    radial-gradient(900px 300px at 90% -10%, rgba(57,217,138,.10), transparent 60%),
    var(--color-bg);
}
.hero-3d::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0px, rgba(255,255,255,.06) 1px, transparent 1px, transparent 24px);
  mask: linear-gradient(to bottom, rgba(0,0,0,.6), rgba(0,0,0,0));
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-3d::before { animation: gridShift 22s linear infinite; }
  @keyframes gridShift { to { transform: translate3d(-24px, -24px, 0); } }
}
.hero-3d-inner {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.brand-3d {
  margin: 0; font-weight: 900;
  font-size: clamp(44px, 9vw, 110px);
  line-height: .95; letter-spacing: .5px;
  color: #eaf2ff; white-space: nowrap;       /* zadrži u 1 redu */
  text-shadow:
    .5px .5px 0 rgba(0,0,0,.25),
    1px 1px 0 rgba(0,0,0,.22),
    1.5px 1.5px 0 rgba(0,0,0,.20),
    2px 2px 0 rgba(0,0,0,.18),
    2.5px 2.5px 0 rgba(0,0,0,.16),
    12px 18px 30px rgba(0,0,0,.45);
  position: relative; z-index: 2;
}
.brand-3d span:first-child { color: #cfe5ff; }
.brand-3d span:last-child {
  background: linear-gradient(180deg, var(--color-brand-2) 0%, var(--color-brand) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(61,167,255,.35));
}
.hero-sparkline {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
  width: min(1100px, 92vw); height: 180px; opacity: .8; z-index: 1; pointer-events: none;
}

/* =========================================
   DISCLAIMER MODAL (force dark, scoped)
========================================= */
.disclaimer-backdrop {
  /* Scoped dark vars */
  --color-text: #e6eaf2;
  --color-muted: #9aa4b2;
  --color-card: #121826;
  --color-card-border: #1a2234;
  --color-brand: #39d98a;
  --color-brand-2: #3da7ff;

  position: fixed; inset: 0;
  background: rgba(5,8,14,.72);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); z-index: 9999;
}
.disclaimer-dialog {
  width: min(820px, 92vw);
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 16px; box-shadow: var(--shadow);
  padding: 22px;
}
.disclaimer-dialog h2 { margin: 0 0 10px; }
.disclaimer-content {
  color: var(--color-muted);
  display: grid; gap: 10px;
  max-height: 55vh; overflow: auto; padding-right: 4px;
  overscroll-behavior: contain;
}
.disc-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
/* Toggle */
.disc-lang {
  display: inline-flex; gap: 6px;
  border: 1px solid var(--color-card-border);
  background: var(--color-card); border-radius: 10px; padding: 4px;
}
.lang-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--color-text);                      /* fiksirano */
  padding: 6px 10px; border-radius: 8px; font-weight: 600; cursor: pointer;
}
.lang-btn[aria-pressed="true"] { background: rgba(255,255,255,.08); }
.lang-btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.lang-btn svg { fill: currentColor; stroke: currentColor; }

.disc-check { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.disc-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
[data-lang][hidden] { display: none !important; }
.disclaimer-backdrop[hidden] { display: none; }
body.disc-lock { overflow: hidden; }
.disc-actions .btn-primary[disabled] { opacity: .6; cursor: not-allowed; pointer-events: none; }

/* Scrollbar u modal contentu */
.disclaimer-content::-webkit-scrollbar { width: 10px; }
.disclaimer-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
.disclaimer-content::-webkit-scrollbar-track { background: transparent; }

/* =========================================
   POSTS (for articles.html)
========================================= */
.post-card { display: flex; flex-direction: column; min-height: 100%; }
.post-img {
  width: 100%; height: 160px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--color-card-border);
  margin-bottom: 10px;
}
.post-title {
  margin: 0 0 6px; font-size: 20px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-date { margin: 0 0 10px; }
.post-excerpt {
  margin: 0 0 12px; color: var(--color-text); opacity: .95;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06);
}
.pill-free { background: rgba(61,167,255,.12); color: var(--color-brand-2); }
.subscribe-card { margin-top: 12px; }
.subscribe-title { margin: 0 0 6px; }
.subscribe-copy { margin: 0 0 10px; }
.subscribe-embed {
  border: 1px solid var(--color-card-border);
  background: #0e1320; border-radius: var(--radius); width: 100%;
}

/* =========================================
   COOKIES banner (force dark, scoped)
   (cookies.js injektira svoj CSS; ovdje samo osiguramo tamne tokene)
========================================= */
#fpCookieBanner {
  --color-text:#e6eaf2;
  --color-muted:#9aa4b2;
  --color-card:#121826;
  --color-card-border:#1a2234;
  --color-brand:#39d98a;
  --color-brand-2:#3da7ff;
  color-scheme: dark;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 10px; }
}

@media (max-width: 480px) {
  .disclaimer-dialog { padding: 18px; }
  .disc-lang { padding: 3px; }
  .lang-btn { padding: 5px 8px; }
}

/* ——— Fix: disclaimer tekst uvijek svijetao (force dark) ——— */
.disclaimer-backdrop .disclaimer-dialog,
.disclaimer-backdrop .disclaimer-dialog h1,
.disclaimer-backdrop .disclaimer-dialog h2,
.disclaimer-backdrop .disclaimer-dialog label,
.disclaimer-backdrop .disclaimer-dialog .disc-check span,
.disclaimer-backdrop .disclaimer-dialog a {
  color: var(--color-text);
}

/* Paragrafi u sadržaju neka budu muted, kao prije */
.disclaimer-backdrop .disclaimer-content p {
  color: var(--color-muted);
}

/* === Mobile centering polish (ne mijenja desktop layout) === */
@media (max-width: 700px) {
  /* Header: složi logo iznad i centriraj nav */
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    height: auto;          /* da ne reže sadržaj kad se wrapa */
    padding: 10px 0;
  }
  .logo {
    width: 100%;
    justify-content: center;     /* centriraj "Financial Pulse" */
  }
  .nav {
    width: 100%;
    justify-content: center;     /* linkovi startaju iz centra */
  }

  /* Naslovi sekcija i about tekst u centru */
  .section-head { text-align: center; }
  .about .about-text { text-align: center; }
}

@media (max-width: 700px) {
  /* Footer u koloni, centriran */
  .footer-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .socials { justify-content: center; }
}

/* Disclaimer header (naslov + EN/HR) centriraj na malim ekranima */
@media (max-width: 540px) {
  .disc-head {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* Cookies banner: tekst i gumbi centrirani na mobitelu */
@media (max-width: 540px) {
  #fpCookieBanner .inner {
    justify-content: center;
    text-align: center;
  }
  #fpCookieBanner p { flex: 1 1 100%; }
  #fpCookieBanner .actions {
    width: 100%;
    justify-content: center;
  }
}












