/* ─────────────────────────────────────────────────────────────────────────
   Fsh.Blazor.Components — creation wizard + quick-action launcher styles.

   These styles live in a library static asset (not .razor.css) because the
   Blazor scoped-CSS bundle is not linked by any client's index.html, which
   would leave the components unstyled (no position: fixed / absolute).
   Each client links this file once:
     <link href="_content/Fsh.Blazor.Components/creation-wizards.css" rel="stylesheet" />
   Class names are prefixed (wizard- / qaf-) to stay collision-free globally.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Creation wizard ───────────────────────────────────────────────────── */

.wizard-registration {
    display: none;
}

.wizard-nav {
    margin-bottom: 16px;
}

.wizard-nav-list {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 4px 2px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.wizard-nav-list::-webkit-scrollbar {
    display: none;
}

.wizard-nav-item {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
}

.wizard-nav-item:last-child {
    flex: 0 1 auto;
}

.wizard-nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: var(--mud-palette-text-secondary);
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.wizard-nav-button:not([disabled]):hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.wizard-nav-button[disabled] {
    cursor: not-allowed;
    opacity: .65;
}

.wizard-nav-button.is-active {
    color: var(--mud-palette-text-primary);
}

.wizard-nav-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    font-size: .8125rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    flex: 0 0 auto;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.wizard-nav-number {
    line-height: 1;
}

.wizard-nav-button.is-active .wizard-nav-marker {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mud-palette-primary) 18%, transparent);
}

.wizard-nav-button.is-done .wizard-nav-marker {
    background: var(--mud-palette-success);
    border-color: var(--mud-palette-success);
    color: var(--mud-palette-success-text);
}

.wizard-nav-button.is-error .wizard-nav-marker {
    border-color: var(--mud-palette-error);
    color: var(--mud-palette-error);
}

.wizard-nav-button.is-review .wizard-nav-marker {
    border-style: dashed;
}

.wizard-nav-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wizard-nav-title {
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.wizard-nav-sub {
    font-size: .6875rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.wizard-nav-connector {
    flex: 1 1 20px;
    min-width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--mud-palette-lines-default);
    margin: 0 2px;
    transition: background-color .18s ease;
}

.wizard-nav-connector.is-done {
    background: var(--mud-palette-success);
}

.wizard-progress {
    margin-top: -6px;
}

.wizard-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wizard-panel {
    border-radius: 14px !important;
    min-height: 180px;
}

.wizard-step-body {
    animation: wizard-step-enter .22s ease-out;
}

@keyframes wizard-step-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-review-card {
    border-radius: 12px !important;
}

.wizard-review-table {
    width: 100%;
    background: transparent;
}

.wizard-review-table td {
    padding: 4px 8px !important;
    border-bottom: none !important;
    vertical-align: top;
}

.wizard-review-label {
    width: 42%;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
    white-space: nowrap;
}

.wizard-review-value {
    color: var(--mud-palette-text-primary);
    font-size: .875rem;
    font-weight: 500;
    word-break: break-word;
}

.wizard-review-custom {
    margin-bottom: 6px;
}

.wizard-blocked-alert {
    border-radius: 12px !important;
}

.wizard-blocked-list {
    margin: 0;
    padding-left: 18px;
}

.wizard-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    flex-wrap: wrap;
}

.wizard-draft-banner {
    border-radius: 12px !important;
}

@media (max-width: 599px) {
    .wizard-nav-title,
    .wizard-nav-sub {
        max-width: 130px;
    }

    .wizard-panel {
        padding: 16px !important;
    }

    .wizard-actions {
        position: sticky;
        bottom: 0;
        background: var(--mud-palette-surface);
        padding-bottom: 8px;
        z-index: 2;
    }
}

/* ── Quick-action launcher (FAB + speed dial) ──────────────────────────── */

.qaf-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1240;
    background: transparent;
}

/* Lower-right of the screen, stacked directly above the layout's scroll-to-top
   button (which MudBlazor pins at bottom:16px; right:16px, 56px tall).
   z-index stays below dialogs (1300) and below the scroll-to-top (2000). */
.qaf-root {
    position: fixed;
    right: 16px;
    bottom: var(--qaf-bottom, 88px);
    z-index: 1250;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.qaf-fab-wrap {
    position: relative;
    display: inline-flex;
}

.qaf-fab {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22) !important;
    transition: transform .2s ease, box-shadow .2s ease;
}

.qaf-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .26) !important;
}

.qaf-fab.is-open {
    transform: rotate(90deg);
}

.qaf-list {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: min(330px, calc(100vw - 40px));
    max-height: min(62vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
    animation: qaf-panel-in .18s ease-out;
}

@keyframes qaf-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.qaf-search {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 2px 2px 6px;
    background: var(--mud-palette-surface);
}

.qaf-group-title {
    padding: 10px 12px 4px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.qaf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--mud-palette-text-primary);
    animation: qaf-item-in .24s ease-out both;
    animation-delay: var(--qaf-delay, 0ms);
    transition: background-color .15s ease, transform .15s ease;
}

@keyframes qaf-item-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.qaf-item:hover,
.qaf-item:focus-visible {
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
    outline: none;
}

.qaf-item:focus-visible {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--mud-palette-primary) 55%, transparent);
}

.qaf-item:active {
    transform: scale(.985);
}

.qaf-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    color: var(--mud-palette-primary);
}

.qaf-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.qaf-item-title {
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.25;
}

.qaf-item-sub {
    font-size: .6875rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qaf-item-badge {
    color: var(--mud-palette-primary);
    opacity: .75;
    flex: 0 0 auto;
}

.qaf-empty {
    padding: 14px 12px;
    text-align: center;
}

@media (max-width: 599px) {
    .qaf-root {
        right: 16px;
    }

    .qaf-list {
        width: min(300px, calc(100vw - 32px));
        max-height: min(56vh, 400px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .qaf-list,
    .qaf-item,
    .qaf-fab {
        animation: none !important;
        transition: none !important;
    }
}
