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

        body:has(.wizard-shell) {
            font-family: 'Inter', system-ui, sans-serif;
            background: #f1f5f9;
            min-height: 100vh;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding: 2rem 1rem;
        }

        .wizard-shell {
            width: 100%;
            max-width: 700px;
            display: flex;
            flex-direction: column;
        }

        /* ── header ── */
        .wizard-header {
            display: flex; align-items: center;
            justify-content: space-between; margin-bottom: 2rem;
        }
        .wizard-logo { display: flex; align-items: center; gap: .75rem; }
        .wizard-logo-text { font-size: 1.125rem; font-weight: 700; color: #0f172a; }
        .wizard-badge {
            font-size: .75rem; font-weight: 500;
            background: #dbeafe; color: #1d4ed8;
            padding: .25rem .75rem; border-radius: 9999px;
        }

        /* ── step bar ── */
        .wizard-steps {
            display: flex; align-items: center;
            background: white; border: 1px solid #e2e8f0;
            border-radius: 12px; padding: 1.25rem 1.5rem;
            margin-bottom: 2rem;
        }
        .step { display: flex; flex-direction: column; align-items: center; gap: .375rem; flex-shrink: 0; }
        .step-circle {
            width: 32px; height: 32px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: .8125rem; font-weight: 600;
            background: #e2e8f0; color: #64748b;
        }
        .step.active .step-circle { background: #2563eb; color: white; }
        .step.done   .step-circle { background: #16a34a; color: white; }
        .step-label { font-size: .6875rem; font-weight: 500; color: #94a3b8; white-space: nowrap; }
        .step.active .step-label { color: #2563eb; }
        .step.done   .step-label { color: #16a34a; }
        .step-connector { flex: 1; height: 2px; background: #e2e8f0; margin: 0 .5rem; margin-bottom: 1rem; }
        .step-connector.done { background: #16a34a; }

        /* ── content card ── */
        .wizard-content { background: white; border: 1px solid #e2e8f0; border-radius: 16px; padding: 2.5rem; }

        /* ── footer ── */
        .wizard-footer { text-align: center; font-size: .75rem; color: #94a3b8; margin-top: 1.5rem; }

        /* ── form helpers ── */
        .wizard-title { font-size: 1.375rem; font-weight: 700; color: #0f172a; margin-bottom: .375rem; }
        .wizard-subtitle { font-size: .9375rem; color: #64748b; margin-bottom: 2rem; line-height: 1.5; }

        .form-group { display: flex; flex-direction: column; gap: .375rem; margin-bottom: 1.25rem; }
        .form-label { font-size: .875rem; font-weight: 500; color: #374151; }
        .form-label .required { color: #ef4444; margin-left: .125rem; }
        .form-input, .form-select {
            width: 100%; padding: .625rem .875rem;
            border: 1px solid #d1d5db; border-radius: 8px;
            font-size: .9375rem; color: #111827; background: white;
            transition: border-color .15s, box-shadow .15s; outline: none;
        }
        .form-input:focus, .form-select:focus {
            border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12);
        }
        .form-hint { font-size: .8125rem; color: #6b7280; }
        .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

        /* ── alerts ── */
        .alert {
            display: flex; align-items: flex-start; gap: .75rem;
            padding: .875rem 1rem; border-radius: 8px;
            font-size: .9rem; margin-bottom: 1.5rem;
        }
        .alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
        .alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
        .alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
        .alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
        .alert-icon    { flex-shrink: 0; margin-top: .1rem; }

        /* ── buttons ── */
        .btn-row { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 2rem; }
        .btn {
            padding: .625rem 1.5rem; border: none; border-radius: 8px;
            font-size: .9375rem; font-weight: 600; cursor: pointer;
            display: inline-flex; align-items: center; gap: .5rem;
            text-decoration: none;
        }
        .btn:disabled { opacity: .55; cursor: not-allowed; }
        .btn-primary { background: #2563eb; color: white; }
        .btn-primary:hover:not(:disabled) { background: #1d4ed8; }
        .btn-ghost { background: #f1f5f9; color: #374151; }
        .btn-ghost:hover:not(:disabled) { background: #e2e8f0; }
        .btn-success { background: #16a34a; color: white; }
        .btn-success:hover:not(:disabled) { background: #15803d; }
        .btn-sm { padding: .4rem 1rem; font-size: .875rem; }

        /* ── spinner ── */
        .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor;
                 animation: pulse 1.2s ease-in-out infinite; display: inline-block; }
        @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

        /* ── form-check ── */
        .form-check { display: flex; align-items: center; gap: .625rem; }
        .form-check input[type=checkbox] { width: 1rem; height: 1rem; accent-color: #2563eb; }
        .form-check label { font-size: .9rem; color: #374151; cursor: pointer; }

        /* ── logo tabs ── */
        .tab-toggle { display: flex; gap: .5rem; margin-bottom: 1rem; }
        .tab-btn {
            padding: .375rem .875rem; border-radius: 6px;
            font-size: .875rem; font-weight: 500; border: 1px solid #d1d5db;
            background: white; color: #6b7280; cursor: pointer;
        }
        .tab-btn.active { background: #eff6ff; border-color: #2563eb; color: #2563eb; }

        

/* Connection string textarea */
.form-textarea {
    resize: vertical;
    min-height: 4rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    word-break: break-all;
    padding-right: 2.6rem;   /* room for reveal btn */
}
/* Dot-masking for SQL mode (-webkit-text-security works in Chromium/Edge/Safari) */
.form-textarea.ta-masked {
    -webkit-text-security: disc;
}
/* Wrapper positions the reveal button inside the textarea */
.ta-reveal-wrapper {
    position: relative;
}
.ta-reveal-btn {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #6B7280;
    padding: 0.2rem;
    line-height: 1;
    border-radius: 4px;
}
.ta-reveal-btn:hover { color: #3B72D4; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

/* ── Step 1: auth-mode selector & password reveal ───────────────────────── */
.auth-mode-group {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.auth-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem 1rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.auth-mode-btn:hover { border-color: #3B72D4; color: #3B72D4; }
.auth-mode-btn.auth-mode-active {
    border-color: #3B72D4;
    background: #eff6ff;
    color: #1d4ed8;
}
