/* ============================================================================
   Tahona WMS — Wizard Framework Styles

   Reusable wizard component styling supporting:
   - Step indicators with validation
   - Progress bar
   - Navigation buttons
   - Responsive layout
   - Fade-in animations
   - Form controls
   ============================================================================ */

/* ============================================================================
   CSS Variables (Design Tokens)
   ============================================================================ */
:root {
    /* Colors.
       The wizards are LIGHT-SURFACE ISLANDS in both themes (.wizard-container is white, and the
       gray scale below is a light scale), so they must NOT take --accent or the status tokens:
       those are theme-dependent, and the dark values are chosen for a dark ground. Pointing
       --wizard-primary at var(--accent) put white text on #2fb08a at 2.73:1 on every wizard's
       Next button in the default theme — the whole onboarding path.

       These are the LIGHT-theme values, spelled literally so they cannot follow the theme:
       white on #148464 measures 4.65:1. Re-theming the island properly (so it inherits a light
       token block) belongs with the wizard work in a later phase. */
    --wizard-primary: #148464;
    --wizard-primary-hover: #0f6b51;
    --wizard-primary-light: rgba(20, 132, 100, 0.1);
    --wizard-success: #1d8737;
    --wizard-success-light: rgba(29, 135, 55, 0.1);
    --wizard-warning: #a16a12;
    --wizard-danger: #c92a2a;
    --wizard-gray-50: #f8f9fa;
    --wizard-gray-100: #f1f3f5;
    --wizard-gray-200: #e9ecef;
    --wizard-gray-300: #dee2e6;
    --wizard-gray-400: #ced4da;
    --wizard-gray-500: #adb5bd;
    --wizard-gray-600: #6c757d;
    --wizard-gray-700: #495057;
    --wizard-gray-800: #343a40;
    --wizard-gray-900: #212529;

    /* Spacing */
    --wizard-spacing-xs: 8px;
    --wizard-spacing-sm: 12px;
    --wizard-spacing-md: 16px;
    --wizard-spacing-lg: 24px;
    --wizard-spacing-xl: 32px;
    --wizard-spacing-2xl: 48px;

    /* Borders */
    --wizard-border-radius: 8px;
    --wizard-border-radius-lg: 12px;
    --wizard-border-width: 1px;
    --wizard-border-color: var(--wizard-gray-200);

    /* Shadows */
    --wizard-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --wizard-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --wizard-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --wizard-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Typography */
    --wizard-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --wizard-font-family-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

    /* Transitions */
    --wizard-transition: all 0.2s ease;
    --wizard-transition-slow: all 0.3s ease;
}

/* ============================================================================
   Wizard Container
   ============================================================================ */
.wizard-container {
    background: white;
    /* The app ships a DARK theme (dark-theme.css sets --text-primary: #e2e8f0, a near-white),
       but this card is white. Anything inside that merely INHERITS its colour would render
       near-white on white and be invisible. Establish dark ink for the whole subtree here;
       the rules under "Contrast on the white card" below handle the elements that carry an
       explicit colour of their own and therefore ignore inheritance. */
    color: var(--wizard-gray-900);
    border-radius: var(--wizard-border-radius-lg);
    box-shadow: var(--wizard-shadow-lg);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

/* ============================================================================
   Contrast on the white card
   ----------------------------------------------------------------------------
   dark-theme.css styles bare `h1..h6` with `color: var(--text-primary)` — an
   ELEMENT-level rule, so it beats the inherited colour set on .wizard-container
   above and needs an explicit override scoped to the wizard. Without these, the
   step headings ("Store Information", "Sync Settings", "Sync Options") and any
   input text rendered near-white on white: technically present, visually gone.
   ============================================================================ */
.wizard-container h1,
.wizard-container h2,
.wizard-container h3,
.wizard-container h4,
.wizard-container h5,
.wizard-container h6 {
    color: var(--wizard-gray-900);
}

/* White-backgrounded fields must state their own ink — otherwise the text the
   operator types inherits the dark theme's near-white and is unreadable as they type. */
.wizard-container .wizard-input,
.wizard-container .wizard-select,
.wizard-container .wizard-textarea {
    color: var(--wizard-gray-900);
    background: white;
}

/* ============================================================================
   Wizard Header
   ============================================================================ */
.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--wizard-spacing-xl);
    border-bottom: var(--wizard-border-width) solid var(--wizard-border-color);
    background: var(--wizard-gray-50);
}

.wizard-header-content {
    flex: 1;
}

.wizard-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--wizard-gray-900);
}

.wizard-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--wizard-gray-600);
}

.wizard-close-btn {
    background: none;
    border: none;
    color: var(--wizard-gray-500);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--wizard-border-radius);
    transition: var(--wizard-transition);
}

.wizard-close-btn:hover {
    background: var(--wizard-gray-200);
    color: var(--wizard-gray-700);
}

/* ============================================================================
   Progress Bar
   ============================================================================ */
.wizard-progress-container {
    height: 4px;
    background: var(--wizard-gray-200);
    position: relative;
}

.wizard-progress-bar {
    height: 100%;
    background: var(--wizard-primary);
    transition: width 0.4s ease;
    position: absolute;
    left: 0;
    top: 0;
}

/* ============================================================================
   Step Indicators
   ============================================================================ */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    padding: var(--wizard-spacing-xl);
    gap: var(--wizard-spacing-md);
    border-bottom: var(--wizard-border-width) solid var(--wizard-border-color);
}

.wizard-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--wizard-spacing-xs);
    flex: 1;
    cursor: pointer;
    transition: var(--wizard-transition);
}

.wizard-step-indicator:hover .wizard-step-circle {
    transform: scale(1.05);
}

.wizard-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    background: var(--wizard-gray-200);
    color: var(--wizard-gray-600);
    border: 2px solid transparent;
    transition: var(--wizard-transition);
}

.wizard-step-indicator.active .wizard-step-circle {
    background: var(--wizard-primary);
    color: white;
    border-color: var(--wizard-primary);
    box-shadow: 0 0 0 4px var(--wizard-primary-light);
}

.wizard-step-indicator.completed .wizard-step-circle {
    background: var(--wizard-success);
    color: white;
    border-color: var(--wizard-success);
}

.wizard-step-indicator.completed.invalid .wizard-step-circle {
    background: var(--wizard-warning);
    border-color: var(--wizard-warning);
}

.wizard-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--wizard-gray-600);
    text-align: center;
    line-height: 1.3;
}

.wizard-step-indicator.active .wizard-step-label {
    color: var(--wizard-primary);
    font-weight: 600;
}

.wizard-step-indicator.completed .wizard-step-label {
    color: var(--wizard-success);
}

/* ============================================================================
   Wizard Content
   ============================================================================ */
.wizard-content {
    padding: var(--wizard-spacing-2xl);
    min-height: 400px;
}

.wizard-step-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-step-content.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ============================================================================
   Wizard Footer
   ============================================================================ */
.wizard-footer {
    padding: var(--wizard-spacing-lg) var(--wizard-spacing-xl);
    border-top: var(--wizard-border-width) solid var(--wizard-border-color);
    background: var(--wizard-gray-50);
}

.wizard-footer-buttons {
    display: flex;
    align-items: center;
    gap: var(--wizard-spacing-md);
    margin-bottom: var(--wizard-spacing-sm);
}

/* dashboard.css also defines .wizard-footer (a flex row) for its own cards; inside the wizard
   island the footer stacks the cancel question above the buttons, so the question is never
   squeezed into a column beside them (seen on the onboarding hub). */
.wizard-container .wizard-footer {
    display: block;
}

.wizard-footer > .wizard-alert {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: var(--wizard-spacing-md);
}

.wizard-step-count {
    text-align: center;
    font-size: 13px;
    color: var(--wizard-gray-600);
    font-weight: 500;
}

/* ============================================================================
   Buttons
   ============================================================================ */
.wizard-btn {
    padding: 12px 24px;
    border-radius: var(--wizard-border-radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--wizard-transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--wizard-font-family);
}

.wizard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-btn-primary {
    background: var(--wizard-primary);
    color: white;
}

.wizard-btn-primary:hover:not(:disabled) {
    background: var(--wizard-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--wizard-shadow-md);
}

.wizard-btn-complete {
    background: var(--wizard-success);
}

.wizard-btn-complete:hover:not(:disabled) {
    background: #0d9668;
}

.wizard-btn-secondary {
    background: white;
    color: var(--wizard-gray-700);
    border: var(--wizard-border-width) solid var(--wizard-border-color);
}

.wizard-btn-secondary:hover:not(:disabled) {
    background: var(--wizard-gray-100);
    border-color: var(--wizard-gray-300);
}

.wizard-btn-ghost {
    background: transparent;
    color: var(--wizard-gray-600);
    border: none;
    padding: 10px 16px;
}

.wizard-btn-ghost:hover:not(:disabled) {
    background: var(--wizard-gray-100);
    color: var(--wizard-gray-700);
}

/* ============================================================================
   Form Controls
   ============================================================================ */
.wizard-form-group {
    margin-bottom: var(--wizard-spacing-lg);
}

/* .wizard-label is ALSO used outside the wizard, on the app's dark surfaces (/orders,
   /inventory, /clients, /settings/api-keys all label fields with it). Hard-coding the
   wizard's near-black ink made those labels ("Client", "Code", "Name", "Scopes")
   invisible on the dark background. So the default is the app's light theme ink, and the
   dark ink is re-asserted only inside the white .wizard-container. */
.wizard-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: var(--wizard-spacing-xs);
}

.wizard-container .wizard-label {
    color: var(--wizard-gray-900);
}

.wizard-label-required::after {
    content: ' *';
    color: var(--wizard-danger);
}

.wizard-input,
.wizard-select,
.wizard-textarea {
    width: 100%;
    padding: 10px 12px;
    border: var(--wizard-border-width) solid var(--wizard-border-color);
    border-radius: var(--wizard-border-radius);
    font-size: 14px;
    font-family: var(--wizard-font-family);
    transition: var(--wizard-transition);
    /* Outside the wizard island (Orders' and Stock's client filters, the Clients page) a field
       takes the page's surface and ink; the island re-asserts white and near-black above. */
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.wizard-input:focus,
.wizard-select:focus,
.wizard-textarea:focus {
    outline: none;
    border-color: var(--wizard-primary);
    box-shadow: 0 0 0 3px var(--wizard-primary-light);
}

.wizard-input.is-invalid,
.wizard-select.is-invalid,
.wizard-textarea.is-invalid {
    border-color: var(--wizard-danger);
}

.wizard-input.is-invalid:focus,
.wizard-select.is-invalid:focus,
.wizard-textarea.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.wizard-textarea {
    resize: vertical;
    min-height: 100px;
}

.wizard-help-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--wizard-spacing-xs);
    line-height: 1.4;
}

.wizard-container .wizard-help-text {
    color: var(--wizard-gray-600);
}

.wizard-error-text {
    font-size: 13px;
    color: var(--wizard-danger);
    margin-top: var(--wizard-spacing-xs);
    font-weight: 500;
}

/* ============================================================================
   Card Selection
   ============================================================================ */

/* ============================================================================
   Checkboxes and Radios
   ============================================================================ */
.wizard-checkbox,
.wizard-radio {
    display: flex;
    align-items: center;
    gap: var(--wizard-spacing-sm);
    cursor: pointer;
    padding: var(--wizard-spacing-sm);
    border-radius: var(--wizard-border-radius);
    transition: var(--wizard-transition);
}

.wizard-checkbox:hover,
.wizard-radio:hover {
    background: var(--bg-tertiary);
}

.wizard-container .wizard-radio:hover {
    background: var(--wizard-gray-100);
}

.wizard-checkbox input[type="checkbox"],
.wizard-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Choice cards (WizardRadioOption): a label around a real, visually hidden radio. The circle
   is drawn; the input carries the semantics. Shared by the EasyPost and wave-rules wizards —
   each used to carry (or lack) its own copy (UX evaluation 2026-10, finding 7). */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* A fieldset by default: reset the browser box so the legend reads as a form label. */
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.radio-group > legend {
    padding: 0;
    margin-bottom: 8px;
}

.radio-option {
    display: block;
    position: relative;
    border: 2px solid var(--wizard-gray-200);
    border-radius: var(--wizard-border-radius);
    padding: var(--wizard-spacing-md);
    cursor: pointer;
    transition: var(--wizard-transition);
}

.radio-option:hover {
    border-color: var(--wizard-primary);
    background: var(--wizard-gray-50);
}

.radio-option.selected {
    border-color: var(--wizard-primary);
    background: var(--wizard-primary-light);
}

.radio-option:has(.radio-input:focus-visible) {
    outline: 3px solid var(--wizard-primary);
    outline-offset: 2px;
}

.radio-option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.radio-option.disabled:hover {
    border-color: var(--wizard-gray-200);
    background: transparent;
}

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

.radio-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.radio-circle {
    width: 20px;
    height: 20px;
    /* gray-600 (#6c757d) on white is 4.7:1 — the unselected indicator needs 3:1 (WCAG 1.4.11);
       gray-400 was 1.5:1. */
    border: 2px solid var(--wizard-gray-600);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ffffff;
}

.radio-option.selected .radio-circle {
    border-color: var(--wizard-primary);
}

.radio-circle-inner {
    width: 10px;
    height: 10px;
    background: var(--wizard-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.radio-option.selected .radio-circle-inner {
    opacity: 1;
}

.radio-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--wizard-gray-900);
}

/* A radio group laid out as cards side by side (zone templates, label formats) instead of a
   column. */
.radio-group.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.radio-group.radio-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .radio-group.radio-grid-3 {
        grid-template-columns: 1fr;
    }
}

.radio-description ul {
    text-align: left;
}

.radio-description ul li {
    margin-bottom: 4px;
}

/* Field rows that sit side by side on a desk and stack on a phone. The wizards used inline
   grid-template-columns, which never collapsed: three fields in 310 px (UX evaluation 2026-10,
   finding 46). NoInlineMultiColumnGridsTests keeps new rows on these classes. */
.wizard-grid {
    display: grid;
    gap: 16px;
}

.wizard-grid-2 { grid-template-columns: repeat(2, 1fr); }
.wizard-grid-3 { grid-template-columns: repeat(3, 1fr); }
.wizard-grid-2-1-1 { grid-template-columns: 2fr 1fr 1fr; }
.wizard-grid-2-2-2-1 { grid-template-columns: 2fr 2fr 2fr 1fr; gap: 12px; align-items: start; }

.wizard-grid {
    margin-top: 0;
}

@media (max-width: 768px) {
    .wizard-grid-2,
    .wizard-grid-3,
    .wizard-grid-2-1-1,
    .wizard-grid-2-2-2-1 {
        grid-template-columns: 1fr;
    }

    /* A row whose columns are its own (an inline grid-template-columns) still stacks on a
       phone when it carries this class; !important is what beats the inline style. */
    .stack-on-phone {
        grid-template-columns: 1fr !important;
    }
}

/* ── Checkbox cards (EasyPost carriers): a label around a visually hidden checkbox ── */
.carrier-group {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.carrier-group > legend {
    padding: 0;
    margin-bottom: 8px;
}

.carrier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.carrier-card {
    display: block;
    border: 2px solid var(--wizard-gray-200);
    border-radius: var(--wizard-border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--wizard-transition);
    position: relative;
}

.carrier-card:hover {
    border-color: var(--wizard-primary);
    transform: translateY(-2px);
    box-shadow: var(--wizard-shadow-md);
}

.carrier-card.selected {
    border-color: var(--wizard-primary);
    background: var(--wizard-primary-light);
}

.carrier-card:has(.radio-input:focus-visible) {
    outline: 3px solid var(--wizard-primary);
    outline-offset: 2px;
}

.carrier-logo {
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
}

.carrier-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--wizard-gray-900);
}

.carrier-note {
    display: block;
    font-size: 11px;
    color: var(--wizard-gray-700);
    margin-top: 4px;
}

.carrier-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--wizard-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.carrier-card.selected .carrier-checkmark {
    opacity: 1;
}

/* ── Plain checkbox lists (API-key scopes, Amazon warehouses): one row per box, a legend
   above (UX evaluation 2026-10, finding 50). ── */
.wizard-checkbox-group {
    border: 0;
    padding: 0;
    margin-top: 0;
    margin-inline: 0;
    min-width: 0;
}

.wizard-checkbox-group > legend {
    padding: 0;
    margin-bottom: 8px;
}

/* Like .wizard-label: the API-key scopes live on the dark admin surface, so the default ink is
   the page's and the wizard's near-black is re-asserted only inside the white island (review of
   this change — the first draft painted the scope names #212529 on dark navy). */
.wizard-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.wizard-container .wizard-checkbox-label {
    color: var(--wizard-gray-900);
}

.wizard-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

.radio-description {
    display: block;
    font-size: 14px;
    /* gray-700 (#495057): 7:1 on white and above 4.5:1 on the selected tint; gray-600 fell to
       4.1:1 on the selected card. */
    color: var(--wizard-gray-700);
    padding-left: 32px;
    margin-top: 4px;
}

/* ============================================================================
   Alerts and Messages
   ============================================================================ */
.wizard-alert {
    padding: var(--wizard-spacing-md);
    border-radius: var(--wizard-border-radius);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: var(--wizard-spacing-lg);
}

.wizard-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.wizard-alert-success {
    background: var(--wizard-success-light);
    border-left: 4px solid var(--wizard-success);
    color: #065f46;
}

.wizard-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--wizard-warning);
    color: #92400e;
}

.wizard-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--wizard-danger);
    color: #991b1b;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 768px) {
    .wizard-container {
        border-radius: 0;
        max-width: 100%;
    }

    .wizard-header {
        padding: var(--wizard-spacing-lg);
    }

    .wizard-title {
        font-size: 20px;
    }

    .wizard-steps {
        padding: var(--wizard-spacing-lg);
        overflow-x: auto;
    }

    .wizard-step-label {
        display: none;
    }

    .wizard-step-circle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .wizard-content {
        padding: var(--wizard-spacing-lg);
        min-height: 300px;
    }

    .wizard-footer {
        padding: var(--wizard-spacing-md) var(--wizard-spacing-lg);
    }


    .wizard-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    .wizard-close-btn,
    .wizard-footer {
        display: none;
    }

    .wizard-container {
        box-shadow: none;
        border: 1px solid var(--wizard-border-color);
    }
}

/* ============================================================================
   Review Section Styles
   ============================================================================ */
.wizard-review-section {
    margin-bottom: var(--wizard-spacing-xl);
    padding: var(--wizard-spacing-lg);
    background-color: var(--wizard-gray-50);
    border-radius: var(--wizard-border-radius);
    border: var(--wizard-border-width) solid var(--wizard-border-color);
}

.wizard-review-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wizard-gray-900);
    margin: 0 0 var(--wizard-spacing-md) 0;
}

.wizard-review-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--wizard-spacing-md);
}

.wizard-review-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--wizard-spacing-sm) 0;
    border-bottom: var(--wizard-border-width) solid var(--wizard-gray-200);
}

.wizard-review-item:last-child {
    border-bottom: none;
}

.wizard-review-label {
    font-weight: 500;
    color: var(--wizard-gray-700);
    margin-right: var(--wizard-spacing-md);
    min-width: 140px;
}

.wizard-review-value {
    flex: 1;
    color: var(--wizard-gray-900);
    text-align: right;
}

@media (max-width: 768px) {
    .wizard-review-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard-review-label {
        margin-bottom: var(--wizard-spacing-xs);
    }

    .wizard-review-value {
        text-align: left;
    }
}

/* ============================================================================
   Wizard Tooltips & Guided Tours
   ============================================================================ */

.wizard-tooltip {
    position: absolute;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.wizard-tooltip-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wizard-tooltip-content {
    background: var(--wizard-gray-900);
    color: white;
    padding: var(--wizard-spacing-sm) var(--wizard-spacing-md);
    border-radius: var(--wizard-border-radius);
    box-shadow: var(--wizard-shadow-lg);
    max-width: 300px;
    position: relative;
}

.wizard-tooltip-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: var(--wizard-spacing-xs);
}

.wizard-tooltip-body {
    font-size: 13px;
    line-height: 1.5;
}

.wizard-tooltip-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
}

.wizard-tooltip-close:hover {
    opacity: 1;
}

.wizard-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

/* Save Draft Button */
.wizard-save-draft-btn {
    background: transparent;
    border: 1px solid var(--wizard-gray-300);
    color: var(--wizard-gray-700);
    padding: var(--wizard-spacing-sm) var(--wizard-spacing-md);
    border-radius: var(--wizard-border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.wizard-save-draft-btn:hover {
    border-color: var(--wizard-primary);
    color: var(--wizard-primary);
    background: var(--wizard-primary-light);
}

.wizard-save-draft-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Inline help expander (reusable across integration wizards) ===== */
.wizard-help-expander {
    margin-top: var(--wizard-spacing-xs);
    border: var(--wizard-border-width) solid var(--wizard-border-color);
    border-radius: var(--wizard-border-radius);
    background: var(--wizard-gray-50);
}

.wizard-help-expander[open] {
    background: #fff;
    box-shadow: var(--wizard-shadow-sm);
}

.wizard-help-expander-summary {
    display: flex;
    align-items: center;
    gap: var(--wizard-spacing-xs);
    padding: var(--wizard-spacing-sm) var(--wizard-spacing-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--wizard-primary);
    list-style: none;
    user-select: none;
}

.wizard-help-expander-summary::-webkit-details-marker {
    display: none;
}

.wizard-help-expander-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--wizard-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.wizard-help-expander[open] .wizard-help-expander-title::after {
    content: " (hide)";
    font-weight: 400;
    color: var(--wizard-gray-500);
}

.wizard-help-expander-body {
    padding: 0 var(--wizard-spacing-md) var(--wizard-spacing-md);
    font-size: 13px;
    color: var(--wizard-gray-700);
    line-height: 1.6;
}

.wizard-help-expander-body ol,
.wizard-help-expander-body ul {
    margin: var(--wizard-spacing-xs) 0 0;
    padding-left: 20px;
}

.wizard-help-expander-body li {
    margin-bottom: 6px;
}

.wizard-help-expander-body code,
.wizard-scope-list code {
    font-family: var(--wizard-font-family-mono);
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--wizard-gray-100);
    color: var(--wizard-gray-900);
}

/* Scope list — required vs optional */
.wizard-scope-list {
    margin: var(--wizard-spacing-xs) 0 0;
    padding: 0;
    list-style: none;
}

.wizard-scope-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
}

.wizard-scope-tag {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 999px;
}

.wizard-scope-tag-required {
    background: var(--wizard-primary-light);
    color: var(--wizard-primary);
}

.wizard-scope-tag-optional {
    background: var(--wizard-gray-100);
    color: var(--wizard-gray-600);
}

/* Callouts (warning / info) */
.wizard-callout {
    display: flex;
    gap: var(--wizard-spacing-xs);
    margin-top: var(--wizard-spacing-sm);
    padding: var(--wizard-spacing-sm) var(--wizard-spacing-md);
    border-radius: var(--wizard-border-radius);
    font-size: 12.5px;
    line-height: 1.5;
}

.wizard-callout-icon {
    flex-shrink: 0;
    font-weight: 700;
}

.wizard-callout-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #92610a;
}

.wizard-callout-info {
    background: var(--wizard-primary-light);
    color: var(--wizard-gray-800);
}
