@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #f5f1ea;
  --bg-accent: #e2d5c2;
  --panel: #ffffff;
  --panel-border: #e0d7c9;
  --ink: #2b2b2b;
  --muted: #6e655a;
  --accent: #c45b2d;
  --accent-dark: #9e461f;
  --shadow: rgba(44, 32, 20, 0.12);
  --accent-2: #f8f1e6;
  --accent-3: #f3e7d6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 45%),
    radial-gradient(circle at bottom right, rgba(196, 91, 45, 0.15), transparent 50%),
    var(--bg);
  min-height: 100vh;
}

.oauth2-tool {
  margin: 2rem auto;
  padding: 1.5rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(44, 32, 20, 0.12);
  max-width: 1200px;
}

.oauth2-tool h2,
.oauth2-tool h3 {
  margin-top: 0;
}

.oauth2-tool .intro {
  color: var(--muted);
  margin: 0.25rem 0 1rem 0;
}

.oauth2-tool .tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 1rem 0;
}

.oauth2-tool .tab {
  border: 1px solid var(--panel-border);
  background: #fff7ed;
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.oauth2-tool .tab[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 10px 18px rgba(196, 91, 45, 0.25);
}

.oauth2-tool .panel {
  display: grid;
  gap: 1rem;
}

.oauth2-tool .layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.oauth2-tool .panel .summary {
  background: var(--accent-2);
  border: 1px solid var(--panel-border);
  padding: 0.75rem;
  border-radius: 8px;
}

.oauth2-tool .stepper {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.9rem;
  background: #ffffff;
}

.oauth2-tool .step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.oauth2-tool .step-title {
  font-weight: 600;
}

.oauth2-tool .step-body {
  min-height: 5rem;
  color: var(--ink);
}

.oauth2-tool .step-example {
  margin-top: 0.6rem;
  padding: 0.45rem 0.6rem;
  background: #fff8f0;
  border: 1px dashed #eadfce;
  border-radius: 6px;
  font-family: "IBM Plex Mono", "Menlo", "SFMono-Regular", "Consolas", "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: #3b2f25;
  white-space: pre-wrap;
}

.oauth2-tool .step-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.oauth2-tool .view-controls {
  margin-top: 0.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.oauth2-tool .toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.oauth2-tool button.nav {
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--ink);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
}

.oauth2-tool button.nav.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(196, 91, 45, 0.22);
}

.oauth2-tool button.nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.oauth2-tool .mini {
  font-size: 0.9rem;
  color: var(--muted);
}

.oauth2-tool .pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #f4f4f4;
  border: 1px solid var(--panel-border);
  font-size: 0.85rem;
  color: var(--muted);
}

.oauth2-tool .swimlane {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.oauth2-tool .swimlane-header,
.oauth2-tool .swimlane-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.oauth2-tool .swimlane-header {
  background: #f7efe2;
  border-bottom: 1px solid var(--panel-border);
  font-weight: 600;
  font-size: 0.95rem;
}

.oauth2-tool .swimlane-header div,
.oauth2-tool .swimlane-row div {
  padding: 0.75rem;
  border-right: 1px solid #eadfce;
  min-height: 4.5rem;
}

.oauth2-tool .swimlane-header div:last-child,
.oauth2-tool .swimlane-row div:last-child {
  border-right: none;
}

.oauth2-tool .lane-bubble {
  background: #ffffff;
  border: 1px solid #eadfce;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  box-shadow: 0 6px 14px rgba(44, 32, 20, 0.12);
  position: relative;
  z-index: 1;
}

.oauth2-tool .lane-arrow {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.oauth2-tool .lane-empty {
  color: #c1c1c1;
  font-size: 0.85rem;
}

.oauth2-tool .swimlane-steps {
  display: grid;
}

.oauth2-tool .swimlane-row {
  position: relative;
  padding-top: 0.9rem;
}

.oauth2-tool .swimlane-row[data-active="true"] {
  background: var(--accent-3);
}

.oauth2-tool .swimlane-row::before {
  content: attr(data-step);
  position: absolute;
  left: 0.5rem;
  top: 0.4rem;
  font-size: 0.75rem;
  color: #5b7384;
}

.oauth2-tool .swimlane-row .lane-arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.oauth2-tool .swimlane-row .lane-arrows line {
  stroke: #a15a39;
  stroke-width: 1.5;
  opacity: 0.65;
}

.oauth2-tool .swimlane-row .lane-arrows marker path {
  fill: #a15a39;
}

.oauth2-tool .swimlane-row[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .oauth2-tool {
    padding: 1rem;
    margin: 1.25rem;
  }
}
