/* =============================================
   AffixIO — Unified Fintech Theme
   2026 · Professional Trust-First Design System
   ============================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand */
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --accent: #0ea5e9;
  --accent-light: #38bdf8;

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Neutrals */
  --neutral-900: #0f172a;
  --neutral-800: #1e293b;
  --neutral-700: #334155;
  --neutral-600: #475569;
  --neutral-500: #64748b;
  --neutral-400: #94a3b8;
  --neutral-300: #cbd5e1;
  --neutral-200: #e2e8f0;
  --neutral-100: #f1f5f9;
  --neutral-50: #f8fafc;

  /* Surfaces */
  --text: #0f172a;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;

  /* Spacing */
  --header-h: 72px;
  --container-max: 1200px;
  --container-px: clamp(1rem, 4vw, 3rem);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --duration: 200ms;
}

/* ---------- Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --bg: #0f172a;
    --bg-alt: #1e293b;
  }
}

/* ---------- Modern Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Fluid Typography ---------- */
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 3vw + 0.5rem, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.15rem, 2vw + 0.25rem, 1.5rem); font-weight: 600; line-height: 1.3; }
h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
p { font-size: 1rem; line-height: 1.7; }
small { font-size: 0.875rem; }

code, pre {
  font-family: var(--font-mono);
}

/* ---------- Container ---------- */
.afxo-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* =============================================
   HEADER — Unified Sticky Navbar
   ============================================= */
.afxo-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--header-h);
  background: var(--neutral-900);
  border-block-end: 1px solid rgba(255,255,255,.06);
  z-index: 1000;
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.afxo-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* Logo */
.afxo-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.afxo-header__logo img {
  height: 32px;
  width: auto;
}

.afxo-header__logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

/* Nav */
.afxo-header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.afxo-header__nav a {
  color: var(--neutral-300);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--duration) var(--ease);
  white-space: nowrap;
}

.afxo-header__nav a:hover {
  color: #fff;
}

/* CTA button in header */
.afxo-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
  border: none;
  cursor: pointer;
}

.afxo-header__cta:hover {
  background: var(--accent);
  transform: scale(1.02);
}

/* Header search (afxo-header) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header-search {
  display: inline-flex;
  align-items: center;
}
.header-search form {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.header-search input[type="search"] {
  width: 140px;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  background: var(--neutral-800);
  color: var(--neutral-100);
}
.header-search input[type="search"]::placeholder {
  color: var(--neutral-500);
}
.header-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}
.header-search button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  background: transparent;
  border: none;
  color: var(--neutral-400);
  cursor: pointer;
  border-radius: 4px;
}
.header-search button[type="submit"]:hover {
  color: #fff;
}
@media (max-width: 768px) {
  .header-search input[type="search"] { width: 120px; }
}

/* Mobile hamburger */
.afxo-header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.afxo-header__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--neutral-300);
  border-radius: 2px;
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

@media (max-width: 768px) {
  .afxo-header__nav {
    position: fixed;
    inset-block-start: var(--header-h);
    inset-inline: 0;
    background: var(--neutral-900);
    flex-direction: column;
    padding: 1.5rem var(--container-px) 2rem;
    gap: 1rem;
    border-block-end: 1px solid rgba(255,255,255,.06);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 300ms var(--ease), opacity 300ms var(--ease);
    pointer-events: none;
  }

  .afxo-header__nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .afxo-header__nav a {
    font-size: 1rem;
    padding-block: 0.35rem;
  }

  .afxo-header__hamburger {
    display: flex;
  }
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.afxo-main {
  padding-block-start: calc(var(--header-h) + 2rem);
  padding-block-end: 3rem;
  min-height: 60vh;
}

/* =============================================
   FOOTER — Unified Dark Footer
   ============================================= */
.afxo-footer {
  background: var(--neutral-900);
  color: var(--neutral-400);
  padding-block: 3.5rem 1.5rem;
  margin-block-start: 4rem;
  border-block-start: 1px solid rgba(255,255,255,.06);
}

.afxo-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-block-end: 2.5rem;
}

.afxo-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.afxo-footer__brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.afxo-footer__brand-logo img {
  height: 28px;
  width: auto;
}

.afxo-footer__brand-logo span {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.afxo-footer__brand p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--neutral-400);
  max-width: 280px;
}

.afxo-footer__col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-200);
  margin-block-end: 1rem;
}

.afxo-footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.afxo-footer__col a {
  font-size: 0.875rem;
  color: var(--neutral-400);
  transition: color var(--duration) var(--ease);
}

.afxo-footer__col a:hover {
  color: var(--accent-light);
}

.afxo-footer__bottom {
  border-block-start: 1px solid rgba(255,255,255,.08);
  padding-block-start: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

.afxo-footer__bottom a {
  color: var(--neutral-400);
  transition: color var(--duration) var(--ease);
}

.afxo-footer__bottom a:hover {
  color: var(--accent-light);
}

.afxo-footer__legal {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .afxo-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .afxo-footer__grid {
    grid-template-columns: 1fr;
  }
  .afxo-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

/* Buttons */
.afxo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.afxo-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.afxo-btn:active {
  transform: translateY(0) scale(1);
}

.afxo-btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(30,64,175,.3);
}

.afxo-btn--primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.afxo-btn--accent {
  background: var(--accent);
  color: #fff;
}

.afxo-btn--accent:hover {
  background: #0284c7;
}

.afxo-btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--neutral-200);
}

.afxo-btn--outline:hover {
  border-color: var(--primary);
  background: var(--neutral-50);
}

/* Cards */
.afxo-card {
  background: var(--bg);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.afxo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Badge */
.afxo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.afxo-badge--primary {
  background: rgba(30,64,175,.1);
  color: var(--primary);
}

.afxo-badge--success {
  background: rgba(16,185,129,.1);
  color: var(--success);
}

/* Section spacing */
.afxo-section {
  padding-block: clamp(3rem, 6vw, 5rem);
}

/* Lead paragraph */
.afxo-lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-light);
  line-height: 1.7;
  max-width: 680px;
}

/* Breadcrumb */
.afxo-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-block-end: 1.5rem;
}

.afxo-breadcrumb a {
  color: var(--primary);
  transition: color var(--duration) var(--ease);
}

.afxo-breadcrumb a:hover {
  color: var(--accent);
}

.afxo-breadcrumb span {
  color: var(--neutral-400);
}

/* Grid helpers */
.afxo-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

.afxo-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
}

/* =============================================
   BACKWARD-COMPAT OVERRIDES
   Legacy site.css classes that still appear in
   page-specific <main> content.
   ============================================= */

/* Keep .container working inside main content */
.afxo-main .container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* Preserve common PSEO page classes */
.afxo-main .lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-light);
  line-height: 1.7;
}

.afxo-main .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-block-end: 1.5rem;
}

.afxo-main .breadcrumb a {
  color: var(--primary);
}

.afxo-main .breadcrumb a:hover {
  color: var(--accent);
}

.afxo-main .use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-block: 1.5rem;
}

.afxo-main .use-case-card {
  background: var(--bg-alt);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.afxo-main .use-case-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.afxo-main .use-case-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-block-end: 0.5rem;
  color: var(--text);
}

.afxo-main .use-case-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* FAQ styling for PSEO pages */
.afxo-main .faq-item {
  border-block-end: 1px solid var(--neutral-200);
  padding-block: 1rem;
}

.afxo-main .faq-q {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  margin-block-end: 0.5rem;
}

.afxo-main .faq-a {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* CTA section */
.afxo-main .cta-section {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-align: center;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  margin-block: 3rem;
}

.afxo-main .cta-section h2 {
  color: #fff;
}

.afxo-main .cta-section p {
  color: rgba(255,255,255,.85);
}

/* Stat boxes / metric cards */
.afxo-main .stat-card {
  text-align: center;
  padding: 1.5rem;
}

.afxo-main .stat-card .number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
}

/* Code blocks */
.afxo-main pre {
  background: var(--neutral-800);
  color: var(--neutral-100);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
}

.afxo-main code {
  font-family: var(--font-mono);
}

.afxo-main p code {
  background: var(--neutral-100);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--primary);
}

/* API response panels */
.afxo-main .api-response {
  background: var(--neutral-800);
  color: var(--neutral-100);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Integration / tech cards */
.afxo-main .integration-card,
.afxo-main .tech-card,
.afxo-main .feature-card {
  background: var(--bg);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.afxo-main .integration-card:hover,
.afxo-main .tech-card:hover,
.afxo-main .feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Hub page grids */
.afxo-main .hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  margin-block: 2rem;
}

/* Responsive inline-style grid overrides (from old site.css) */
.afxo-main [style*="grid-template-columns:1fr 1fr"],
.afxo-main [style*="grid-template-columns: 1fr 1fr"] {
  gap: 1.5rem;
}

@media (max-width: 700px) {
  .afxo-main [style*="grid-template-columns:1fr 1fr"],
  .afxo-main [style*="grid-template-columns: 1fr 1fr"],
  .afxo-main [style*="grid-template-columns:repeat(3"],
  .afxo-main [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================
   SCROLL-TO-TOP (optional progressive enhance)
   ============================================= */
.afxo-scroll-top {
  position: fixed;
  inset-block-end: 2rem;
  inset-inline-end: 2rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
  z-index: 999;
}

.afxo-scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}
