/* API Page — [bs_api_page] shortcode
 * Mobile-first, scoped under #bs-api-page
 * Brand palette: #1DB0E1 (blue), #206389 (dark-blue), #9AE0F7 (light-blue),
 *                #F3D758 (yellow), #171717 (dark-gray), #EDEDED (light-gray)
 */

body:has(#bs-api-page) .page-header { display: none; }
.e-con:has(#bs-api-page) > .elementor-widget-shortcode { width: 100%; }

#bs-api-page {
    --ap-blue: #1DB0E1;
    --ap-blue-hover: #206389;
    --ap-blue-light: #e8f7fc;
    --ap-light-blue: #9AE0F7;
    --ap-yellow: #F3D758;
    --ap-text: #171717;
    --ap-text-muted: #555;
    --ap-border: #EDEDED;
    --ap-card-bg: #FAFAFA;
    --ap-white: #FFFFFF;
    --ap-section-alt: #f7f8fa;
    --ap-radius: 12px;
    --ap-max-width: 1140px;
    --ap-code-bg: #1e1e2e;
    --ap-code-header: #2d2d3f;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ap-text);
    line-height: 1.6;
}

#bs-api-page *, #bs-api-page *::before, #bs-api-page *::after { box-sizing: border-box; }
#bs-api-page a { color: var(--ap-blue); text-decoration: none; }
#bs-api-page a:hover { color: var(--ap-blue-hover); }

.bs-ap-container {
    max-width: var(--ap-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Icon base ─────────────────────────────────────── */

#bs-api-page .bs-ap-icon { display: inline-flex; align-items: center; }
#bs-api-page .bs-ap-icon svg { width: 24px; height: 24px; }

/* ── Hero ──────────────────────────────────────────── */

#bs-api-page .bs-ap-hero {
    background: var(--ap-blue-light);
    padding: 28px 20px 40px;
    border-bottom: 1px solid var(--ap-border);
}

#bs-api-page .bs-ap-hero-inner {
    max-width: var(--ap-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}

#bs-api-page .bs-ap-breadcrumb { font-size: 14px; margin-bottom: 14px; }
#bs-api-page .bs-ap-breadcrumb a { color: var(--ap-text-muted); }
#bs-api-page .bs-ap-breadcrumb a:hover { color: var(--ap-blue); }
#bs-api-page .bs-ap-breadcrumb-sep { color: var(--ap-text-muted); margin: 0 8px; }
#bs-api-page .bs-ap-breadcrumb span:last-child { color: var(--ap-text); }

#bs-api-page .bs-ap-hero-heading {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.2;
    color: var(--ap-text);
}

#bs-api-page .bs-ap-hero-subtitle {
    font-size: 16px;
    color: var(--ap-text-muted);
    margin: 0;
    max-width: 520px;
    line-height: 1.65;
}

#bs-api-page .bs-ap-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 16px;
    background: var(--ap-white);
    border: 1px solid var(--ap-border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-blue);
}

#bs-api-page .bs-ap-hero-badge .bs-ap-icon { display: flex; color: var(--ap-blue); }
#bs-api-page .bs-ap-hero-badge .bs-ap-icon svg { width: 16px; height: 16px; }

/* ── Code Block (hero visual) ─────────────────────── */

#bs-api-page .bs-ap-hero-visual { display: none; }

#bs-api-page .bs-ap-code-block {
    border-radius: var(--ap-radius);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-width: 420px;
}

#bs-api-page .bs-ap-code-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--ap-code-header);
}

#bs-api-page .bs-ap-code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
#bs-api-page .bs-ap-code-dot--red { background: #ff5f57; }
#bs-api-page .bs-ap-code-dot--yellow { background: #febc2e; }
#bs-api-page .bs-ap-code-dot--green { background: #28c840; }
#bs-api-page .bs-ap-code-title {
    margin-left: 8px;
    color: #888;
    font-size: 12px;
}

#bs-api-page .bs-ap-code-body {
    background: var(--ap-code-bg);
    padding: 16px;
    margin: 0;
    overflow-x: auto;
}

#bs-api-page .bs-ap-code-body code {
    color: #cdd6f4;
    font-family: inherit;
    font-size: inherit;
}
#bs-api-page .bs-ap-code-muted { color: #89b4fa; }
#bs-api-page .bs-ap-code-url { color: #a6e3a1; }
#bs-api-page .bs-ap-code-key { color: #89b4fa; }
#bs-api-page .bs-ap-code-str { color: #a6e3a1; }
#bs-api-page .bs-ap-code-num { color: #fab387; }
#bs-api-page .bs-ap-code-pos { color: #a6e3a1; }

/* ── Stats ─────────────────────────────────────────── */

#bs-api-page .bs-ap-stats { padding: 40px 0; background: var(--ap-white); }

#bs-api-page .bs-ap-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

#bs-api-page .bs-ap-stat-card {
    text-align: center;
    padding: 24px 16px;
    background: var(--ap-card-bg);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
}

#bs-api-page .bs-ap-stat-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--ap-blue);
}
#bs-api-page .bs-ap-stat-icon svg { width: 28px; height: 28px; }

#bs-api-page .bs-ap-stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--ap-text);
    line-height: 1.2;
}

#bs-api-page .bs-ap-stat-label {
    font-size: 14px;
    color: var(--ap-text-muted);
    margin-top: 4px;
}

/* ── Sections ──────────────────────────────────────── */

#bs-api-page .bs-ap-section { padding: 48px 0; }
#bs-api-page .bs-ap-section--alt { background: var(--ap-section-alt); }

#bs-api-page .bs-ap-section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 36px;
}

#bs-api-page .bs-ap-overline {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ap-blue);
    margin-bottom: 8px;
}

#bs-api-page .bs-ap-section-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.25;
    color: var(--ap-text);
}

#bs-api-page .bs-ap-section-header p {
    font-size: 15px;
    color: var(--ap-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* ── Features Grid ─────────────────────────────────── */

#bs-api-page .bs-ap-features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

#bs-api-page .bs-ap-feature-card {
    background: var(--ap-white);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
    padding: 24px;
}

#bs-api-page .bs-ap-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--ap-blue-light);
    border-radius: 10px;
    margin-bottom: 14px;
    color: var(--ap-blue);
}
#bs-api-page .bs-ap-feature-icon svg { width: 22px; height: 22px; }

#bs-api-page .bs-ap-feature-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--ap-text);
}

#bs-api-page .bs-ap-feature-card p {
    font-size: 14px;
    color: var(--ap-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* ── Signup Card ───────────────────────────────────── */

#bs-api-page .bs-ap-signup-card {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

#bs-api-page .bs-ap-signup-header { margin-bottom: 28px; }

#bs-api-page .bs-ap-signup-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--ap-text);
}

#bs-api-page .bs-ap-signup-header p {
    font-size: 15px;
    color: var(--ap-text-muted);
    margin: 0;
    line-height: 1.6;
}

#bs-api-page .bs-ap-signup-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#bs-api-page .bs-ap-signup-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    background: var(--ap-white);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
    height: 52px;
}

#bs-api-page .bs-ap-signup-field .bs-ap-icon { color: var(--ap-text-muted); flex-shrink: 0; }
#bs-api-page .bs-ap-signup-field .bs-ap-icon svg { width: 20px; height: 20px; }

#bs-api-page .bs-ap-signup-field input {
    flex: 1;
    border: 0;
    background: none;
    font-size: 15px;
    color: var(--ap-text);
    outline: none;
    min-width: 0;
}

#bs-api-page .bs-ap-signup-field input::placeholder { color: #999; }

#bs-api-page .bs-ap-signup-field:focus-within {
    border-color: var(--ap-blue);
    box-shadow: 0 0 0 3px rgba(29, 176, 225, 0.12);
}

#bs-api-page .bs-ap-signup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 28px;
    background: var(--ap-blue);
    color: #fff;
    border: 0;
    border-radius: var(--ap-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

#bs-api-page .bs-ap-signup-btn:hover { background: var(--ap-blue-hover); }
#bs-api-page .bs-ap-signup-btn:disabled { opacity: 0.6; cursor: not-allowed; }
#bs-api-page .bs-ap-signup-btn .bs-ap-icon svg { width: 18px; height: 18px; }

#bs-api-page .bs-ap-signup-message { margin-top: 16px; text-align: center; }
#bs-api-page .bs-ap-signup-message p { margin: 0; font-size: 14px; line-height: 1.5; display: none; }
#bs-api-page .bs-ap-signup-message.is-success .bs-ap-msg-success { display: block; color: #16a34a; }
#bs-api-page .bs-ap-signup-message.is-error .bs-ap-msg-error { display: block; color: #dc2626; }
#bs-api-page .bs-ap-signup-message.is-already .bs-ap-msg-already { display: block; color: var(--ap-blue); }
#bs-api-page .bs-ap-signup-message.is-validation .bs-ap-msg-validation { display: block; color: #dc2626; }
#bs-api-page .bs-ap-signup-message.is-rate-limit .bs-ap-msg-rate-limit { display: block; color: #dc2626; }

/* ── FAQ ───────────────────────────────────────────── */

#bs-api-page .bs-ap-faq {
    max-width: 720px;
    margin: 0 auto;
}

#bs-api-page .bs-ap-faq-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--ap-text);
}

#bs-api-page .bs-ap-block-accent {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

#bs-api-page .bs-ap-faq-item {
    border-bottom: 1px solid var(--ap-border);
}

#bs-api-page .bs-ap-faq-item:first-child {
    border-top: 1px solid var(--ap-border);
}

#bs-api-page .bs-ap-faq-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    padding: 16px 0;
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    color: var(--ap-text);
    line-height: 1.4;
}

#bs-api-page .bs-ap-faq-trigger:hover { color: var(--ap-blue); }

#bs-api-page .bs-ap-faq-chevron {
    flex-shrink: 0;
    color: var(--ap-text-muted);
}

#bs-api-page .bs-ap-faq-trigger[aria-expanded="true"] .bs-ap-faq-chevron {
    transform: rotate(180deg);
}

#bs-api-page .bs-ap-faq-panel { overflow: hidden; }

#bs-api-page .bs-ap-faq-inner {
    padding: 0 0 16px;
}

#bs-api-page .bs-ap-faq-inner p {
    margin: 0;
    font-size: 14px;
    color: var(--ap-text-muted);
    line-height: 1.7;
}

/* ── CTA Banner ────────────────────────────────────── */

#bs-api-page .bs-ap-cta-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 36px 28px;
    background: var(--ap-blue);
    border-radius: var(--ap-radius);
    text-align: center;
    color: #fff;
}

#bs-api-page .bs-ap-cta-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}

#bs-api-page .bs-ap-cta-text p {
    font-size: 15px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

#bs-api-page .bs-ap-cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

#bs-api-page .bs-ap-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

#bs-api-page .bs-ap-btn--white {
    background: #fff;
    color: var(--ap-blue);
}
#bs-api-page .bs-ap-btn--white:hover { background: #f0f0f0; color: var(--ap-blue-hover); }

#bs-api-page .bs-ap-btn--ghost {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
#bs-api-page .bs-ap-btn--ghost:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* ── Responsive ────────────────────────────────────── */

@media (min-width: 640px) {
    #bs-api-page .bs-ap-stats-grid { grid-template-columns: repeat(4, 1fr); }
    #bs-api-page .bs-ap-features-grid { grid-template-columns: repeat(2, 1fr); }

    #bs-api-page .bs-ap-signup-row {
        flex-direction: row;
    }
    #bs-api-page .bs-ap-signup-field { flex: 1; }
}

@media (min-width: 768px) {
    #bs-api-page .bs-ap-hero { padding: 48px 20px 56px; }
    #bs-api-page .bs-ap-hero-heading { font-size: 38px; }

    #bs-api-page .bs-ap-hero-inner {
        grid-template-columns: 1fr 1fr;
    }
    #bs-api-page .bs-ap-hero-visual { display: block; }

    #bs-api-page .bs-ap-section { padding: 64px 0; }
    #bs-api-page .bs-ap-section-header h2 { font-size: 28px; }
    #bs-api-page .bs-ap-signup-header h2 { font-size: 28px; }
    #bs-api-page .bs-ap-stat-number { font-size: 32px; }
}

/* ── Dark Mode ─────────────────────────────────────── */

html.bs-dark #bs-api-page {
    --ap-text: #e4e4ed;
    --ap-text-muted: #9898b0;
    --ap-border: #2d2d48;
    --ap-card-bg: #1c1c2e;
    --ap-white: #141422;
    --ap-blue-light: rgba(29, 176, 225, 0.08);
    --ap-section-alt: #1a1a2c;
    --ap-code-bg: #0f0f1a;
    --ap-code-header: #1a1a2c;
}

html.bs-dark #bs-api-page .bs-ap-hero {
    background: #141422;
    border-bottom-color: var(--ap-border);
}

html.bs-dark #bs-api-page .bs-ap-hero-badge {
    background: #1c1c2e;
}

html.bs-dark #bs-api-page .bs-ap-stats { background: #141422; }

html.bs-dark #bs-api-page .bs-ap-feature-icon {
    background: rgba(29, 176, 225, 0.12);
}

html.bs-dark #bs-api-page .bs-ap-signup-field {
    background: #1c1c2e;
}
html.bs-dark #bs-api-page .bs-ap-signup-field input { color: #e4e4ed; }
html.bs-dark #bs-api-page .bs-ap-signup-field input::placeholder { color: #666; }

html.bs-dark #bs-api-page .bs-ap-faq-trigger { color: #e4e4ed; }
html.bs-dark #bs-api-page .bs-ap-faq-trigger:hover { color: var(--ap-blue); }

html.bs-dark #bs-api-page .bs-ap-code-block {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

html.bs-dark #bs-api-page .bs-ap-cta-banner {
    background: #206389;
}
html.bs-dark #bs-api-page .bs-ap-btn--white { color: #206389; }
html.bs-dark #bs-api-page .bs-ap-btn--white:hover { color: #206389; }

html.bs-dark #bs-api-page .bs-ap-signup-message.is-success .bs-ap-msg-success { color: #4ade80; }
html.bs-dark #bs-api-page .bs-ap-signup-message.is-already .bs-ap-msg-already { color: #7cc8f0; }
