/* Lift integrator-demo wizard styles.
   Palette aligned with postmerchant.com/lift — cool light surface, warm orange accent,
   Jost for display + Hanken Grotesk for body (loaded in _Layout.cshtml). */

:root {
    --lift-orange: #f89323;
    --lift-orange-mid: #fbb03c;
    --lift-yellow: #ffd065;
    --lift-orange-deep: #c2820f;
    --lift-black: #15171b;
    --bg: #edeef2;
    --bg-deep: #e4e6ed;
    --surface: #ffffff;
    --border: #e1e3ea;
    --text: #15171b;
    --text-mid: #565a61;
    --text-mute: #888b93;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
}

.demo-shell {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}

.demo-header h1 {
    margin: 0 0 10px;
    font-family: 'Jost', system-ui, sans-serif;
    font-weight: 800;
    font-size: 38px;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--text);
}
.demo-header .lede { color: var(--text-mid); font-size: 16.5px; line-height: 1.6; max-width: 880px; }
.demo-header code {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
}

/* ----- Stepper ----- */
.stepper {
    list-style: none;
    padding: 0;
    margin: 32px 0 32px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    counter-reset: step;
}
.stepper li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-mute);
    transition: all 0.15s ease;
}
.stepper li .num {
    background: var(--bg-deep);
    color: var(--text-mid);
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.stepper li.active { border-color: var(--lift-orange); color: var(--text); box-shadow: 0 0 0 3px rgba(248, 147, 35, 0.14); }
.stepper li.active .num { background: var(--lift-orange); color: #ffffff; }
.stepper li.complete { color: var(--text-mid); cursor: pointer; }
.stepper li.complete:hover { border-color: #2c8f6a; background: #effaf5; }
.stepper li.complete .num { background: #2c8f6a; color: white; }
.stepper li.complete .num::after { content: ""; }

/* ----- Steps ----- */
.step {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px 34px;
    margin-bottom: 24px;
}
.step.active { display: block; }
.step h2 {
    margin: 0 0 10px;
    font-family: 'Jost', system-ui, sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
    color: var(--text);
}
.step > p { color: var(--text-mid); line-height: 1.6; margin: 0 0 20px; }
.step code { background: var(--bg); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; }

/* ----- Buttons ----- */
button.primary, button.ghost {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 20px;
    font-size: 14.5px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
button.primary {
    background: var(--lift-orange);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(248, 147, 35, 0.28);
}
button.primary:hover:not(:disabled) { background: var(--lift-orange-mid); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(248, 147, 35, 0.38); }
button.primary:disabled { background: var(--bg-deep); color: var(--text-mute); cursor: not-allowed; box-shadow: none; }
button.ghost {
    background: transparent;
    color: var(--text-mid);
    border-color: var(--border);
}
button.ghost:hover:not(:disabled) { background: var(--bg-deep); }
button.ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.actions .primary { margin-left: auto; }

/* ----- Step 0: Key entry ----- */
.key-input-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 8px;
}
.key-input-row input[type=password] {
    flex: 1 1 320px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}
.key-input-row .remember {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-mid);
    font-size: 13px;
}

.hint { font-size: 13px; color: var(--text-mute); margin: 8px 0; }
.hint.ok { color: #1a7f5a; }
.hint.err { color: #c0392b; }
.hint.info { color: var(--text-mid); }

/* ----- Step 1: Template list ----- */
.template-list { display: flex; flex-direction: column; gap: 8px; }
.template-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.template-row:hover { border-color: var(--lift-orange-mid); background: #fffaf2; }
.template-row input[type=radio]:checked + div .t-name { color: var(--lift-orange); }
.template-row:has(input:checked) { border-color: var(--lift-orange); background: #fff8ee; }
.t-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.t-meta { font-size: 12px; color: var(--text-mute); }

/* ----- Step 2: Schema ----- */
.schema-section { margin-bottom: 28px; }
.schema-section h3 {
    font-size: 16px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.schema-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.schema-field {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
}
.f-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.rules { list-style: none; padding: 4px 0 0; margin: 6px 0 0; font-size: 12px; color: var(--text-mid); border-top: 1px dashed var(--border); }
.rules li { padding: 2px 0; }
.rules code { font-size: 11px; }
.itemnames { font-size: 12px; color: var(--text-mid); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.itemnames-label { font-weight: 700; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.itemnames code { font-size: 11px; background: white; border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px; }

.item-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 2px;
}
.item-table td {
    padding: 4px 8px 4px 0;
    vertical-align: middle;
    border-bottom: 1px dotted var(--border);
}
.item-table tr:last-child td { border-bottom: none; }
.item-table .i-name { white-space: nowrap; width: 1%; }
.item-table .i-type { width: 1%; white-space: nowrap; }
.item-table .i-disp { color: var(--text-mid); font-style: italic; }

.type-pill {
    display: inline-block;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #ececec;
    color: var(--text-mid);
}
.type-pill.t-boolean { background: #e0f0ff; color: #2563eb; }
.type-pill.t-number  { background: #ffedd5; color: #c97a18; }
.type-pill.t-string  { background: #e5f3eb; color: #1a7f5a; }
.type-pill.t-guid    { background: #f3e5ff; color: #7c2db8; }

.badge.multi {
    background: #e0f0ff;
    color: #2563eb;
    cursor: help;
}

.badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.badge.req { background: #fde8e0; color: #c0392b; }
.badge.opt { background: #e5f3eb; color: #1a7f5a; }
.badge.hidden { background: #ececec; color: var(--text-mute); }

/* ----- Step 3: Onboard form ----- */
.onboard-form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.onboard-form fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px 20px;
    margin: 0;
    background: var(--bg);
}
.onboard-form legend {
    padding: 0 8px;
    font-weight: 700;
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.onboard-form label .badge { margin-left: 6px; font-size: 9px; padding: 1px 6px; }

p.callout {
    background: #fffaf0;
    border-left: 4px solid var(--lift-orange);
    padding: 12px 16px;
    margin: 0 0 20px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
}

/* Products picker on Step 3 */
.product-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: white;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    margin-top: 4px;
}
.product-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 4px 0;
    font-size: 13px !important;
    color: var(--text) !important;
}
.product-row input[type=checkbox] { width: auto !important; margin: 0; }
.product-row .hint { display: inline-block; margin-left: 6px; }
p.callout .badge { vertical-align: 1px; }
.onboard-form label {
    display: block;
    font-size: 13px;
    color: var(--text-mid);
    margin: 12px 0 4px;
}
.onboard-form label.inline { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.onboard-form input, .onboard-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    box-sizing: border-box;
}
.onboard-form input[type=checkbox] { width: auto; }

.onboard-result {
    margin-top: 20px;
    padding: 18px 22px;
    background: #f0faf5;
    border: 1px solid #b3dec5;
    border-radius: 8px;
}
.onboard-result.hidden { display: none; }
.onboard-result h3 { margin: 0 0 8px; color: #1a7f5a; }
.onboard-result code { background: white; padding: 1px 6px; border: 1px solid #d5e7dd; border-radius: 3px; }
.onboard-result a { color: var(--lift-orange); word-break: break-all; }
.step-results { list-style: none; padding: 0; margin: 8px 0 16px; font-size: 13px; }
.step-results li { padding: 4px 0; }
.step-status { padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; }
.step-status.step-succeeded, .step-status.step-success { background: #d4ecde; color: #1a7f5a; }
.step-status.step-failed { background: #fde8e0; color: #c0392b; }
.step-status.step-skipped { background: #ececec; color: var(--text-mute); }

/* ----- Step 4: Status polling ----- */
.status-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
}
.status-row { padding: 6px 0; font-size: 15px; }
.status-row code { background: white; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--border); }
.status-actions { display: flex; gap: 10px; margin-top: 16px; }
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--bg-deep);
    color: var(--text-mid);
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 13px;
}
.status-pill.good { background: #d4ecde; color: #1a7f5a; }
.status-pill.bad { background: #fde8e0; color: #c0392b; }
.status-pill.mid { background: #ffedd5; color: #c97a18; }

/* ----- Request / Response split view ----- */
.rr-container { margin-top: 24px; }
.rr-section-label {
    margin: 20px 0 0;
    font-size: 13px;
    color: var(--text-mid);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.rr-section-label .hint {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    color: var(--text-mute);
    margin-left: 6px;
}
.rr-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
/* Request-only preview pane (no response) gets a single full-width column. */
.rr-split-one { grid-template-columns: 1fr; }
.rr-pane {
    background: #1a1a1a;
    color: #f4f1ea;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}
/* <details> needs its summary marker hidden and replaced with our own caret. */
.rr-pane > summary { list-style: none; cursor: pointer; user-select: none; }
.rr-pane > summary::-webkit-details-marker { display: none; }
.rr-pane-header {
    padding: 10px 14px;
    background: #242424;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    border-bottom: 1px solid #2c2c2c;
    flex-wrap: wrap;
    transition: background 0.15s ease;
}
.rr-pane-header:hover { background: #2c2c2c; }
.rr-caret {
    color: #8d8779;
    font-size: 12px;
    transition: transform 0.15s ease;
    display: inline-block;
    width: 12px;
}
/* Collapsed state — rotate caret + drop the bottom border that separates header from body */
.rr-pane:not([open]) .rr-caret { transform: rotate(-90deg); }
.rr-pane:not([open]) .rr-pane-header { border-bottom: none; }
.rr-label { color: #8d8779; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px; }
.rr-method { padding: 2px 8px; border-radius: 4px; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; }
.rr-method.m-get { background: #1a7f5a; color: white; }
.rr-method.m-post { background: var(--lift-orange); color: black; }
.rr-method.m-put { background: var(--lift-orange-mid); color: black; }
.rr-method.m-delete { background: #c0392b; color: white; }
.rr-url { font-size: 12px; color: #c9c3b5; word-break: break-all; flex: 1; }
.rr-status { padding: 2px 8px; border-radius: 4px; font-weight: 700; font-size: 12px; }
.rr-status.s2 { background: #1a7f5a; color: white; }
.rr-status.s3 { background: #2563eb; color: white; }
.rr-status.s4 { background: #c97a18; color: white; }
.rr-status.s5, .rr-status.s0 { background: #c0392b; color: white; }
.rr-time { font-size: 11px; color: #8d8779; }
.rr-body {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre;
    background: transparent;
    color: #f4f1ea;
}
/* <code> inside <pre> picks up a white background from some browser default —
   force it transparent so the dark pane shows through and the text is readable. */
.rr-body code {
    background: transparent !important;
    background-color: transparent !important;
    color: #f4f1ea !important;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: block;
}
.rr-body + .rr-body { border-top: 1px dashed #2c2c2c; }

/* Also force the URL pill and header inline code to render against the dark header */
.rr-pane-header code, .rr-url {
    background: transparent !important;
    color: #c9c3b5;
}

@media (max-width: 900px) {
    .rr-split, .onboard-form { grid-template-columns: 1fr; }
    .stepper { grid-template-columns: repeat(5, auto); overflow-x: auto; }
}
