/* =============================================================================
   Demo onboarding - the public setup page (Services/Onboarding/OnboardingPage.cs).

   Same look as the Micro App error page and shell: LIGHT-LOCKED (the page sits in a Cornerstone frame and does not follow the OS dark
   mode), Avenir Next (css/fonts.css), white framed surface, a thin accent rule on each card. No inline styles exist in the page markup (its
   CSP allows none) - every visual state is a class or a data attribute selector here.

   Accessibility: 44 px minimum touch targets, visible :focus-visible outlines, text colours with at least 4.5:1 contrast on white,
   state never conveyed by colour alone (a text label sits beside each mark), reduced motion honoured.
   ============================================================================= */
:root {
    --tt-ob-accent: #008E8D;
    --tt-ob-text: #1a1a1a;
    --tt-ob-muted: #475569;
    --tt-ob-border: #cbd5e1;
    --tt-ob-link: #0b5394;
    --tt-ob-ok: #166534;
    --tt-ob-bad: #b91c1c;
    --tt-ob-margin: 12px;
    color-scheme: light;
}
@media (max-width: 480px) {
    :root { --tt-ob-margin: 4px; }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    background: #ffffff;
    color: var(--tt-ob-text);
    color-scheme: light;
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

[hidden] { display: none !important; }

.tt-ob-noscript {
    margin: var(--tt-ob-margin);
    padding: 12px 16px;
    border: 1px solid var(--tt-ob-bad);
    border-radius: 8px;
    color: var(--tt-ob-bad);
    background: #fef2f2;
}

.tt-ob-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--tt-ob-margin);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tt-ob-card {
    padding: 22px 24px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--tt-ob-accent);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
@media (max-width: 480px) {
    .tt-ob-card { padding: 16px 14px; }
}

.tt-ob-card h1, .tt-ob-card h2, .tt-ob-card h3 { margin: 0 0 8px; line-height: 1.3; color: var(--tt-ob-text); }
.tt-ob-title { font-size: 22px; font-weight: 600; }
.tt-ob-card h2 { font-size: 18px; font-weight: 600; }
.tt-ob-card h3 { font-size: 16px; font-weight: 600; }
.tt-ob-card p { margin: 0 0 10px; }
.tt-ob-lead { color: var(--tt-ob-muted); }
.tt-ob-hint { margin: 4px 0 0; font-size: 13px; color: var(--tt-ob-muted); }
.tt-ob-card h2:focus, .tt-ob-error:focus { outline: none; }

/* language selector */
.tt-ob-lang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.tt-ob-lang label { font-size: 14px; color: var(--tt-ob-muted); }
.tt-ob-lang select { min-height: 44px; max-width: 100%; padding: 6px 10px; }

/* ordered lists of steps */
.tt-ob-steps { margin: 8px 0 0; padding-left: 22px; }
.tt-ob-steps li { margin: 0 0 8px; }

/* form */
.tt-ob-field { margin: 0 0 14px; }
.tt-ob-field label { display: block; margin: 0 0 4px; font-weight: 600; font-size: 14px; }
.tt-ob-field input {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    font: inherit;
    color: var(--tt-ob-text);
    background: #ffffff;
    border: 1px solid #64748b;
    border-radius: 6px;
}
.tt-ob-field input[readonly] { background: #f1f5f9; color: #334155; }
.tt-ob-lang select, .tt-ob-field input { font-size: 15px; }

.tt-ob-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.tt-ob-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 18px;
    font: inherit;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}
.tt-ob-btn-primary { color: #ffffff; background: #0b5394; border: 1px solid #0b5394; }
.tt-ob-btn-primary:hover { background: #083d6e; }
.tt-ob-btn-secondary { color: #0b5394; background: #ffffff; border: 1px solid #0b5394; }
.tt-ob-btn-secondary:hover { background: #eff6ff; }
.tt-ob-btn:disabled { cursor: progress; opacity: 0.6; }

.tt-ob-field input:focus-visible, .tt-ob-lang select:focus-visible, .tt-ob-btn:focus-visible, .tt-ob-link:focus-visible {
    outline: 2px solid #0b5394;
    outline-offset: 2px;
}

.tt-ob-link { color: var(--tt-ob-link); font-weight: 600; text-decoration: underline; }

/* credential checks and errors */
.tt-ob-checks { list-style: none; margin: 14px 0 0; padding: 0; }
.tt-ob-check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 6px; }
.tt-ob-check-mark { flex: none; width: 1.2em; font-weight: 700; text-align: center; }
.tt-ob-check-ok .tt-ob-check-mark { color: var(--tt-ob-ok); }
.tt-ob-check-bad .tt-ob-check-mark { color: var(--tt-ob-bad); }
.tt-ob-error {
    margin: 12px 0 0;
    padding: 10px 14px;
    color: var(--tt-ob-bad);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* progress */
.tt-ob-phases { list-style: none; margin: 10px 0 12px; padding: 0; }
.tt-ob-phase { display: flex; gap: 10px; align-items: baseline; margin: 0 0 8px; }
.tt-ob-phase-mark {
    flex: none;
    width: 14px;
    height: 14px;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    background: #ffffff;
    align-self: center;
}
.tt-ob-phase[data-state="done"] .tt-ob-phase-mark { background: var(--tt-ob-ok); border-color: var(--tt-ob-ok); }
.tt-ob-phase[data-state="active"] .tt-ob-phase-mark { border-color: var(--tt-ob-accent); border-width: 4px; }
.tt-ob-phase[data-state="failed"] .tt-ob-phase-mark { background: var(--tt-ob-bad); border-color: var(--tt-ob-bad); }
.tt-ob-phase-label { font-weight: 600; }
.tt-ob-phase-state { color: var(--tt-ob-muted); font-size: 13px; }
.tt-ob-phase[data-state="failed"] .tt-ob-phase-state { color: var(--tt-ob-bad); font-weight: 600; }

.tt-ob-bar { display: block; width: 100%; height: 10px; margin: 6px 0 10px; accent-color: var(--tt-ob-accent); }

.tt-ob-failed {
    margin-top: 12px;
    padding: 12px 14px;
    color: #7f1d1d;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* ready */
.tt-ob-urls { margin: 8px 0 0; }
.tt-ob-urls dt { margin-top: 8px; font-weight: 600; }
.tt-ob-urls dd { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tt-ob-urls code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    padding: 6px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow-wrap: anywhere;
    user-select: all;
}

/* privacy */
.tt-ob-privacy ul { margin: 4px 0 10px; padding-left: 22px; }
.tt-ob-privacy li { margin: 0 0 4px; }

/* visually hidden, still announced */
.tt-ob-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
