:root {
  color-scheme: dark;
  --bg: #0d1117;
  --fg: #d6dde6;
  --muted: #8b949e;
  --panel: #161b22;
  --line: #30363d;
  --accent: #58a6ff;
  --ok: #3fb950;
  --bad: #ff7b72;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card {
  width: min(940px, 96vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.2rem 1.2rem 1.1rem;
}

/* The download page uses a two-column grid, so it needs a wider card than
 * the login / agreement pages. Kept as an opt-in modifier so the other
 * flows are unchanged. */
.card.card-wide {
  width: min(1120px, 96vw);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

h2, h3 {
  margin-top: 1rem;
  color: #e6edf3;
}

p {
  line-height: 1.4;
}

.subtle {
  color: var(--muted);
  margin-top: 0;
}

.error {
  color: var(--bad);
  margin: 0.4rem 0 0.8rem;
}

.stack {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Text + password inputs share the same field styling; the login form adds the
 * username (text) field alongside the existing password field. */
input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1722;
  color: var(--fg);
  padding: 0.62rem 0.72rem;
}

button {
  border: 1px solid #2f81f7;
  border-radius: 7px;
  background: #238636;
  color: #fff;
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.agreement-box {
  max-height: 48vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.9rem 0.95rem;
  background: #0f1722;
}

.download-list {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
}

.download-list li {
  margin: 0.7rem 0;
}

/* --- Install-method picker (tabs) --------------------------------------- *
 * Two side-by-side buttons at the top of the download card. Clicking one
 * shows its panel and hides the other. Kept as a single flex row (with
 * wrap fallback for narrow screens) so the picker never dominates the
 * page. The active tab visually merges into its panel by matching the
 * panel's background and dropping its bottom border.
 */
.install-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0 0;
  border-bottom: 1px solid var(--line);
}

.install-tab {
  background: #21262d;
  color: var(--fg);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.55rem 1rem;
  margin-bottom: -1px;               /* overlap the panel's top border */
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.install-tab:hover {
  background: #2d333b;
}

.install-tab.is-active {
  background: #0f1722;                /* matches .install-panel bg */
  border-color: var(--line);
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.install-panel {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 8px 8px 8px;
  padding: 1rem 1.1rem 1.1rem;
  background: #0f1722;
  margin-bottom: 1rem;
}

.install-panel.is-hidden {
  display: none;
}

.install-panel p {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
}

.install-panel .section-title {
  margin: 0.9rem 0 0.5rem;
  font-size: 1rem;
  color: #e6edf3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.install-panel .section-title:first-child {
  margin-top: 0;
}

/* Utility: smaller / dimmed text used in cell subtitles + small notes. */
.small {
  font-size: 0.85rem;
}

/* --- Two-column download grid ------------------------------------------- *
 * Row = two equal cells. On mobile / narrow browsers the grid collapses to
 * one column automatically (auto-fit). The "primary" modifier highlights
 * the bundle cell as the primary CTA -- accent border + green button --
 * because without the bundle there's nothing to install.
 */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.9rem;
}

.download-cell {
  border: 1px solid var(--line);
  background: #0d1117;
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.download-cell.primary {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.15) inset;
}

.download-cell h4 {
  margin: 0;
  font-size: 1rem;
  color: #e6edf3;
}

.download-cell form.inline {
  margin: 0;
  margin-top: auto;                  /* push form-wrapped buttons to cell bottom */
}

/* Download buttons. .dl-btn is the neutral secondary look (license,
 * demo zips); .dl-btn-primary is the highlighted green look for the
 * software bundle. Both are full-width inside their cell so the click
 * target is comfortably large.
 */
.dl-btn {
  display: inline-block;
  text-align: center;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #21262d;
  color: var(--fg);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  margin-top: auto;                  /* push button to bottom of cell */
}

.dl-btn:hover {
  background: #2d333b;
  border-color: var(--accent);
  text-decoration: none;
}

.dl-btn-primary {
  background: #238636;
  border-color: #2f81f7;
  color: #fff;
}

.dl-btn-primary:hover {
  background: #2ea043;
  filter: brightness(1.05);
}

/* --- AI-IDE agent prompt block ------------------------------------------ *
 * Compact scrollable pre with a top-right Copy-to-clipboard button. The
 * pre is intentionally short (max-height ~180px) since the user does not
 * need to read the prompt on-screen -- the Copy button is the interaction.
 */
.agent-prompt-wrap {
  position: relative;
}

/* Copy-to-clipboard uses the site's primary-action green so it stands out
 * as THE thing to click on the AI-agent panel (the whole panel exists to
 * hand the customer one payload to copy). Matches .dl-btn-primary on the
 * download grid for consistency. */
.agent-copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: #238636;
  color: #fff;
  border: 1px solid #2f81f7;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1;
}

.agent-copy-btn:hover {
  background: #2ea043;
  filter: brightness(1.05);
}

.agent-prompt {
  margin: 0;
  padding: 0.7rem 0.85rem;
  padding-right: 8rem;               /* reserve room for the Copy button */
  background: #0d1117;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 180px;                 /* compact -- copy button, not reading */
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Manual-install step list ------------------------------------------- *
 * Ordered list of numbered steps with inline shell snippets. Each snippet
 * is a small dark <pre class="cmd"> block so the customer can copy one
 * command at a time.
 */
.manual-steps {
  margin: 0.4rem 0 0.7rem;
  padding-left: 1.3rem;
}

.manual-steps li {
  margin: 0.55rem 0;
  line-height: 1.45;
}

.manual-steps code {
  background: #0d1117;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

pre.cmd {
  margin: 0.35rem 0 0.2rem;
  padding: 0.5rem 0.75rem;
  background: #0d1117;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow: auto;
  white-space: pre;
}
