/* ═════════════════════════════════════════════════════════════════════════════
   Stripe Connect SAMPLE — docs/stripe-connect-sample.md

   Everything the sample's four pages need, in one deletable file. Loaded from
   App.razor with a ?v= stamp like app.css, because it is a plain static file and
   a returning browser will otherwise serve a cached copy forever.

   ── Why a global file rather than scoped .razor.css ──────────────────────────
   Four pages share these styles, and Blazor CSS isolation only stamps its
   b-xxxx attribute on elements a SINGLE .razor renders — a scoped rule in one
   page cannot reach the others, so the alternative was four copies.

   ── Why `sx-` and not `jd-` ─────────────────────────────────────────────────
   This is sample code that should be removable in one commit. A `jd-` prefix
   would imply it is part of the house design system, which it is not. It
   CONSUMES the design system's tokens (--jd-amber, --jd-line, --mud-palette-*)
   so the sample matches the app and follows the light/dark theme, but it adds
   nothing to it.

   Theme note: every colour below resolves through --mud-palette-* or a
   color-mix against it, which is what makes these pages follow the theme
   switch. Do not hard-code a hex here — see jd-design-system.css's colour rule
   for why brand amber as TEXT fails contrast on the light theme.
   ═══════════════════════════════════════════════════════════════════════════ */

.sx-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.sx-wrap--narrow { max-width: 720px; }

/* ── header ───────────────────────────────────────────────────────────────── */

.sx-head { margin-bottom: 1.75rem; }

.sx-eyebrow {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.sx-title {
    margin: 0 0 0.4rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mud-palette-text-primary);
}

.sx-lede {
    margin: 0;
    max-width: 68ch;
    color: var(--mud-palette-text-secondary);
    line-height: 1.6;
}

/* ── cards ────────────────────────────────────────────────────────────────── */

.sx-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--jd-line, rgba(128, 128, 128, 0.25));
    border-radius: var(--jd-radius, 20px);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
}

.sx-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--mud-palette-text-primary);
}

.sx-card p {
    margin: 0 0 0.75rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.6;
}

.sx-card p:last-child { margin-bottom: 0; }

/* ── grid of products / sellers ───────────────────────────────────────────── */

.sx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.sx-tile {
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-surface);
    border: 1px solid var(--jd-line, rgba(128, 128, 128, 0.25));
    border-radius: var(--jd-radius-sm, 12px);
    padding: 1.1rem 1.15rem;
    transition: border-color .16s ease, transform .16s ease;
}

.sx-tile:hover {
    border-color: rgba(255, 179, 0, 0.45);
    transform: translateY(-2px);
}

.sx-tile-name {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 650;
    color: var(--mud-palette-text-primary);
}

.sx-tile-desc {
    margin: 0 0 0.85rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
    /* Keeps tiles the same height when descriptions differ wildly. */
    flex: 1 1 auto;
}

.sx-tile-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.sx-tile-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

/* ── seller line ──────────────────────────────────────────────────────────── */

.sx-seller {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}

.sx-seller strong { color: var(--mud-palette-text-primary); font-weight: 600; }

/* ── status chips ─────────────────────────────────────────────────────────── */

.sx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--jd-line, rgba(128, 128, 128, 0.25));
    background: var(--jd-tint, rgba(128, 128, 128, 0.06));
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.sx-chip.is-ok {
    color: var(--jd-ok, var(--mud-palette-success));
    border-color: color-mix(in srgb, var(--mud-palette-success) 45%, transparent);
    background: color-mix(in srgb, var(--mud-palette-success) 10%, transparent);
}

.sx-chip.is-warn {
    color: var(--jd-warn, var(--mud-palette-warning));
    border-color: color-mix(in srgb, var(--mud-palette-warning) 45%, transparent);
    background: color-mix(in srgb, var(--mud-palette-warning) 10%, transparent);
}

.sx-chip.is-danger {
    color: var(--jd-danger, var(--mud-palette-error));
    border-color: color-mix(in srgb, var(--mud-palette-error) 45%, transparent);
    background: color-mix(in srgb, var(--mud-palette-error) 10%, transparent);
}

/* ── buttons ──────────────────────────────────────────────────────────────── */

.sx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: filter .16s ease, border-color .16s ease, background-color .16s ease;
}

.sx-btn-primary {
    background: linear-gradient(135deg, var(--jd-amber, #FFB300), var(--jd-amber-deep, #ff8f00));
    /* Near-black on both themes: the amber gradient is a light surface either way. */
    color: #1a1205;
}

.sx-btn-primary:hover { filter: brightness(1.06); }

.sx-btn-quiet {
    background: transparent;
    border-color: var(--jd-line, rgba(128, 128, 128, 0.3));
    color: var(--mud-palette-text-primary);
}

.sx-btn-quiet:hover { border-color: rgba(255, 179, 0, 0.5); }

/* MudBlazor v9 removed the .mud-disabled class, so keying on the class alone
   would leave a disabled button looking pressable. These are plain <button>s,
   so :disabled is both available and the honest selector. */
.sx-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.sx-btn:disabled:hover { filter: none; border-color: var(--jd-line, rgba(128, 128, 128, 0.3)); }

.sx-btn:focus-visible {
    outline: 2px solid var(--jd-amber, #FFB300);
    outline-offset: 2px;
}

/* ── forms ────────────────────────────────────────────────────────────────── */

.sx-field { margin-bottom: 1rem; }

.sx-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.sx-field input,
.sx-field textarea,
.sx-field select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: var(--jd-radius-sm, 12px);
    border: 1px solid var(--jd-line, rgba(128, 128, 128, 0.3));
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 0.92rem;
}

.sx-field input:focus,
.sx-field textarea:focus,
.sx-field select:focus {
    outline: none;
    border-color: var(--jd-amber, #FFB300);
    box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.18);
}

.sx-field-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.76rem;
    color: var(--mud-palette-text-secondary);
}

.sx-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.sx-row > * { flex: 1 1 200px; }

/* ── notices ──────────────────────────────────────────────────────────────── */

.sx-note {
    border-radius: var(--jd-radius-sm, 12px);
    border: 1px solid var(--jd-line, rgba(128, 128, 128, 0.25));
    background: var(--jd-tint, rgba(128, 128, 128, 0.06));
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    color: var(--mud-palette-text-secondary);
}

.sx-note strong { color: var(--mud-palette-text-primary); }

.sx-note.is-warn {
    border-color: color-mix(in srgb, var(--mud-palette-warning) 45%, transparent);
    background: color-mix(in srgb, var(--mud-palette-warning) 8%, transparent);
}

.sx-note.is-danger {
    border-color: color-mix(in srgb, var(--mud-palette-error) 45%, transparent);
    background: color-mix(in srgb, var(--mud-palette-error) 8%, transparent);
}

.sx-note.is-ok {
    border-color: color-mix(in srgb, var(--mud-palette-success) 45%, transparent);
    background: color-mix(in srgb, var(--mud-palette-success) 8%, transparent);
}

/* Setup instructions are shell commands — they need to keep their whitespace and
   must not run off the side of the page on a phone. */
.sx-pre {
    margin: 0.6rem 0 0;
    padding: 0.8rem 0.9rem;
    border-radius: var(--jd-radius-sm, 12px);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 7%, transparent);
    color: var(--mud-palette-text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.sx-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
}

/* ── misc ─────────────────────────────────────────────────────────────────── */

.sx-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

.sx-list { margin: 0.5rem 0 0; padding-left: 1.2rem; color: var(--mud-palette-text-secondary); }
.sx-list li { margin-bottom: 0.3rem; line-height: 1.55; }

.sx-defs { margin: 0; }
.sx-defs div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--jd-line, rgba(128, 128, 128, 0.18));
}
.sx-defs div:last-child { border-bottom: 0; }
.sx-defs dt { color: var(--mud-palette-text-secondary); font-size: 0.85rem; }
.sx-defs dd { margin: 0; font-weight: 600; color: var(--mud-palette-text-primary); font-size: 0.85rem; text-align: right; }

.sx-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
