/**
 * Setup Wizard V2 - Production Styles
 * Mobile-first, accessible, modern design
 */

/* ========== Variables - Light Theme (matches site) ========== */
:root {
    --wiz-primary: #2DD4BF;
    --wiz-primary-dark: #14B8A6;
    --wiz-primary-light: #5EEAD4;
    --wiz-success: #10b981;
    --wiz-warning: #f59e0b;
    --wiz-danger: #ef4444;
    --wiz-bg: #f6f0d9;
    --wiz-surface: #f6f0d9;
    --wiz-surface-hover: #f0eacd;
    --wiz-border: rgba(0,0,0,0.08);
    --wiz-text: #1f2937;
    --wiz-text-muted: #6b7280;
    --wiz-radius: 12px;
    --wiz-radius-lg: 16px;
    --wiz-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* ========== Main Container ========== */
.wizard-v2 {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    height: -webkit-fill-available;
    max-height: 100vh;
    max-height: 100dvh;
    background: var(--wiz-bg);
    color: var(--wiz-text);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden; /* Prevent outer scroll, scroll happens in main */
}

/* ========== Header ========== */
.wizard-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--wiz-border);
    background: var(--wiz-surface);
    backdrop-filter: blur(20px);
    box-shadow: var(--wiz-shadow);
    position: relative; /* Static on mobile to prevent scroll interference */
    z-index: 100;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .wizard-v2-header {
        position: sticky;
        top: 0;
    }
}

@media (min-width: 640px) {
    .wizard-v2-header {
        padding: 16px 24px;
    }
}

.wizard-v2-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-v2-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
}

.wizard-v2-title {
    font-weight: 600;
    font-size: 18px;
}

.wizard-v2-save-exit {
    padding: 8px 16px;
    border: 1px solid var(--wiz-primary);
    background: transparent;
    color: var(--wiz-primary-dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.wizard-v2-save-exit:hover {
    background: var(--wiz-primary);
    color: white;
}

/* ========== Steps Navigation ========== */
.wizard-v2-steps {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--wiz-surface);
    scroll-snap-type: x mandatory;
    flex-shrink: 0;
}

.wizard-v2-steps::-webkit-scrollbar {
    display: none;
}

@media (min-width: 640px) {
    .wizard-v2-steps {
        justify-content: center;
        padding: 24px;
        gap: 8px;
        overflow-x: visible;
    }
}

.wizard-v2-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--wiz-text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 13px;
    flex-shrink: 0;
    scroll-snap-align: center;
    min-width: fit-content;
}

@media (min-width: 640px) {
    .wizard-v2-step {
        padding: 8px 16px;
        font-size: 14px;
        gap: 8px;
    }
}

.wizard-v2-step:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.wizard-v2-step:not(:disabled):hover {
    background: var(--wiz-surface-hover);
}

.wizard-v2-step.current {
    background: var(--wiz-primary);
    color: white;
}

.wizard-v2-step.current .wizard-v2-step-num {
    background: rgba(255,255,255,0.3);
    color: white;
}

.wizard-v2-step.done {
    color: var(--wiz-success);
}

.wizard-v2-step-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: var(--wiz-text-muted);
}

.wizard-v2-step.current .wizard-v2-step-num {
    background: rgba(255,255,255,0.2);
}

.wizard-v2-step.done .wizard-v2-step-num {
    background: var(--wiz-success);
    color: white;
}

.wizard-v2-step-text {
    display: none;
}

@media (min-width: 768px) {
    .wizard-v2-step-text {
        display: inline;
    }
}

.wizard-v2-step-line {
    width: 24px;
    height: 2px;
    background: var(--wiz-border);
}

/* ========== Progress Bar ========== */
.wizard-v2-progress {
    height: 4px;
    background: var(--wiz-surface);
    flex-shrink: 0;
}

.wizard-v2-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--wiz-primary), var(--wiz-primary-dark));
    transition: width 0.3s ease;
}

/* ========== Main Content ========== */
.wizard-v2-main {
    flex: 1 1 0; /* Grow, shrink, and start from 0 */
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px;
    padding-bottom: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* Critical for flex scroll */
}

@media (min-width: 640px) {
    .wizard-v2-main {
        padding: 32px 24px;
        padding-bottom: 120px;
    }
}

.wizard-v2-step-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

@media (min-width: 640px) {
    .wizard-v2-step-header {
        gap: 16px;
        margin-bottom: 32px;
        flex-wrap: nowrap;
    }
}

.wizard-v2-step-icon {
    font-size: 28px;
    background: linear-gradient(135deg, var(--wiz-primary), var(--wiz-primary-dark));
    padding: 10px;
    border-radius: var(--wiz-radius);
    flex-shrink: 0;
    color: white;
}

@media (min-width: 640px) {
    .wizard-v2-step-icon {
        font-size: 32px;
        padding: 12px;
    }
}

.wizard-v2-step-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.wizard-v2-step-header p {
    margin: 4px 0 0;
    color: var(--wiz-text-muted);
}

.wizard-v2-skip {
    margin-left: auto;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--wiz-primary);
    color: var(--wiz-primary-dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.wizard-v2-skip:hover {
    background: rgba(45,212,191,0.1);
}

/* ========== Forms ========== */
.wizard-v2-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wizard-v2-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .wizard-v2-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.wizard-v2-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wizard-v2-field.full {
    grid-column: 1 / -1;
}

.wizard-v2-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--wiz-text);
}

.wizard-v2-field .req {
    color: var(--wiz-danger);
}

.wizard-v2-input, .wizard-v2-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--wiz-surface);
    border: 1px solid var(--wiz-border);
    border-radius: var(--wiz-radius);
    color: var(--wiz-text);
    font-size: 15px;
    transition: all 0.2s;
}

.wizard-v2-input:focus, .wizard-v2-select:focus {
    outline: none;
    border-color: var(--wiz-primary);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.15);
}

.wizard-v2-hint {
    font-size: 12px;
    color: var(--wiz-text-muted);
}

.wizard-v2-error {
    font-size: 12px;
    color: var(--wiz-danger);
    min-height: 16px;
}

.wizard-v2-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0 16px;
    padding-top: 16px;
    border-top: 1px solid var(--wiz-border);
}

.wizard-v2-section-title:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.wizard-v2-section-desc {
    color: var(--wiz-text-muted);
    margin-bottom: 16px;
}

/* ========== Size Options ========== */
.wizard-v2-size-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .wizard-v2-size-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

.wizard-v2-size {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--wiz-surface);
    border: 2px solid var(--wiz-border);
    border-radius: var(--wiz-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.wizard-v2-size input {
    display: none;
}

.wizard-v2-size:hover {
    border-color: var(--wiz-primary);
}

.wizard-v2-size.selected {
    border-color: var(--wiz-primary);
    border-width: 2px;
    background: rgba(45,212,191,0.15);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.3);
}

.wizard-v2-size.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 14px;
    color: var(--wiz-primary-dark);
    font-weight: bold;
}

.wizard-v2-size span {
    font-weight: 500;
    margin-top: 4px;
}

.wizard-v2-size small {
    font-size: 12px;
    color: var(--wiz-text-muted);
}

/* ========== Checkbox Grid ========== */
.wizard-v2-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .wizard-v2-checkbox-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.wizard-v2-checkbox-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--wiz-surface);
    border: 2px solid var(--wiz-border);
    border-radius: var(--wiz-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.wizard-v2-checkbox-card input {
    display: none;
}

.wizard-v2-checkbox-card:hover {
    border-color: var(--wiz-primary);
}

.wizard-v2-checkbox-card.selected {
    border-color: var(--wiz-primary);
    border-width: 2px;
    background: rgba(45,212,191,0.15);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.3);
}

.wizard-v2-checkbox-card.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 14px;
    color: var(--wiz-primary-dark);
    font-weight: bold;
}

.wizard-v2-checkbox-card .icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.wizard-v2-checkbox-card .label {
    font-weight: 600;
    font-size: 14px;
}

.wizard-v2-checkbox-card .desc {
    font-size: 12px;
    color: var(--wiz-text-muted);
    margin-top: 4px;
}

/* ========== Radio Cards ========== */
.wizard-v2-radio-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wizard-v2-radio-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--wiz-surface);
    border: 2px solid var(--wiz-border);
    border-radius: var(--wiz-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.wizard-v2-radio-card input {
    display: none;
}

.wizard-v2-radio-card:hover {
    border-color: var(--wiz-primary);
}

.wizard-v2-radio-card.selected {
    border-color: var(--wiz-primary);
    border-width: 2px;
    background: rgba(45,212,191,0.1);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.2);
}

.wizard-v2-radio-card .label {
    font-weight: 600;
}

.wizard-v2-radio-card .desc {
    font-size: 13px;
    color: var(--wiz-text-muted);
}

.wizard-v2-radio-card .rec-badge {
    margin-left: auto;
    padding: 4px 8px;
    background: var(--wiz-success);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ========== Plans ========== */
.wizard-v2-plans {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wizard-v2-billing-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 4px;
    background: var(--wiz-surface);
    border-radius: 8px;
    width: fit-content;
    margin: 0 auto;
}

.wizard-v2-billing-toggle label {
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.wizard-v2-billing-toggle label input {
    display: none;
}

.wizard-v2-billing-toggle label.active {
    background: var(--wiz-primary);
    color: white;
}

.save-badge {
    background: var(--wiz-success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 4px;
}

.wizard-v2-plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .wizard-v2-plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .wizard-v2-plans-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.wizard-v2-plan {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--wiz-surface);
    border: 2px solid var(--wiz-border);
    border-radius: var(--wiz-radius-lg);
    transition: all 0.2s;
    position: relative;
}

.wizard-v2-plan.popular {
    border-color: var(--wiz-primary);
}

.wizard-v2-plan.selected {
    border-color: var(--wiz-success);
    background: rgba(16,185,129,0.05);
}

.wizard-v2-plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wiz-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wizard-v2-plan h3 {
    margin: 0;
    font-size: 20px;
}

.wizard-v2-plan-price {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
}

.wizard-v2-plan p {
    color: var(--wiz-text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.wizard-v2-plan ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex: 1;
}

.wizard-v2-plan li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--wiz-text-muted);
}

.wizard-v2-plan-btn {
    width: 100%;
    padding: 12px;
    background: var(--wiz-surface-hover);
    border: 1px solid var(--wiz-border);
    color: var(--wiz-text);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.wizard-v2-plan.popular .wizard-v2-plan-btn {
    background: var(--wiz-primary);
    border-color: var(--wiz-primary);
}

.wizard-v2-plan-btn.selected {
    background: var(--wiz-success);
    border-color: var(--wiz-success);
}

/* ========== Standards & Connectors ========== */
.wizard-v2-suggestion {
    padding: 16px;
    background: rgba(45,212,191,0.1);
    border: 1px solid rgba(45,212,191,0.3);
    border-radius: var(--wiz-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wizard-v2-suggestion button {
    margin-left: auto;
    padding: 8px 16px;
    background: var(--wiz-primary);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.wizard-v2-suggestion button:hover {
    background: var(--wiz-primary-dark);
}

.wizard-v2-standards, .wizard-v2-connectors {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wizard-v2-standards-group h4, .wizard-v2-connectors-group h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--wiz-text-muted);
}

.wizard-v2-standards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wizard-v2-standard {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    padding-right: 28px; /* Space for checkmark */
    background: var(--wiz-surface);
    border: 2px solid var(--wiz-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
}

.wizard-v2-standard input {
    display: none;
}

.wizard-v2-standard:hover {
    border-color: var(--wiz-primary);
}

.wizard-v2-standard.selected {
    border-color: var(--wiz-primary);
    border-width: 2px;
    background: rgba(45,212,191,0.15);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.3);
}

.wizard-v2-standard.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--wiz-primary-dark);
    font-weight: bold;
}

/* Suggested standards - just show a small indicator, NOT a green border */
.wizard-v2-standard.suggested:not(.selected) {
    border-color: var(--wiz-border);
    background: var(--wiz-surface);
}

.wizard-v2-standard .rec {
    color: var(--wiz-warning);
}

.wizard-v2-connectors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .wizard-v2-connectors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.wizard-v2-connector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    padding-right: 32px; /* Space for checkmark */
    background: var(--wiz-surface);
    border: 2px solid var(--wiz-border);
    border-radius: var(--wiz-radius);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.wizard-v2-connector input {
    display: none;
}

.wizard-v2-connector:hover {
    border-color: var(--wiz-primary);
}

.wizard-v2-connector.selected {
    border-color: var(--wiz-primary);
    border-width: 2px;
    background: rgba(45,212,191,0.15);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.3);
}

.wizard-v2-connector.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--wiz-primary-dark);
    font-weight: bold;
}

.wizard-v2-connector .icon {
    font-size: 24px;
}

.wizard-v2-connector .name {
    font-weight: 500;
}

.wizard-v2-skip-hint {
    text-align: center;
    color: var(--wiz-text-muted);
    font-size: 13px;
    padding: 16px;
}

/* ========== Review ========== */
.wizard-v2-review-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .wizard-v2-review-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.wizard-v2-review-section {
    background: var(--wiz-surface);
    border: 1px solid var(--wiz-border);
    border-radius: var(--wiz-radius);
    padding: 16px;
}

.wizard-v2-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wiz-border);
}

.wizard-v2-review-header h4 {
    margin: 0;
    font-size: 14px;
}

.wizard-v2-review-header button {
    padding: 4px 10px;
    background: var(--wiz-primary);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.wizard-v2-review-header button:hover {
    background: var(--wiz-primary-dark);
}

.wizard-v2-review-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.wizard-v2-review-item .key {
    color: var(--wiz-text-muted);
}

.wizard-v2-terms {
    padding: 16px;
    background: var(--wiz-surface);
    border-radius: var(--wiz-radius);
}

.wizard-v2-terms label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.wizard-v2-terms a {
    color: var(--wiz-primary-dark);
    text-decoration: underline;
}

.wizard-v2-policies {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 12px 16px;
    background: var(--wiz-bg);
    border-radius: var(--wiz-radius);
    font-size: 13px;
}

.wizard-v2-policies-label {
    color: var(--wiz-text-muted);
    font-weight: 500;
    margin-right: 4px;
}

.wizard-v2-policies a {
    color: var(--wiz-primary-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.wizard-v2-policies a:hover {
    text-decoration: underline;
    color: var(--wiz-primary);
}

.wizard-v2-security-notice {
    padding: 16px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--wiz-radius);
    font-size: 13px;
    text-align: center;
}

/* ========== Email Verification ========== */
.wizard-v2-email-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 48px 32px;
    background: var(--wiz-surface);
    border-radius: var(--wiz-radius-lg);
    text-align: center;
}

.wizard-v2-email-card.verified {
    border: 2px solid var(--wiz-success);
}

.wizard-v2-email-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.wizard-v2-email-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.wizard-v2-email-addr {
    color: var(--wiz-primary);
    font-weight: 500;
    margin-bottom: 16px;
}

.wizard-v2-email-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.wizard-v2-email-help {
    margin-top: 24px;
    text-align: left;
    background: var(--wiz-bg);
    padding: 16px;
    border-radius: 8px;
}

.wizard-v2-email-help summary {
    cursor: pointer;
    color: var(--wiz-text-muted);
}

.wizard-v2-email-help ul {
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--wiz-text-muted);
    font-size: 13px;
}

/* ========== Footer ========== */
.wizard-v2-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--wiz-border);
    background: var(--wiz-surface);
    backdrop-filter: blur(20px);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.05);
    position: relative; /* Static on mobile to prevent scroll interference */
    z-index: 100;
    gap: 8px;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .wizard-v2-footer {
        position: sticky;
        bottom: 0;
    }
}

@media (min-width: 640px) {
    .wizard-v2-footer {
        padding: 16px 24px;
        gap: 16px;
    }
}

#autoSaveStatus {
    font-size: 13px;
    color: var(--wiz-text-muted);
}

#autoSaveStatus.saving {
    color: var(--wiz-warning);
}

#autoSaveStatus.saved {
    color: var(--wiz-success);
}

/* ========== Buttons ========== */
.wizard-v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px; /* Touch target */
    touch-action: manipulation;
}

@media (min-width: 640px) {
    .wizard-v2-btn {
        padding: 12px 24px;
        font-size: 15px;
        gap: 8px;
    }
}

.wizard-v2-btn.primary {
    background: var(--wiz-primary);
    color: white;
    font-weight: 600;
}

.wizard-v2-btn.primary:hover {
    background: var(--wiz-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45,212,191,0.3);
}

.wizard-v2-btn.secondary {
    background: transparent;
    border: 1px solid var(--wiz-primary);
    color: var(--wiz-primary-dark);
    font-weight: 500;
}

.wizard-v2-btn.secondary:hover {
    background: rgba(45,212,191,0.1);
}

.wizard-v2-btn.text {
    background: transparent;
    color: var(--wiz-primary);
    padding: 8px 12px;
}

.wizard-v2-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Spinner ========== */
.wizard-v2-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: wizSpin 0.8s linear infinite;
}

@keyframes wizSpin {
    to { transform: rotate(360deg); }
}

/* ========== Toast ========== */
.wizard-v2-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--wiz-success);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10000;
    animation: wizToastIn 0.3s ease;
    box-shadow: var(--wiz-shadow);
}

.wizard-v2-toast.error {
    background: var(--wiz-danger);
}

@keyframes wizToastIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Industry Hint ========== */
.wizard-v2-industry-hint {
    font-size: 13px;
    margin-top: 8px;
}

/* ========== SSO Success Card ========== */
.wizard-v2-sso-success {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #10b981;
    border-radius: var(--wiz-radius);
    margin-bottom: 24px;
    animation: wizSsoSlideIn 0.4s ease;
}

.wizard-v2-sso-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.wizard-v2-sso-content {
    flex: 1;
}

.wizard-v2-sso-content h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #065f46;
}

.wizard-v2-sso-content p {
    margin: 0;
    font-size: 14px;
    color: #047857;
}

.wizard-v2-sso-badge {
    padding: 6px 12px;
    background: #10b981;
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

@keyframes wizSsoSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
