/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
}

.nav-inner .logo {
  display: inline-block;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: url('/public/img/logo_frontend.svg') no-repeat 0 center;
  width: 200px;
  height: 40px;
  background-size: contain;
  font-size: 0;
  color: transparent;
}


.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}

.nav-links a:hover {
  color: var(--text-strong);
}

.nav-links a.active {
  color: var(--blue-500);
}

.nav-cta {
  background: var(--blue-500);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: background .2s, transform .15s;
}

/* Separator before auth buttons */
.nav-sep {
  width: 1px;
  height: 24px;
  background: var(--gray-100);
  flex-shrink: 0;
}

/* Login link */
.nav-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700) !important;
  transition: color .2s;
}

.nav-login:hover {
  color: var(--blue-500) !important;
}

.nav-login svg {
  width: 18px;
  height: 18px;
}

/* Admin button (shown when logged in) — hidden by default, shown via JS */
.nav-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--gray-50);
  color: var(--gray-700) !important;
  border: 1px solid var(--gray-100);
  transition: all .2s;
}

.nav-admin:hover {
  background: var(--blue-50);
  border-color: var(--blue-100);
  color: var(--blue-600) !important;
}

.nav-admin svg {
  width: 18px;
  height: 18px;
}

.nav-admin .admin-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--blue-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.nav-cta:hover {
  background: var(--blue-600) !important;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
  color: var(--text-strong);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  body:has(.nav-links.open) #consent-open-button {
    display: none !important;
  }
  body:has(.nav-links.open) {
    overflow: hidden;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    gap: 0;
    height: calc(100vh - 64px);
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 1;
    overflow-y: auto;
  }

  .nav-sep {
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: var(--sp-4) var(--sp-8);
    border-bottom: 1px solid var(--gray-50);
    width: 100%;
  }
}

.page-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px); /* 64px = .nav-inner height */
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
}


.section {
  padding: 80px 32px;
}

.section-sm {
  padding: 48px 32px;
}

.section-lg {
  padding: 96px 32px;
}

.section-muted {
  background: var(--muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-dark {
  background: var(--gray-900);
  color: #fff;
}

.section-dark .label-upper {
  color: var(--blue-300);
}

.section-dark h2 {
  color: #fff;
}

.section-dark .lead {
  color: var(--gray-400);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue-500);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.7;
}

/* ── HOMEPAGE HERO ── */
.hero {
  padding: 140px 32px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 28px;
  border: 1px solid var(--blue-100);
}

.hero-badge svg {
  width: 16px;
  height: 16px;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── SUBPAGE HERO ── */
.page-hero {
  padding: 130px 32px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.page-hero .section-label {
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-strong);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.page-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

section {
  padding: 80px 32px;
}

/* ── CTA SECTION ── */
.cta-section {
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--bg) 100%);
  border-top: 1px solid var(--blue-100);
  text-align: center;
  padding: 80px 32px;
}

.cta-section .section-title {
  max-width: 600px;
  margin: 0 auto 12px;
}

.cta-section .section-sub {
  margin: 0 auto 36px;
}

.cta-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── CODE WINDOW ── */
.code-window {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f1117;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot.r {
  background: #FF5F57;
}

.code-dot.y {
  background: #FEBC2E;
}

.code-dot.g {
  background: #28C840;
}

.code-filename {
  margin-left: 12px;
  font-size: 0.78rem;
  color: var(--gray-500);
  font-family: var(--font-mono);
}

.code-body {
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.85;
  overflow-x: auto;
}

.code-body code {
  white-space: pre;
  background: transparent;
  color: inherit;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Syntax highlighting */
.hl-tag {
  color: #FF7B72
}

.hl-attr {
  color: #79C0FF
}

.hl-str {
  color: #A5D6FF
}

.hl-cmt {
  color: #546178;
  font-style: italic
}

.hl-kw {
  color: #FF7B72
}

.hl-fn {
  color: #D2A8FF
}

.hl-var {
  color: #FFA657
}

.hl-txt {
  color: #c9d1d9
}

/* ── CODE TABS (dark bg) ── */
.code-tabs {
  display: flex;
  gap: 4px;
  margin-top: 40px;
}

.code-tab {
  padding: 10px 22px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: var(--gray-400);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: none;
  transition: all .2s;
  font-family: var(--font-body);
}

.code-tab.active {
  background: #0f1117;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

.code-tab:hover:not(.active) {
  color: var(--gray-200);
}

.code-panel {
  display: none;
}

.code-panel.active {
  display: block;
}


/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.footer-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}

/* Brand column */
.footer-brand .logo {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  background: url('/public/img/logo-small_frontend.svg') no-repeat 0 center;
  background-size: contain;
  padding-left: 44px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.65;
  max-width: 260px;
  margin-bottom: 0;
}

/* Link columns */
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 0.88rem;
  color: var(--gray-600, #565b6b);
  text-decoration: none;
  transition: color .2s;
}

.footer-col a:hover {
  color: var(--blue-500);
}

/* Footer bottom bar */
.footer-bottom {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 32px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--gray-400);
}

.footer-legal {
  display: flex;
  gap: 24px;
}

.footer-legal a {
  font-size: 0.82rem;
  color: var(--gray-400);
  text-decoration: none;
  transition: color .2s;
}

.footer-legal a:hover {
  color: var(--gray-700);
}


/* ── GLOBAL RESPONSIVE ── */
@media (max-width: 860px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 500px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 120px 20px 60px;
  }

  .page-hero {
    padding: 110px 20px 48px;
  }

  .section, .cta-section {
    padding: 60px 20px;
  }
}
