/* =========================================================
 * BYOK Page — scoped CSS (reuses .ag-* base from ai-gateway-page.css)
 * Only BYOK-specific components are defined here.
 * Base layout, sidebar, sections, tables, typography all come from
 * ai-gateway-page.css which must ALSO be loaded on this route.
 * ========================================================= */

/* --- Route guard: hide React root on BYOK route --- */
html.byok-route #root { display: none !important; }
html.byok-route body { background: #FAFAFA; }

/* ============ SECTION 01 — Workflow Pipeline ============ */
.ag-b-pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  padding: 16px 0;
}
@media (max-width: 1023px) {
  .ag-b-pipeline { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ag-b-pipeline { grid-template-columns: 1fr; }
}

.ag-b-pipe-node {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  background: #FFFFFF;
  min-height: 110px;
  position: relative;
}

.ag-b-pipe-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #94A3B8;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ag-b-pipe-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.ag-b-pipe-arrow {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #CBD5E1;
  font-weight: 400;
}
@media (max-width: 1023px) {
  .ag-b-pipe-arrow { display: none; }
}

/* ============ Pill/status badges ============ */
.ag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.ag-pill--green {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}
.ag-pill--gray {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

/* ============ Links ============ */
.ag-b-link {
  color: #111827;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.ag-b-link:hover { color: #F5B800; }
.ag-b-link--disabled {
  color: #CBD5E1;
  cursor: default;
}
.ag-b-link--disabled:hover { color: #CBD5E1; }

/* ============ Section 03 — Step list ============ */
.ag-b-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  overflow: hidden;
}

.ag-b-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #EAEAEA;
  align-items: start;
}
.ag-b-step:last-child { border-bottom: none; }

.ag-b-step__num {
  font-size: 13px;
  font-weight: 700;
  color: #B77900;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding-top: 2px;
}

.ag-b-step__body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.ag-b-step__body p {
  font-size: 13px;
  line-height: 1.5;
  color: #64748B;
  margin: 0;
}

/* ============ Section 03 — Key preview ============ */
.ag-b-key-preview {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  background: #FAFAFA;
  max-width: 480px;
}

.ag-b-key-field label {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.ag-b-key-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  background: #FFFFFF;
  color: #111827;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.ag-b-key-input::before {
  content: attr(data-placeholder);
  color: #CBD5E1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============ Section 05 — Empty state ============ */
.ag-b-empty {
  padding: 32px 16px;
  text-align: center;
}

.ag-b-empty__title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.ag-b-empty__desc {
  font-size: 13px;
  line-height: 1.5;
  color: #64748B;
  margin: 0;
}

.ag-b-empty-row td {
  padding: 24px 16px !important;
  border: none !important;
}

/* ============ Section 06 — CTAs ============ */
.ag-b-ctas {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 767px) {
  .ag-b-ctas { flex-direction: column; }
}

/* =========================================================
 * BYOK DESKTOP GRID — aligned to AI Gateway page structure
 * ========================================================= */
@media (min-width: 1025px) {
  #byok-root .ag-main {
    width: min(100%, 1440px);
    max-width: 1440px;
    box-sizing: border-box;
    grid-template-columns: 180px minmax(0, 1fr);
    column-gap: 48px;
    padding-inline: 32px;
  }

  #byok-root .ag-main__content {
    max-width: 1180px;
    min-width: 0;
  }

  #byok-root .ag-sidebar { padding-top: 72px; }
}

/* Match AI Gateway's large-desktop outer edge alignment. */
@media (min-width: 1200px) {
  #byok-root .ag-main { padding-inline: 0; }
}
