/* ============================================================
   AgileTrust Tokenization — Shared Stylesheet
   Design system based on mockup_v1 visual language
   ============================================================ */

:root {
  /* Brand palette */
  --navy:        #1B2D4A;
  --navy-mid:    #243B5E;
  --navy-light:  #2E4A74;
  --teal:        #2EC4B6;
  --teal-dark:   #25a99d;
  --teal-bg:     rgba(46,196,182,0.12);
  --teal-light:  #E0F7F5;
  --brand-cyan:  #2EC4B6;   /* alias → teal */
  --brand-blue:  #2EC4B6;   /* alias usado en inline styles de HTML */
  --brand-green: #22c55e;
  --brand-yellow:#d97706;
  --brand-red:   #ef4444;
  --brand-purple:#8b5cf6;

  /* Surfaces & text (light theme) */
  --surface:       #F7F9FB;
  --surface-alt:   #EEF1F5;
  --white:         #FFFFFF;

  /* Aliases for backward-compat with inline styles in HTML pages */
  --brand-dark:    #F7F9FB;   /* was dark bg — now maps to light surface */
  --brand-navy:    #EEF1F5;   /* was dark navy bg — now maps to surface-alt */
  --gray-text:     #5A6A7A;
  --gray-border:   #DDE3EA;
  --text-primary:  #1B2D4A;
  --text-secondary:#5A6A7A;
  --text-muted:    #8A9BB0;
  --border:        #DDE3EA;

  /* Code blocks keep dark background for legibility */
  --code-bg:     #0F1923;
  --code-border: #263347;

  /* Radius */
  --radius:    8px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow:    0 4px 24px rgba(27,45,74,0.10);
  --shadow-lg: 0 8px 40px rgba(27,45,74,0.16);

  /* Misc */
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--surface);
  color: var(--navy);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(27,45,74,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0;
}

/* Nav inner container */
.nav > .nav-inner,
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1320px; margin: 0 auto; padding: 0 32px;
  gap: 16px;
}

/* When nav uses old flex layout (without nav-inner) */
.nav:not(:has(.nav-inner)) {
  display: flex; align-items: center; padding: 0 24px; height: 68px;
}

.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--white);
  font-weight: 800; font-size: 1.05rem; white-space: nowrap;
  letter-spacing: -0.3px; flex-shrink: 0;
}
.nav-brand .logo {
  width: 32px; height: 32px;
  background: var(--teal);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 900; color: var(--navy);
}
.nav-logo-text {
  font-size: 1.15rem; font-weight: 800; color: var(--white);
  letter-spacing: -0.3px;
}
.nav-logo-text span { color: var(--teal); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; flex-shrink: 0;
}
/* When nav-links is a <ul> inside .nav (old layout) */
.nav > .nav-links { margin-left: auto; }

.nav-links a {
  color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: .84rem; font-weight: 500;
  transition: color var(--transition);
  padding: .3rem .6rem;
  white-space: nowrap;
  border-radius: 6px;
}
.nav-links a:hover { color: var(--teal); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--teal); }

.nav-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Compact button variant for navbar */
.btn-nav-cta {
  padding: 8px 16px !important;
  font-size: .84rem !important;
  border-radius: 7px;
  white-space: nowrap;
}

/* Badge in nav */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-bg); color: var(--teal);
  padding: 3px 10px; border-radius: 100px;
  font-size: .72rem; font-weight: 700; letter-spacing: .4px;
  border: 1px solid rgba(46,196,182,0.25);
  vertical-align: middle; margin-left: .35rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 12px 24px; border-radius: var(--radius);
  font-size: .95rem; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--teal); color: var(--navy);
}
.btn-primary:hover {
  background: #25b0a4; transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(46,196,182,0.35);
}
.btn-secondary {
  background: var(--white); color: var(--navy);
  border: 1.5px solid var(--gray-border);
}
.btn-secondary:hover {
  background: var(--white); border-color: var(--teal);
  color: var(--teal);
}
.btn-outline {
  background: transparent; color: var(--white);
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-navy {
  background: var(--navy); color: var(--white);
}
.btn-navy:hover { background: var(--navy-mid); transform: translateY(-1px); }

/* ── Container ───────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a3a5c 100%);
  padding: 80px 0 72px; position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(46,196,182,0.07) 0%, transparent 65%);
  pointer-events: none;
}
/* Legacy hero (centered, no grid) */
.hero:not(:has(.hero-grid)) {
  text-align: center;
  padding: 80px 24px 72px;
}
.hero-tag, .hero-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-bg); color: var(--teal);
  padding: 6px 14px; border-radius: 100px;
  font-size: .82rem; font-weight: 600; letter-spacing: .4px;
  border: 1px solid rgba(46,196,182,0.25);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800;
  line-height: 1.1; color: var(--white);
  margin-bottom: 20px;
}
.hero h1 span { color: var(--teal); }
.hero p, .hero-sub {
  font-size: 1.1rem; color: rgba(255,255,255,0.72);
  max-width: 520px; margin-bottom: 32px;
}
/* Centered hero keeps p centered */
.hero:not(:has(.hero-grid)) p { margin-left: auto; margin-right: auto; }

.hero-cta, .hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.hero:not(:has(.hero-grid)) .hero-cta { justify-content: center; }

/* Hero grid (two-column) */
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center; position: relative;
}
.hero-visual { display: flex; justify-content: center; align-items: center; }

/* Hero terminal block (right column) */
.hero-terminal {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-terminal-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--code-border);
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot-r { background: #ff5f57; }
.term-dot-y { background: #febc2e; }
.term-dot-g { background: #28c840; }
.term-title {
  margin-left: 8px; font-size: .75rem;
  color: rgba(255,255,255,0.35); font-family: var(--font-mono);
}
.hero-terminal pre {
  padding: 20px 22px;
  font-family: var(--font-mono); font-size: .82rem;
  line-height: 1.7; color: #c9d1d9;
  overflow-x: auto;
}
.hero-terminal .t-cmd   { color: #79c0ff; }
.hero-terminal .t-key   { color: #ff7b72; }
.hero-terminal .t-val   { color: #a5d6ff; }
.hero-terminal .t-teal  { color: var(--teal); }
.hero-terminal .t-muted { color: rgba(255,255,255,0.35); }
.hero-terminal .t-green { color: #56d364; }

/* ── Sections ────────────────────────────────────────────── */
.section {
  padding: 80px 24px;
  max-width: 1140px; margin: 0 auto;
}
.section-alt {
  background: var(--white);
}
.section-full { max-width: 100%; padding: 80px 24px; }

/* Section wrappers that alternate bg */
.bg-surface  { background: var(--surface); }
.bg-white    { background: var(--white); }
.bg-navy     { background: var(--navy); }

.section-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--teal); margin-bottom: .75rem;
}
h2 { font-size: 1.85rem; font-weight: 700; margin-bottom: .75rem; color: var(--navy); }
h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .5rem; color: var(--navy); }
h4 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; color: var(--gray-text); }
p  { color: var(--gray-text); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Cards ───────────────────────────────────────────────── */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem; margin-top: 2rem;
}
.card {
  background: var(--white);
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-md); padding: 28px 24px;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(46,196,182,0.08), var(--shadow);
  transform: translateY(-2px);
}
.card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}
.icon-blue   { background: rgba(46,196,182,0.12); }
.icon-green  { background: rgba(34,197,94,0.12); }
.icon-purple { background: rgba(139,92,246,0.12); }
.icon-yellow { background: rgba(217,119,6,0.12); }
.icon-cyan   { background: rgba(46,196,182,0.12); }
.icon-red    { background: rgba(239,68,68,0.12); }

/* ── Code blocks ─────────────────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius); overflow: hidden; margin: 1.25rem 0;
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--code-border);
  font-size: .8rem;
}
.code-lang {
  color: rgba(255,255,255,0.45); font-family: var(--font-mono); font-size: .75rem;
}
.copy-btn {
  background: none; border: 1px solid var(--code-border);
  color: rgba(255,255,255,0.4);
  font-size: .75rem; padding: .2rem .6rem; border-radius: 4px; cursor: pointer;
  transition: var(--transition);
}
.copy-btn:hover { border-color: var(--teal); color: var(--teal); }
.copy-btn.copied { border-color: var(--brand-green); color: var(--brand-green); }
pre {
  padding: 1.25rem; overflow-x: auto; font-family: var(--font-mono);
  font-size: .85rem; line-height: 1.65; color: #c9d1d9;
}
code { font-family: var(--font-mono); font-size: .875em; }
:not(pre) > code {
  background: var(--teal-bg); border: 1px solid rgba(46,196,182,0.2);
  padding: .15em .4em; border-radius: 4px; color: var(--teal);
  font-size: .875em;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  background: var(--surface); color: var(--gray-text); font-weight: 600;
  text-align: left; padding: .7rem 1rem;
  border-bottom: 2px solid var(--gray-border);
}
td { padding: .7rem 1rem; border-bottom: 1px solid var(--gray-border); color: var(--gray-text); }
td:first-child { color: var(--navy); font-family: var(--font-mono); font-size: .85em; }
tr:hover td { background: rgba(46,196,182,0.03); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: .25rem;
  border-bottom: 2px solid var(--gray-border); margin-bottom: 1.5rem;
}
.tab-btn {
  background: none; border: none; color: var(--gray-text);
  padding: .6rem 1rem; font-size: .9rem; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Callouts ────────────────────────────────────────────── */
.callout {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  border-left: 3px solid; margin: 1.25rem 0; font-size: .92rem;
}
.callout p { margin: 0; }
.callout-info    {
  background: rgba(46,196,182,0.08); border-color: var(--teal);
  color: var(--navy-light);
}
.callout-warn    {
  background: rgba(217,119,6,0.08); border-color: var(--brand-yellow);
  color: #92400e;
}
.callout-danger  {
  background: rgba(239,68,68,0.08); border-color: var(--brand-red);
  color: #991b1b;
}
.callout-success {
  background: rgba(34,197,94,0.08); border-color: var(--brand-green);
  color: #166534;
}

/* ── Encoding pills ──────────────────────────────────────── */
.pill {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: .2em .6em; border-radius: 20px; font-family: var(--font-mono);
}
.pill-utf8    {
  background: rgba(46,196,182,0.12); color: var(--teal);
  border: 1px solid rgba(46,196,182,0.25);
}
.pill-latin1  {
  background: rgba(139,92,246,0.12); color: var(--brand-purple);
  border: 1px solid rgba(139,92,246,0.25);
}
.pill-numeric {
  background: rgba(34,197,94,0.12); color: #16a34a;
  border: 1px solid rgba(34,197,94,0.25);
}

/* ── Two-col layout ──────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* ── Sidebar layout ──────────────────────────────────────── */
.sidebar-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 2rem;
  max-width: 1200px; margin: 0 auto; padding: 2rem 24px;
}
@media (max-width: 900px) { .sidebar-layout { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 88px; align-self: start; }
.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: block; padding: .4rem .75rem; border-radius: var(--radius);
  color: var(--gray-text); text-decoration: none; font-size: .9rem;
  transition: var(--transition); border-left: 2px solid transparent;
}
.sidebar-nav li a:hover {
  color: var(--navy); background: var(--surface);
}
.sidebar-nav li a.active {
  color: var(--teal); border-left-color: var(--teal);
  background: rgba(46,196,182,0.08);
}
.sidebar-section {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
  padding: .8rem .75rem .3rem;
}

/* ── Steps ───────────────────────────────────────────────── */
.steps { list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step; padding: 1.25rem 1.25rem 1.25rem 4rem;
  position: relative; border-bottom: 1px solid var(--gray-border);
  background: var(--white);
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step); position: absolute; left: 1rem; top: 1.25rem;
  width: 28px; height: 28px; background: var(--teal); color: var(--navy);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: #111E2E;
  padding: 48px 0 24px;
  color: rgba(255,255,255,0.5);
  font-size: .85rem;
}
.footer .container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 24px; flex-wrap: wrap; gap: 24px;
}
.footer-brand .nav-logo-text { font-size: 1.2rem; }
.footer-brand p {
  font-size: .82rem; color: rgba(255,255,255,0.4);
  max-width: 220px; margin-top: 8px; margin-bottom: 0;
}
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 {
  font-size: .85rem; font-weight: 700;
  color: rgba(255,255,255,0.8); margin-bottom: 14px;
}
.footer-col a {
  display: block; font-size: .82rem; margin-bottom: 8px;
  color: rgba(255,255,255,0.5); transition: color var(--transition);
  text-decoration: none;
}
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; font-size: .78rem;
}
.footer-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(46,196,182,0.08); border: 1px solid rgba(46,196,182,0.15);
  padding: 4px 12px; border-radius: 100px;
  font-size: .75rem; color: var(--teal); font-weight: 600;
}

/* Legacy simple footer */
.footer p { color: rgba(255,255,255,0.45); margin-bottom: .4rem; }
.footer a { color: rgba(255,255,255,0.5); text-decoration: none; }
.footer a:hover { color: var(--teal); }

/* ── Status badges ───────────────────────────────────────── */
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-get       { color: var(--teal); }
.status-post      { color: var(--brand-green); }
.status-dot-get   { background: var(--teal); }
.status-dot-post  { background: var(--brand-green); }

/* ── Stat blocks ─────────────────────────────────────────── */
.stat {
  text-align: center; padding: 1.5rem 1rem;
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
}
.stat-num {
  font-size: 2.2rem; font-weight: 800; color: var(--teal); line-height: 1;
}
.stat-label {
  font-size: .8rem; color: var(--text-muted); margin-top: .4rem;
  text-transform: uppercase; letter-spacing: .06em;
}

/* ── Compat items ────────────────────────────────────────── */
.compat-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.compat-item:hover { border-color: var(--teal); }
.compat-icon { font-size: 1.4rem; }

/* ── Encoding card ───────────────────────────────────────── */
.enc-card {
  background: var(--white); border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-md); padding: 1.5rem;
  transition: all var(--transition);
}
.enc-card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.enc-card h3 { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.example-row {
  display: flex; align-items: center; gap: .75rem;
  font-family: var(--font-mono); font-size: .85rem;
  padding: .5rem 0; border-bottom: 1px solid var(--gray-border);
}
.example-row:last-child { border-bottom: none; }
.arrow { color: var(--text-muted); }
.token-val { color: var(--teal); font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 60px 16px 52px; }
  .section { padding: 60px 16px; }
  .two-col { grid-template-columns: 1fr; }
  .sidebar-layout { padding: 1rem 16px; }
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Swagger overrides (light theme) ─────────────────────── */
.swagger-ui { font-family: 'Segoe UI', system-ui, sans-serif !important; }
