/* ============================================================
   Openprovider Developer Portal — theme
   Brand: red #E8112D (open) + navy #1A1F2C (provider)
   ============================================================ */

:root {
  /* Brand */
  --op-red: #E8112D;
  --op-red-bright: #F81B39;
  --op-red-dark: #C20E26;
  --op-navy: #1A1F2C;
  --op-navy-2: #232A3B;

  /* Neutrals */
  --ink: #1A1F2C;
  --gray-800: #2B313F;
  --gray-700: #344054;
  --gray-600: #4B5565;
  --gray-500: #667085;
  --gray-400: #98A2B3;
  --gray-300: #D0D5DD;
  --gray-200: #E4E7EC;
  --gray-100: #F2F4F7;
  --gray-50:  #F8FAFC;
  --white: #ffffff;

  /* Accents */
  --green: #09B257;
  --blue: #1468B8;

  /* Layout */
  --header-h: 64px;
  --maxw: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --shadow-md: 0 4px 8px -2px rgba(16,24,40,.10), 0 2px 4px -2px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 24px -6px rgba(16,24,40,.12), 0 4px 8px -4px rgba(16,24,40,.08);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--op-red); text-decoration: none; }
a:hover { color: var(--op-red-dark); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { color: var(--op-navy); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; line-height: 1;
  padding: 12px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--op-red); color: #fff; }
.btn-primary:hover { background: var(--op-red-dark); color: #fff; box-shadow: var(--shadow-md); }
.btn-secondary { background: #fff; color: var(--op-navy); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); color: var(--op-navy); border-color: var(--gray-400); }
.btn-ghost { background: transparent; color: var(--op-navy); }
.btn-ghost:hover { background: var(--gray-100); color: var(--op-navy); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--gray-200);
  height: var(--header-h);
}
.site-header .inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { height: 32px; width: 32px; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand .brand-text b { font-size: 16px; color: var(--op-navy); font-weight: 800; letter-spacing: -.02em; }
.brand .brand-text span { font-size: 11px; color: var(--op-red); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  color: var(--gray-700); font-weight: 500; font-size: 15px; white-space: nowrap;
  padding: 8px 14px; border-radius: 8px; transition: all .15s ease;
}
.nav a:hover { color: var(--op-navy); background: var(--gray-100); }
.nav a.active { color: var(--op-red); font-weight: 600; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 26px; height: 26px; stroke: var(--op-navy); }

@media (max-width: 1024px) {
  .nav, .header-actions .btn-secondary { display: none; }
  .site-header .inner { gap: 12px; }
  .header-actions { margin-left: auto; }
  .nav-toggle { display: block; margin-left: 10px; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--gray-200);
    padding: 12px; gap: 2px; box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.open a { padding: 13px 14px; font-size: 16px; display: flex; align-items: center; min-height: 44px; }
}

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(900px 380px at 88% -10%, rgba(232,17,45,.10), transparent 60%),
    linear-gradient(180deg, var(--gray-50), #fff);
  border-bottom: 1px solid var(--gray-200);
  padding: 84px 0 72px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--op-red); background: rgba(232,17,45,.08);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 52px; font-weight: 800; letter-spacing: -.025em; margin-bottom: 18px; }
.hero h1 .accent { color: var(--op-red); }
.hero p.lead { font-size: 19px; color: var(--gray-600); max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 880px) {
  .hero { padding: 56px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 38px; }
}
.hero-grid > * { min-width: 0; }  /* let the code card shrink instead of overflowing */

/* Phones: drop the header CTA so brand + menu always fit (no h-scroll) */
@media (max-width: 480px) {
  .header-actions .btn-primary { display: none; }
  .hero h1 { font-size: 32px; }
}

/* ---------------- Code card ---------------- */
.code-card {
  background: var(--op-navy); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid #2A3142;
}
.code-card .bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: #11151F; border-bottom: 1px solid #2A3142;
}
.code-card .bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.code-card .bar .dot.r { background: #FF5F57; }
.code-card .bar .dot.y { background: #FEBC2E; }
.code-card .bar .dot.g { background: #28C840; }
.code-card .bar .label { margin-left: 8px; color: #8A94A6; font-size: 12px; font-family: var(--mono); }
.code-card pre {
  margin: 0; padding: 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: #E6E9F0;
}
.code-card .tok-method { color: #7EE787; font-weight: 700; }
.code-card .tok-url { color: #79C0FF; }
.code-card .tok-key { color: #FF7B95; }
.code-card .tok-str { color: #FFD9A0; }
.code-card .tok-cmt { color: #6B7689; }

/* ---------------- Sections ---------------- */
.section { padding: 76px 0; }
.section.alt { background: var(--gray-50); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: 34px; margin-bottom: 12px; }
.section-head p { font-size: 17px; color: var(--gray-600); margin: 0; }

/* ---------------- Cards grid ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.api-card {
  display: block; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 24px; transition: all .18s ease; height: 100%;
}
.api-card:hover { border-color: var(--op-red); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.api-card .ic {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(232,17,45,.08); margin-bottom: 16px;
}
.api-card .ic svg { width: 24px; height: 24px; stroke: var(--op-red); fill: none; }
.api-card h3 { font-size: 18px; margin-bottom: 6px; color: var(--op-navy); }
.api-card p { margin: 0 0 14px; color: var(--gray-600); font-size: 14.5px; }
.api-card .endpoints { display: flex; flex-wrap: wrap; gap: 6px; }
.api-card .ep {
  font-family: var(--mono); font-size: 11.5px; color: var(--gray-700);
  background: var(--gray-100); border: 1px solid var(--gray-200);
  padding: 3px 8px; border-radius: 6px;
}
.api-card .more { color: var(--op-red); font-weight: 600; font-size: 14px; }

/* ---------------- Steps ---------------- */
.steps { display: grid; gap: 20px; counter-reset: step; max-width: 820px; margin: 0 auto; }
.step {
  display: grid; grid-template-columns: 48px 1fr; gap: 20px; align-items: start;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px;
}
.step .num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--op-red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
}
.step h3 { margin: 4px 0 6px; font-size: 18px; }
.step p { margin: 0 0 12px; color: var(--gray-600); }

/* ---------------- Feature list ---------------- */
.feature-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width:900px){ .feature-row{ grid-template-columns:1fr; } }
.feature { padding: 4px; }
.feature .ic { width: 40px; height:40px; border-radius:10px; background: rgba(232,17,45,.08); display:flex; align-items:center; justify-content:center; margin-bottom:14px; }
.feature .ic svg { width:22px;height:22px;stroke:var(--op-red);fill:none; }
.feature h3 { font-size:17px; margin-bottom:6px; }
.feature p { margin:0; color: var(--gray-600); font-size:15px; }

/* ---------------- Generic page ---------------- */
.page { padding: 56px 0 72px; }
.page-head { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.page-head .eyebrow { margin-bottom: 14px; }
.page-head h1 { font-size: 40px; margin-bottom: 14px; }
.page-head p { font-size: 18px; color: var(--gray-600); margin: 0; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { font-size: 26px; margin: 40px 0 14px; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; }
.prose p, .prose li { color: var(--gray-700); font-size: 16px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose code {
  font-family: var(--mono); font-size: 13.5px; background: var(--gray-100);
  border: 1px solid var(--gray-200); padding: 2px 6px; border-radius: 5px; color: var(--op-navy);
}
.prose pre {
  background: var(--op-navy); color: #E6E9F0; padding: 18px 20px; border-radius: var(--radius-sm);
  overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; margin: 16px 0;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }

.callout {
  display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius-sm);
  background: rgba(20,104,184,.06); border: 1px solid rgba(20,104,184,.20); margin: 20px 0;
}
.callout.warn { background: rgba(232,17,45,.05); border-color: rgba(232,17,45,.22); }
.callout .ic { flex-shrink: 0; font-size: 20px; }
.callout p { margin: 0; font-size: 15px; color: var(--gray-700); }

.table-wrap { overflow-x: auto; margin: 18px 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.tbl th, table.tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--gray-200); }
table.tbl th { background: var(--gray-50); color: var(--op-navy); font-weight: 600; }
table.tbl td code { font-size: 12.5px; }

/* ---------------- CTA band ---------------- */
.cta-band {
  background: linear-gradient(120deg, var(--op-navy), #2A3346);
  border-radius: 16px; padding: 48px; text-align: center; color: #fff; margin: 8px 0;
}
.cta-band h2 { color: #fff; font-size: 30px; margin-bottom: 12px; }
.cta-band p { color: #C7CDD9; font-size: 17px; max-width: 560px; margin: 0 auto 26px; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--op-navy); color: #C7CDD9; padding: 56px 0 28px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.footer-brand .brand-text b { color: #fff; }
.footer-brand p { font-size: 14px; color: #94A0B4; max-width: 280px; margin: 14px 0 0; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer-col a { display: block; color: #AEB7C7; font-size: 14.5px; padding: 5px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #2C3344; margin-top: 40px; padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13.5px; color: #8A94A6;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------- Documentation (Redoc) ---------------- */
.doc-shell { height: calc(100vh - var(--header-h)); overflow: hidden; }
#redoc { height: 100%; overflow: auto; }
/* Hide Redoc's own loading flash background */
redoc { display: block; }

/* ============================================================
   Touch devices (iPad & other tablets/phones) — comfortable
   tap targets (WCAG / Apple HIG ≈ 44px) and no hover-stuck UI.
   ============================================================ */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-lg { min-height: 48px; }
  .nav-toggle { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .api-button { min-height: 52px; }
  .api-card { padding: 22px; }
  .ds-search input { min-height: 44px; }
  .ds-group a { padding-top: 12px; padding-bottom: 12px; min-height: 44px; display: flex; align-items: center; }
  .code-tabs button { min-height: 44px; }
  .xml-cmd-head { min-height: 52px; }
  .src-link { min-height: 40px; }
  /* Swagger UI operation rows — larger touch area */
  .swagger-ui .opblock-summary { min-height: 48px; }
  .swagger-ui .btn { min-height: 44px; }
  /* Disable sticky translucency repaint jank & hover lifts on touch */
  .api-card:hover { transform: none; }
  .api-button:hover { transform: none; }
}

/* iPad landscape / small laptops: keep the code card from overflowing the hero */
@media (max-width: 1024px) {
  .code-card pre { font-size: 12.5px; }
}
