/* ========================================================================
   SLMWizard.css -- General-purpose multi-step wizard overlay chrome
   See WizardDesign.md for the full contract.
   ======================================================================== */

/* ── Overlay backdrop ── */
.slm-wizard-overlay {
    position: fixed;
    inset: 0;
    background: var(--slm-dialog-backdrop, rgba(0, 0, 0, 0.32));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

/* ── Dialog surface ── */
.slm-wizard-dialog {
    background: var(--slm-dialog-surface, #fafbfc);
    border: 1px solid var(--slm-dialog-border, #d1d5db);
    border-radius: var(--slm-dialog-radius, 12px);
    box-shadow: var(--slm-dialog-shadow, 0 8px 32px rgba(0,0,0,0.18));
    width: var(--slm-wizard-width, 700px);
    max-width: calc(100vw - 48px);
    min-height: 60vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Header ── */
.slm-wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--slm-color-border, #e5e7eb);
    flex-shrink: 0;
}

.slm-wizard-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ── Step indicator bar ── */
.slm-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px 8px;
    gap: 0;
    flex-shrink: 0;
    border-bottom: 1px solid var(--slm-color-border, #e5e7eb);
    overflow-x: auto;
}

.slm-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
}

.slm-wizard-step__pill {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    border: 2px solid var(--slm-color-border, #e5e7eb);
    background: var(--slm-dialog-surface, #fafbfc);
    color: var(--slm-color-text-muted, #6b6f73);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.slm-wizard-step--active .slm-wizard-step__pill {
    background: var(--slm-color-primary, #1e3a5f);
    border-color: var(--slm-color-primary, #1e3a5f);
    color: #fff;
}

.slm-wizard-step--completed .slm-wizard-step__pill {
    background: var(--slm-color-success, #22863a);
    border-color: var(--slm-color-success, #22863a);
    color: #fff;
}

.slm-wizard-step__label {
    font-size: 0.72rem;
    color: var(--slm-color-text-muted, #6b6f73);
    white-space: nowrap;
    text-align: center;
}

.slm-wizard-step--active .slm-wizard-step__label {
    color: var(--slm-color-primary, #1e3a5f);
    font-weight: 600;
}

.slm-wizard-step--completed .slm-wizard-step__label {
    color: var(--slm-color-success, #22863a);
}

.slm-wizard-step__connector {
    flex: 1;
    height: 2px;
    background: var(--slm-color-border, #e5e7eb);
    min-width: 24px;
    margin-bottom: 20px; /* aligns with pill center, offset by label height */
    align-self: flex-start;
    margin-top: 13px; /* half pill height */
}

.slm-wizard-step__connector--completed {
    background: var(--slm-color-success, #22863a);
}

/* ── Body (scrollable) ── */
.slm-wizard-body {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 16px;
    min-height: 0;
}

/* ── Per-step error banner ── */
.slm-wizard-error {
    margin-top: 12px;
    border-left: 4px solid var(--slm-color-danger, #c0392b);
    padding: 8px 12px;
    background: var(--slm-color-danger-bg, #fef2f2);
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

/* ── Loading spinner ── */
.slm-wizard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--slm-color-text-muted, #6b6f73);
    gap: 10px;
    font-size: 0.9rem;
}

/* ── Footer ── */
.slm-wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--slm-color-border, #e5e7eb);
    flex-shrink: 0;
    gap: 8px;
}

.slm-wizard-footer__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slm-wizard-footer__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Tile grid ── */
.slm-wizard-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

/* ── Tile button ── */
.slm-wizard-tile {
    text-align: left;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--slm-color-border, #cdd3da);
    background: var(--slm-surface, #fff);
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s;
    width: 100%;
}

.slm-wizard-tile:hover {
    border-color: var(--slm-color-primary, #1e3a5f);
    box-shadow: 0 2px 8px rgba(30,58,95,0.10);
}

.slm-wizard-tile--selected {
    border-color: var(--slm-color-primary, #1e3a5f);
    border-width: 2px;
    background: var(--slm-color-primary-bg, #eef3fa);
}

.slm-wizard-tile__name {
    font-weight: 700;
    font-size: 0.92rem;
}

.slm-wizard-tile__desc {
    margin-top: 4px;
    opacity: 0.75;
    font-size: 0.78rem;
}

.slm-wizard-tile__color-bar {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}
