/* ── Provider wizard overlay ────────────────────── */
.wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.wizard-overlay.hidden { display: none; }
.wizard-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 480px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 32px;
    position: relative;
}
.wizard-panel h2 {
    font-size: 18px;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.wizard-panel .wizard-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.wizard-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}
.wizard-close:hover { color: var(--text-primary); }

/* Provider cards */
.provider-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.provider-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s;
}
.provider-card:hover { border-color: var(--accent); }
.provider-card.selected { border-color: var(--accent); background: rgba(0,180,234,0.08); }
.provider-card-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}
.provider-card-info { flex: 1; }
.provider-card-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.provider-card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.provider-card-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,180,234,0.15);
    color: var(--accent);
    font-weight: 600;
}

/* Wizard steps */
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-step label,
.wizard-body label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 14px;
}
.wizard-step input, .wizard-step select,
.wizard-body input, .wizard-body select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
}
.wizard-step input::placeholder, .wizard-body input::placeholder { color: var(--text-muted); }
.wizard-step input:focus, .wizard-step select:focus,
.wizard-body input:focus, .wizard-body select:focus { border-color: var(--accent); }
.wizard-step select, .wizard-body select { cursor: pointer; }
.wizard-step select option, .wizard-body select option { background: var(--bg-surface); }

.wizard-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}
.wizard-btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.wizard-btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
}
.wizard-btn-secondary:hover { background: var(--bg-hover); }
.wizard-btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.wizard-btn-primary:hover { background: var(--accent-hover); }
.wizard-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.wizard-btn-danger {
    background: none;
    color: #ef4444;
    border-color: #ef4444;
}
.wizard-btn-danger:hover { background: rgba(239,68,68,0.1); }
.wizard-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
}
.wizard-success {
    color: #22c55e;
    font-size: 12px;
    margin-top: 6px;
}

/* ── Provider panel (management overlay) ────────── */
.provider-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.provider-panel-overlay.hidden { display: none; }
.provider-mgmt-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 520px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px 28px;
    position: relative;
}
.provider-mgmt-panel h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.provider-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg-surface);
    cursor: pointer;
}
.provider-list-item:hover { border-color: var(--accent); background: rgba(0,180,234,0.04); }
.provider-list-item.is-active { border-color: var(--accent); }
.provider-list-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.provider-list-model { font-size: 11px; color: var(--text-secondary); font-family: 'SF Mono','Consolas',monospace; }
.provider-list-active-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.provider-list-actions { display: flex; gap: 4px; }
.provider-list-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    border-radius: 4px;
}
.provider-list-actions button:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ══════════════════════════════════════════════════ */
/* Generic Wizard Renderer (data-driven)             */
/* ══════════════════════════════════════════════════ */

/* Body layout */
.wizard-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 360px;
}

/* Progress bar (ch-progress component — chaos-controls.css is not globally loaded) */
.wizard-progress { margin-bottom: 4px; }
.wizard-progress.ch-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wizard-progress .ch-progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.wizard-progress .ch-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Section title (above step content) */
.wizard-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Section step */
.wizard-section h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.wizard-section-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Instruction step */
.wizard-instructions h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.wizard-instruction-panel {
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}
.wizard-instruction-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
}
.wizard-instruction-link:hover { text-decoration: underline; }

/* Collapsible help panel (replaces standalone instruction steps) */
.wizard-help-details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    font-size: 13px;
}
.wizard-help-details summary {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
    list-style: none;
}
.wizard-help-details summary::before {
    content: '▸ ';
    font-size: 10px;
}
.wizard-help-details[open] summary::before {
    content: '▾ ';
}
.wizard-help-details summary:hover { color: var(--text-secondary); }
.wizard-help-panel {
    padding: 4px 16px 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.wizard-help-panel h3, .wizard-help-panel h4, .wizard-help-panel h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 12px 0 4px;
}
.wizard-help-panel p { margin: 4px 0; }
.wizard-help-panel ul, .wizard-help-panel ol {
    margin: 4px 0;
    padding-left: 20px;
}
.wizard-help-panel li { margin: 2px 0; }
.wizard-help-panel code {
    font-family: monospace;
    font-size: 12px;
    background: var(--bg-elevated);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Field context hint */
.wizard-field-context {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* Secret input with reveal toggle */
.wizard-secret-wrap {
    display: flex;
    gap: 4px;
    align-items: center;
}
.wizard-secret-wrap input {
    flex: 1;
    width: auto;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    font-family: 'SF Mono', 'Consolas', monospace;
}
.wizard-secret-wrap input:focus { border-color: var(--accent); }
.wizard-reveal-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
}
.wizard-reveal-btn:hover { color: var(--text-primary); border-color: var(--accent); }

/* Choice cards */
.wizard-choice-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wizard-choice-card {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.wizard-choice-card:hover { border-color: var(--accent); }
.wizard-choice-card.selected {
    border-color: var(--accent);
    background: rgba(0, 180, 234, 0.08);
}
.wizard-choice-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.wizard-choice-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Validation / Team task spinner */
.wizard-validation,
.wizard-team-task {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
}
.wizard-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: wizard-spin 0.8s linear infinite;
}
@keyframes wizard-spin {
    to { transform: rotate(360deg); }
}
.wizard-validation-msg,
.wizard-team-task-msg {
    font-size: 13px;
    color: var(--text-secondary);
}
.wizard-team-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Status messages */
.wizard-status { min-height: 18px; font-size: 12px; }
.wizard-status-error { color: #ef4444; }
.wizard-status-success { color: #22c55e; }

/* URL step */
.wizard-url-step {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wizard-url-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.wizard-url-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: #000;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
    transition: opacity 0.15s;
}
.wizard-url-btn:hover { opacity: 0.85; }
.wizard-url-hint {
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

/* OAuth flow step */
.wizard-oauth-flow {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wizard-oauth-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.wizard-oauth-status {
    font-size: 13px;
    min-height: 20px;
}

/* ── Dialog shell styles (wizard-renderer uses dialog.js which generates
      .kanban-dialog — scope all overrides under .wizard-overlay) ────── */

/* Modal card */
.wizard-overlay .kanban-dialog {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 500px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 32px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Title */
.wizard-overlay .kanban-dialog > h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Button row */
.wizard-overlay .dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

/* Secondary / Back button */
.wizard-overlay .btn-secondary {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: background 0.15s, border-color 0.15s;
}
.wizard-overlay .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

/* Primary / Next/Continue button */
.wizard-overlay .btn-primary {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #000;
    transition: opacity 0.15s;
}
.wizard-overlay .btn-primary:hover { opacity: 0.85; }
.wizard-overlay .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* Picker (wizard selection) */
.wizard-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 360px;
}
.wizard-picker-card {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    cursor: pointer;
    transition: border-color 0.15s;
}
.wizard-picker-card:hover { border-color: var(--accent); background: rgba(0, 180, 234, 0.04); }
.wizard-picker-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.wizard-picker-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.wizard-picker-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
