/* Integration documentation — shared layout */
:root {
  --kie-blue: #0050d7;
  --kie-blue-soft: #e8f0ff;
  --bg: #f4f6fb;
  --card: #fff;
  --text: #1a1f36;
  --muted: #5c6378;
  --border: #d8deea;
  --diagram-stroke: #9aa8c4;
}

.integrate-main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.integrate-main.wide {
  max-width: 58rem;
}

.integrate-breadcrumb {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.integrate-breadcrumb a {
  color: var(--kie-blue);
  text-decoration: none;
}

.integrate-breadcrumb a:hover {
  text-decoration: underline;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.panel h1 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

#starters h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

a.starters-index-link {
  display: inline-flex;
  color: var(--kie-blue);
  line-height: 0;
}

a.starters-index-link:hover {
  color: var(--text);
}

a.starters-index-link svg {
  width: 1rem;
  height: 1rem;
}

.panel h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.hint,
.lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.925rem;
}

.hint-spaced-top {
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.dns-reserve {
  margin: 0.85rem 0 0;
  color: #c62828;
}

.lead {
  font-size: 1rem;
  color: var(--text);
}

ol.steps,
ul.compact {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

ol.steps > li,
ul.compact li {
  margin-bottom: 0.55rem;
}

ol.steps > li:last-child,
ul.compact li:last-child {
  margin-bottom: 0;
}

table.api {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0.75rem 0 1rem;
}

table.api th,
table.api td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

table.api th {
  background: #f8faff;
  font-weight: 600;
}

table.api code {
  font-size: 0.82rem;
}

table.api.api-stack {
  table-layout: fixed;
}

table.api.api-stack col:nth-child(1) {
  width: 15rem;
}

table.api.api-stack col:nth-child(2) {
  width: 12.5rem;
}

table.api.api-stack td:first-child {
  word-break: break-word;
}

table.compare td:first-child {
  white-space: nowrap;
  font-weight: 600;
}

pre {
  margin: 0.75rem 0 1rem;
  padding: 1rem 1.1rem;
  background: #1a1f36;
  color: #e8ecf4;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.45;
}

pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

a.inline {
  color: var(--kie-blue);
}

.file-tree {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin: 0.75rem 0 1rem;
  line-height: 1.5;
}

.aside {
  border-left: 3px solid var(--kie-blue);
  padding: 0.65rem 0.9rem;
  margin: 1rem 0 0;
  background: #f8faff;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Plan — auth surfaces (colored left border) */
.auth-surface-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.1rem 0 0.25rem;
}

@media (min-width: 720px) {
  .auth-surface-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .auth-surface-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.auth-surface-card {
  --auth-accent: #2563eb;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.15rem 1.15rem 1.2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--auth-accent);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-surface-card:hover {
  border-color: var(--auth-accent);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.auth-surface-card--web { --auth-accent: #2563eb; }
.auth-surface-card--android { --auth-accent: #16a34a; }
.auth-surface-card--public { --auth-accent: #0d9488; }
.auth-surface-card--private { --auth-accent: #d97706; }
.auth-surface-card--pam { --auth-accent: #475569; }
.auth-surface-card--windows { --auth-accent: #0369a1; }

.auth-surface-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--auth-accent);
}

.auth-surface-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.auth-surface-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 0.5rem;
}

.mode-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mode-card:hover {
  border-color: var(--kie-blue);
  box-shadow: 0 2px 8px rgba(0, 80, 215, 0.08);
}

.mode-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--kie-blue);
}

.mode-card p {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.mode-card .go {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--kie-blue);
}

/* Live embed demos — compact 4-up grid (sign-in page) */
.demo-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 0;
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.demo-card:hover {
  border-color: var(--kie-blue);
}

.demo-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.demo-card p {
  margin: 0;
  flex: 1;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.demo-card .go {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--kie-blue);
}

@media (min-width: 720px) {
  .demo-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .demo-cards { grid-template-columns: repeat(4, 1fr); }
}

.mode-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.mode-badge-guest { background: #eef2ff; color: #4338ca; }
.mode-badge-oneshot { background: #ecfdf5; color: #047857; }
.mode-badge-native { background: #e8f0ff; color: #0050d7; }
.mode-badge-bridge { background: #fef3c7; color: #b45309; }

.auth-tier-ladder {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.35rem;
  margin: 1rem 0;
}

.auth-tier-step {
  flex: 1 1 7rem;
  min-width: 6.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfd;
  text-align: center;
}

.auth-tier-step.is-current {
  border-color: var(--kie-blue);
  background: var(--kie-blue-soft);
}

.auth-tier-step.is-past {
  opacity: 0.72;
}

.auth-tier-name {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
}

.auth-tier-tag {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 0.15rem;
}

.auth-tier-arrow {
  align-self: center;
  color: var(--diagram-stroke);
  font-size: 1rem;
  flex: 0 0 auto;
}

.callout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

@media (max-width: 640px) {
  .callout-grid {
    grid-template-columns: 1fr;
  }

  .curl-app-picker {
    margin-left: 0;
    width: 100%;
  }

  .curl-app-select {
    min-width: 0;
    max-width: none;
  }
}

.callout {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.callout strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kie-blue);
}

.callout-muted {
  background: #f8faff;
}

.flow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin: 1rem 0;
}

.flow-step {
  flex: 1 1 8rem;
  min-width: 7rem;
  background: var(--kie-blue-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  font-size: 0.8rem;
}

.flow-step strong {
  display: block;
  color: var(--kie-blue);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

a.flow-step.academy-roadmap-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.flow-step.academy-roadmap-link:hover {
  border-color: var(--kie-blue);
  box-shadow: 0 0 0 1px var(--kie-blue-soft);
}

.flow-step.is-current {
  border-color: var(--kie-blue);
  background: #fff;
  box-shadow: 0 0 0 1px var(--kie-blue-soft);
}

.flow-arrow {
  flex: 0 0 auto;
  align-self: center;
  color: var(--diagram-stroke);
  font-size: 1.25rem;
}

/* How it works — stepper + step cards (sign-in page) */
.how-step-title .mark { margin-left: auto; }

.read-legend {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.read-legend-title {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  font-weight: 650;
}

.read-legend ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.read-legend li {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin: 0;
  font-size: 0.875rem;
}

.mark {
  flex: 0 0 auto;
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.45;
  white-space: nowrap;
  vertical-align: baseline;
}

.mark-adapt {
  color: #8a5500;
  background: #fff4e0;
  border: 1px solid #e2b15a;
}

.mark-fixed {
  color: #0d7a3e;
  background: #e8f6ee;
  border: 1px solid #8fceb0;
}

.how-stepper {
  margin: 0 0 1.25rem;
}

.how-stepper-row {
  margin: 0;
}

a.flow-step.how-stepper-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.flow-step.how-stepper-link:hover {
  border-color: var(--kie-blue);
  box-shadow: 0 0 0 1px var(--kie-blue-soft);
}

a.flow-step.how-stepper-link:focus-visible {
  outline: 2px solid var(--kie-blue);
  outline-offset: 2px;
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.how-step {
  background: #f8faff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--kie-blue);
  border-radius: 8px;
  padding: 1rem 1.15rem 1.15rem;
  scroll-margin-top: 5rem;
}

.how-step-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.how-step-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--kie-blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.how-step .hint {
  margin-top: 0;
}

.how-step pre:last-child {
  margin-bottom: 0;
}

.curl-app-picker {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  width: min(100%, 34rem);
  margin: 0 0 1.25rem auto;
}

.curl-app-picker-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.curl-app-select {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
}

.curl-check-copy {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.curl-check-pre-wrap {
  position: relative;
  margin: 0.45rem 0 0.75rem;
}

#test-your-server .curl-check-pre {
  margin-top: 0;
  margin-bottom: 0;
  padding-right: 2.75rem;
}

button.curl-check-copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8ecf4;
  cursor: pointer;
}

button.curl-check-copy-btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

button.curl-check-copy-btn svg { width: 1rem; height: 1rem; display: block; }
button.curl-check-copy-btn .curl-check-icon-check { display: none; }

button.curl-check-copy-btn.is-copied {
  color: #8ee4b0;
  border-color: #8ee4b0;
}

button.curl-check-copy-btn.is-copied .curl-check-icon-copy { display: none; }
button.curl-check-copy-btn.is-copied .curl-check-icon-check { display: block; }

.curl-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.curl-result-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.curl-result-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  background: var(--kie-blue-soft);
  color: var(--kie-blue);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.curl-result-cmd {
  display: block;
  margin: 0 0 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #1a1f36;
  word-break: break-all;
}

.curl-result-body {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.curl-result-body strong {
  color: var(--kie-blue);
  font-weight: 600;
}

.plan-steps > li {
  margin-bottom: 0;
}

.plan-steps > li + li {
  padding-top: 1.25rem;
}

.plan-steps > li:first-child {
  padding-top: 0.5rem;
}

.plan-steps > li > strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.config-meta-list {
  margin: 0 0 1rem;
  padding-left: 0;
  list-style: none;
}

.config-meta-list dt {
  margin: 0.5rem 0 0.15rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
}

.config-meta-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.mode-cards-inline {
  margin-top: 0.85rem;
}

.mode-card-static {
  cursor: default;
}

.mode-card-static:hover {
  border-color: var(--border);
  box-shadow: none;
}

.mode-card-static h3 {
  color: var(--text);
}

.hidden {
  display: none !important;
}

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.lab-open-btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: var(--kie-blue);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.lab-open-btn:hover {
  filter: brightness(1.08);
}

.lab-apk-link {
  background: #fff;
  color: var(--kie-blue);
  border: 1px solid var(--kie-blue);
}

.diagram {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.5rem 0 1rem;
}

.experience-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.experience-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.experience-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.experience-optional {
  font-weight: 400;
  color: var(--muted);
}

.experience-field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 400 0.925rem/1.45 system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #fff;
  resize: vertical;
  min-height: 5rem;
}

.experience-field textarea:focus {
  outline: 2px solid var(--kie-blue-soft);
  border-color: var(--kie-blue);
}

.experience-actions {
  margin: 0;
}

.experience-actions .lab-open-btn {
  border: none;
  cursor: pointer;
  font: inherit;
}

.experience-actions .lab-open-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.experience-message {
  margin: 0;
  font-size: 0.875rem;
}

.experience-error {
  color: #b42318;
}

.experience-thanks h2 {
  margin-top: 0;
}

.experience-reporter {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.experience-reporter-note {
  margin-top: 0.5rem;
}
