/* Subscriber onboarding wizard (static SSR + onboarding.js).
   The --onb-* custom properties are the bridge tier declared in tokens.css under `html:root`
   (design.md D1) - not redeclared here, since `html:root` already outranks a bare class selector
   on specificity and a local redeclaration would only reintroduce a second, competing value
   (PRS-1). */

.sk-onb {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    position: relative;
    max-width: 980px;
    margin: 24px auto;
    background: var(--dtx-surface-card);
    border-radius: var(--onb-radius);
    box-shadow: var(--dtx-elevation-floating);
    overflow: hidden;
    color: var(--onb-text);
    font-family: inherit;
}

@media (max-width: 820px) {
    .sk-onb {
        grid-template-columns: 1fr;
    }
}

/* ---- hero panel ---- */

/* Traceability: PRS-1 openspec/specs/presentation/spec.md (Single governed set of visual values)
   Same recipe as the nav drawer and Login.razor.css's panel (see that file's own comment): a flat
   dark navy base, not the diagonal green-to-blue wash this used to carry (that recipe was copied
   from the login panel's own pre-fix version - the comment literally said "matching the login
   panel" - so it inherited the same defect once that page's own gradient was corrected against the
   real Figma sidebar fill). */
.sk-onb__hero {
    position: relative;
    /* Extra top clearance for .sk-onb__language above - the badge stops at roughly the 56px mark
       (20px inset + ~30px chip height), so 40px would sit right under it. */
    padding: 68px 36px 40px;
    color: var(--onb-accent-text);
    background:
        radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--dtx-text-on-fill) 18%, transparent), transparent 55%),
        var(--sk-shell-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top glow blob (the other of the pair - .sk-onb__hero-glow below is the bottom one), same
   green-to-blue recipe as the nav drawer's own two blobs (tokens.css's --sk-shell-glow-*). */
.sk-onb__hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -25%;
    width: 90%;
    height: 140%;
    background: linear-gradient(100deg, var(--sk-shell-glow-from) 0%, var(--sk-shell-glow-to) 100%);
    opacity: var(--sk-shell-glow-opacity);
    filter: blur(90px);
    pointer-events: none;
}

.sk-onb__hero-glow {
    position: absolute;
    inset: auto -20% -55% auto;
    width: 90%;
    height: 140%;
    background: linear-gradient(100deg, var(--sk-shell-glow-from) 0%, var(--sk-shell-glow-to) 100%);
    opacity: var(--sk-shell-glow-opacity);
    filter: blur(90px);
    pointer-events: none;
}

.sk-onb__brand {
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.95rem;
    opacity: 0.95;
    margin-bottom: 22px;
}

.sk-onb__hero-title {
    font-size: 1.7rem;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 14px;
}

.sk-onb__hero-lead {
    font-size: 1.02rem;
    line-height: 1.5;
    margin: 0 0 12px;
    opacity: 0.97;
}

.sk-onb__hero-text {
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 22px;
    opacity: 0.88;
}

.sk-onb__benefits {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sk-onb__benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    opacity: 0.96;
}

.sk-onb__benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--dtx-text-on-fill) 18%, transparent);
    flex: 0 0 auto;
}

.sk-onb__hero-art {
    margin-top: auto;
    opacity: 0.5;
    color: var(--dtx-text-on-fill);
}

.sk-onb__hero-art svg {
    width: 100%;
    height: auto;
}

/* ---- form panel ---- */

.sk-onb__form {
    padding: 40px 40px 44px;
    min-width: 0;
}

@media (max-width: 520px) {
    .sk-onb__form {
        padding: 28px 22px;
    }

    /* Keeps the .sk-onb__language clearance from the base rule above - the shared
       28px/22px override would otherwise remove it on small screens too. */
    .sk-onb__hero {
        padding: 56px 22px 28px;
    }
}

/* steps */

.sk-onb__steps {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    counter-reset: none;
}

.sk-onb__step {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--onb-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.sk-onb__step:not(:last-child)::after {
    content: "";
    flex: 1 1 auto;
    height: 2px;
    min-width: 26px;
    margin: 0 12px;
    background: var(--onb-border);
    border-radius: 2px;
}

.sk-onb__step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    /* .sk-onb__step is itself a flex row (dot + label); without this, the default flex-shrink:1
       lets this shrink below its explicit 30x30 - by a different amount per step, depending on how
       much room that step's own label text needs - turning the circle into an oval. The label is
       free to shrink/wrap; the badge must not. */
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--onb-border);
    background: var(--dtx-surface-card);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sk-onb__step.is-active .sk-onb__step-dot {
    border-color: var(--onb-accent);
    color: var(--onb-accent);
}

.sk-onb__step.is-active {
    color: var(--onb-text);
}

.sk-onb__step.is-done .sk-onb__step-dot {
    border-color: var(--onb-accent);
    background: var(--onb-accent);
    color: var(--onb-accent-text);
}

/* panels */

.sk-onb__panel {
    display: none;
    animation: sk-onb-fade 0.25s ease;
}

.sk-onb[data-step="email"] [data-step-panel="email"],
.sk-onb[data-step="code"] [data-step-panel="code"],
.sk-onb[data-step="details"] [data-step-panel="details"],
.sk-onb[data-step="company"] [data-step-panel="company"],
.sk-onb[data-step="mfa"] [data-step-panel="mfa"],
.sk-onb[data-step="pending"] [data-step-panel="pending"],
.sk-onb[data-step="duplicate-review"] [data-step-panel="duplicate-review"],
.sk-onb[data-step="done"] [data-step-panel="done"],
.sk-onb[data-step="link-expired"] [data-step-panel="link-expired"],
.sk-onb[data-step="request-access"] [data-step-panel="request-access"],
.sk-onb[data-step="access-requested"] [data-step-panel="access-requested"] {
    display: block;
}

@keyframes sk-onb-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.sk-onb__panel-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.sk-onb__panel-sub {
    font-size: 0.92rem;
    color: var(--onb-muted);
    margin: 0 0 22px;
    line-height: 1.5;
}

/* fields */

.sk-onb__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 14px 0 6px;
}

.sk-onb__input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font-size: 0.95rem;
    color: var(--onb-text);
    background: var(--dtx-surface-card);
    border: 1.5px solid var(--onb-border);
    border-radius: var(--dtx-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

/* No local outline override (design.md D6, PRS-5): the governed :focus-visible ring from
   tokens.css applies here too; this adds a border/shadow highlight alongside it, not instead of it. */
.sk-onb__input:focus-visible {
    border-color: var(--onb-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--onb-accent) 18%, transparent);
}

.sk-onb__input--code {
    letter-spacing: 0.5em;
    font-size: 1.3rem;
    text-align: center;
    font-weight: 700;
    max-width: 220px;
}

.sk-onb__row {
    display: flex;
    gap: 16px;
}

.sk-onb__col {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 520px) {
    .sk-onb__row { flex-direction: column; gap: 0; }
}

.sk-onb__field-error {
    color: var(--dtx-error);
    font-size: 0.8rem;
    margin-top: 6px;
}

/* mandatory MFA enrolment (ACC-11): the manual entry key used to sit inline in the instruction
   sentence (bug #60 - wrapped mid-sentence, no spacing from the QR code below it). It now renders on
   its own line, so it reads as a standalone value rather than justified body text, with its own
   spacing above (from the instruction line) and below (from the QR code). */
.sk-onb__mfa-steps li {
    margin-bottom: 14px;
}

.sk-onb__mfa-key {
    display: block;
    width: fit-content;
    margin: 8px 0 14px;
}

/* operating territories: repeatable country + region rows */

.sk-onb__territory-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.sk-onb__territory-row .sk-onb__input {
    margin: 0;
}

.sk-onb__territory-remove {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--onb-border);
    background: transparent;
    color: var(--onb-text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.sk-onb__territory-remove:hover {
    background: var(--dtx-surface-sunken);
}

@media (max-width: 520px) {
    .sk-onb__territory-row { flex-wrap: wrap; }
}

/* message area */

.sk-onb__message {
    border-radius: var(--dtx-radius);
    padding: 12px 14px;
    font-size: 0.88rem;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.sk-onb__message[data-type="error"] {
    background: color-mix(in srgb, var(--dtx-error) 10%, var(--dtx-surface-card));
    border-color: color-mix(in srgb, var(--dtx-error) 35%, var(--dtx-surface-card));
    color: var(--dtx-error);
}

.sk-onb__message[data-type="info"] {
    background: color-mix(in srgb, var(--dtx-btn-primary-bg) 8%, var(--dtx-surface-card));
    border-color: color-mix(in srgb, var(--dtx-btn-primary-bg) 30%, var(--dtx-surface-card));
    color: var(--dtx-btn-primary-bg-pressed);
}

.sk-onb__message[data-type="success"] {
    background: color-mix(in srgb, var(--dtx-success) 10%, var(--dtx-surface-card));
    border-color: color-mix(in srgb, var(--dtx-success) 35%, var(--dtx-surface-card));
    color: var(--dtx-success);
}

/* buttons */

.sk-onb__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sk-onb__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    padding: 12px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--dtx-radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: filter 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.sk-onb__btn:disabled {
    cursor: default;
    opacity: 0.75;
}

.sk-onb__btn--primary {
    background: var(--onb-accent);
    color: var(--onb-accent-text);
}

.sk-onb__btn--primary:not(:disabled):hover {
    filter: brightness(0.93);
}

.sk-onb__btn--ghost {
    background: transparent;
    color: var(--onb-text);
    border-color: var(--onb-border);
}

.sk-onb__btn--ghost:not(:disabled):hover {
    background: var(--dtx-surface-sunken);
}

.sk-onb__link {
    background: none;
    border: none;
    padding: 0;
    color: var(--onb-accent);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

/* spinner */

.sk-onb__spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: sk-onb-spin 0.7s linear infinite;
    position: absolute;
}

.sk-onb__spinner--lg {
    width: 40px;
    height: 40px;
    position: static;
    border-width: 3.5px;
    color: var(--onb-accent);
}

@keyframes sk-onb-spin {
    to { transform: rotate(360deg); }
}

/* terminal panels */

.sk-onb__panel--terminal {
    text-align: center;
    padding-top: 12px;
}

.sk-onb__terminal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--onb-accent);
    margin-bottom: 12px;
}

/* read-only summary (invite company step) */

.sk-onb__summary {
    margin: 0 0 6px;
    border: 1px solid var(--onb-border);
    border-radius: 12px;
    overflow: hidden;
}

.sk-onb__summary > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
}

.sk-onb__summary > div + div {
    border-top: 1px solid var(--onb-border);
}

.sk-onb__summary dt {
    margin: 0;
    color: var(--onb-muted);
    font-size: 0.85rem;
}

.sk-onb__summary dd {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
}

/* honeypot */

.sk-onb__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}
