/*
  The onboarding site. The product's tokens, so a customer who walks from here into their own
  deployment sees one product. One accent: purple means the next action or focus. Green and amber
  mean done and needs-attention, and nothing else. ST-9138.
*/

:root {
  --purple: #753CBE;
  --purple-hover-dark: #422B5F;
  --purple-wash: #E0D9EF;
  --bg: #F3F2F1;
  --surface: #FDFDFD;
  --surface-2: #F5F5F5;
  --line: #E6E6E6;
  --line-2: #D8D6D4;
  --ink: #242424;
  --ink-2: #4A4A4A;
  --ink-3: #616161;
  --good: #4E8A1E;
  --good-wash: #EEF6E3;
  --warn: #B26A00;
  --warn-wash: #FBF0DF;
  --bad: #B50E15;
  --code-bg: #2A2038;
  --code-ink: #F2EEF8;
  /* Text on a purple surface: light on the brand purple, dark on the lifted purple of the dark theme. */
  --on-purple: #FDFCFF;
  --radius: 8px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --purple: #B18BE8;
    --purple-wash: #2A2038;
    --bg: #141414;
    --surface: #181818;
    --surface-2: #1F1F1F;
    --line: #2C2C2C;
    --line-2: #3A3A3A;
    --ink: #F0F0F0;
    --ink-2: #C4C4C4;
    --ink-3: #9A9A9A;
    --good: #9ED45C;
    --good-wash: #1D2A12;
    --warn: #E0A64A;
    --warn-wash: #2E2412;
    --bad: #F0787D;
    --code-bg: #0F0B16;
    --on-purple: #181818;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--purple); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

/* ---------------- frame ---------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 600; font-size: 16px; }
.brand-sub { color: var(--ink-3); font-size: 14px; padding-left: 10px; border-left: 1px solid var(--line-2); }

.page { max-width: 820px; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 40px) 96px; }

.langswitch { display: flex; gap: 4px; align-items: center; }
.langform { margin: 0; }
.lang {
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-2);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.lang:hover { border-color: var(--purple); color: var(--purple); }
.lang.is-current { background: var(--ink); color: var(--surface); border-color: var(--ink); cursor: default; }

/* ---------------- controls ---------------- */

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0 6px; }

input[type="text"], input[type="email"], input:not([type]), select {
  width: 100%; max-width: 440px; height: 38px; padding: 0 12px;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius);
}
input:focus, select:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-wash); }
.mono, code, pre { font-family: var(--mono); }
input.mono { letter-spacing: 0.04em; }

button { font: inherit; cursor: pointer; }
.primary {
  height: 38px; padding: 0 18px; border: 0; border-radius: var(--radius);
  background: var(--purple); color: var(--on-purple); font-weight: 600;
  transition: background-color 150ms ease-out;
}
.primary:hover { background: var(--purple-hover-dark); color: #FDFCFF; }
.ghost {
  height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.ghost:hover { border-color: var(--purple); color: var(--purple); }
.danger:hover { border-color: var(--bad); color: var(--bad); }

/* Reserved, so a refusal appearing never moves the button under the pointer. */
.refusal { min-height: 22px; margin: 12px 0; color: var(--bad); font-size: 14px; }

/* ---------------- the gate ---------------- */

.gate { max-width: 520px; }
.gate h1 { font-size: clamp(24px, 3.2vw, 30px); }
.lede { color: var(--ink-2); margin: 10px 0 8px; font-size: 16px; }
.aside { color: var(--ink-3); font-size: 13px; margin-top: 32px; }

/* Where Microsoft's consent lands: the gate's frame, with the guide's own done and needs-attention marks. */
.consented .status { display: inline-block; margin-bottom: 14px; }
.consented .aside + .aside { margin-top: 6px; }

/* ---------------- the guide ---------------- */

.guide-head h1 { font-size: clamp(24px, 3.2vw, 30px); }
.guide-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-3); font-size: 13px; margin-top: 8px; }
.guide-meta strong { color: var(--ink); font-weight: 600; }

.progress { margin: 28px 0 8px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--purple); transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1); }

.values {
  margin: 28px 0 40px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.values h2 { font-size: 15px; }
.values p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.values-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }

/* The route: numbered stops on one line, so the order is the first thing anybody sees. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; padding: 0 0 36px 52px; }
.step::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line);
}
.step:last-child::before { display: none; }
.step-number {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: 14px;
  background: var(--surface); border: 2px solid var(--line-2); color: var(--ink-2);
}
.step.is-done .step-number { background: var(--good); border-color: var(--good); color: var(--surface); }
.step.is-done::before { background: var(--good); }

.step h2 { font-size: 18px; padding-top: 4px; }
.step-who { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--purple);
  background: var(--purple-wash); padding: 2px 8px; border-radius: 999px; }
.step-why { color: var(--ink-2); margin: 10px 0 0; max-width: 68ch; }
.step-note { color: var(--warn); background: var(--warn-wash); padding: 8px 12px; border-radius: var(--radius); margin: 12px 0 0; font-size: 14px; max-width: 68ch; }

/* A head bar above the code, so the copy button never sits on top of a long line. */
.command { margin: 14px 0 0; border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.command-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px 6px 16px; border-bottom: 1px solid rgba(242, 238, 248, 0.12);
}
.command-head a { color: var(--code-ink); font-size: 12px; font-weight: 600; text-decoration: none; opacity: 0.85; }
.command-head a:hover { opacity: 1; text-decoration: underline; }
.command pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  color: var(--code-ink); font-size: 13px; line-height: 1.6; white-space: pre;
}
.command .copy {
  height: 26px; padding: 0 10px;
  border: 1px solid rgba(242, 238, 248, 0.25); border-radius: 6px;
  background: transparent; color: var(--code-ink); font-size: 12px; font-weight: 600;
}
.command .copy:hover { border-color: var(--code-ink); }
.fill { color: #F5C26B; }
.fill.is-filled { color: var(--code-ink); }

.step-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.step-actions form { margin: 0; }
.done-mark { color: var(--good); font-weight: 600; font-size: 14px; }

.deploy-button {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; height: 38px; padding: 0 16px;
  border-radius: var(--radius); background: var(--purple); color: var(--on-purple); text-decoration: none; font-weight: 600;
}
.deploy-button:hover { background: var(--purple-hover-dark); color: #FDFCFF; }

.secret {
  margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius);
  border: 1px dashed var(--warn); background: var(--warn-wash);
}
.secret p { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }

/* ---------------- administration ---------------- */

.admin h1 { font-size: 24px; }
.admin-new { margin: 24px 0 36px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-new .row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
.admin-new label { margin-top: 0; }
.admin-new input, .admin-new select { max-width: none; }

.issued { margin: 0 0 32px; padding: 16px 20px; border-radius: var(--radius); background: var(--good-wash); border: 1px solid var(--good); }
.issued h2 { font-size: 15px; }
.issued pre { margin: 10px 0; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); white-space: pre-wrap; font-size: 13px; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 10px 8px; border-bottom: 1px solid var(--line-2); }
.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list td.actions { display: flex; gap: 8px; justify-content: flex-end; }
.list td.actions form { margin: 0; }
.status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.status.open { color: var(--good); background: var(--good-wash); }
.status.ended { color: var(--ink-3); background: var(--surface-2); }
.status.revoked { color: var(--bad); background: var(--surface-2); }
.status.attention { color: var(--warn); background: var(--warn-wash); }
.steps-done { font-variant-numeric: tabular-nums; color: var(--ink-2); }

@media (max-width: 720px) {
  .admin-new .row { grid-template-columns: 1fr; }
  .list td.actions { flex-wrap: wrap; }
  .step { padding-left: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.step-issue { margin-top: 14px; }
