/**
 * Setup Wizard Styles
 * Full-screen wizard overlay covering WP admin chrome.
 * Uses design tokens from premium-shared.css.
 */

/* ---------------------------------------------------------------
   Full-Screen Overlay — hide WP admin sidebar & header
   --------------------------------------------------------------- */
html.strp-wizard-active,
html.strp-wizard-active body {
    overflow: hidden;
}

/* Override WordPress admin sidebar -- necessary for full-screen wizard overlay */
html.strp-wizard-active #wpcontent,
html.strp-wizard-active #wpfooter {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.strp-wizard-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: var(--strp-surface);
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Admin bar, sidebar, notices are hidden by the fixed overlay. */

/* ---------------------------------------------------------------
   Top Bar
   --------------------------------------------------------------- */
.strp-wizard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--strp-border);
    background: var(--strp-surface);
}

.strp-wizard-topbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--strp-text-primary);
    text-decoration: none;
}

.strp-wizard-topbar__logo {
    width: 32px;
    height: 32px;
    background: var(--strp-gradient);
    border-radius: var(--strp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.strp-wizard-topbar__exit {
    font-size: 14px;
    color: var(--strp-text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--strp-border);
    border-radius: var(--strp-radius-sm);
    transition: all var(--strp-transition);
}

.strp-wizard-topbar__exit:hover {
    color: var(--strp-text-primary);
    border-color: var(--strp-text-secondary);
}

/* ---------------------------------------------------------------
   Stepper — horizontal progress indicator
   --------------------------------------------------------------- */
.strp-wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 32px 0;
    max-width: 720px;
    margin: 0 auto;
}

.strp-wizard-stepper__step {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.strp-wizard-stepper__circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--strp-border);
    color: var(--strp-text-muted);
    background: var(--strp-surface);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.strp-wizard-stepper__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--strp-text-muted);
    transition: color 0.3s ease;
}

/* Active step */
.strp-wizard-stepper__step--active .strp-wizard-stepper__circle {
    background: var(--strp-gradient);
    border-color: var(--strp-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(132, 68, 249, 0.15);
}

.strp-wizard-stepper__step--active .strp-wizard-stepper__label {
    color: var(--strp-primary);
    font-weight: 600;
}

/* Completed step */
.strp-wizard-stepper__step--completed .strp-wizard-stepper__circle {
    background: var(--strp-primary);
    border-color: var(--strp-primary);
    color: #fff;
}

.strp-wizard-stepper__step--completed .strp-wizard-stepper__label {
    color: var(--strp-text-primary);
}

/* Connector line between steps */
.strp-wizard-stepper__line {
    flex: 1;
    height: 2px;
    background: var(--strp-border);
    margin: 0 12px;
    min-width: 24px;
    transition: background 0.3s ease;
}

.strp-wizard-stepper__line--completed {
    background: var(--strp-primary);
}

/* ---------------------------------------------------------------
   Step Content Container
   --------------------------------------------------------------- */
.strp-wizard-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 32px 60px;
}

.strp-wizard-step {
    display: none;
    animation: strpWizardFadeIn 0.3s ease;
}

.strp-wizard-step--active {
    display: block;
}

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

/* ---------------------------------------------------------------
   Step 1: Welcome
   --------------------------------------------------------------- */
.strp-wizard-welcome {
    text-align: center;
    padding: 40px 0 20px;
}

.strp-wizard-welcome__icon {
    width: 80px;
    height: 80px;
    background: var(--strp-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
    color: #fff;
}

.strp-wizard-welcome__icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #fff;
}

.strp-wizard-welcome h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--strp-text-primary);
    margin: 0 0 12px;
}

.strp-wizard-welcome__tagline {
    font-size: 18px;
    color: var(--strp-text-secondary);
    margin: 0 0 8px;
}

.strp-wizard-welcome__desc {
    font-size: 15px;
    color: var(--strp-text-muted);
    max-width: 480px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.strp-wizard-welcome__features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 32px 0;
    text-align: center;
}

.strp-wizard-welcome__feature {
    padding: 20px 16px;
    background: var(--strp-surface-secondary);
    border-radius: var(--strp-radius-md);
    border: 1px solid var(--strp-border);
}

.strp-wizard-welcome__feature-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.strp-wizard-welcome__feature-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.strp-wizard-welcome__feature-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--strp-text-primary);
    margin: 0 0 4px;
}

.strp-wizard-welcome__feature-desc {
    font-size: 13px;
    color: var(--strp-text-secondary);
    margin: 0;
}

/* ---------------------------------------------------------------
   Step Headers (steps 2-5)
   --------------------------------------------------------------- */
.strp-wizard-step__header {
    margin-bottom: 28px;
}

.strp-wizard-step__header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--strp-text-primary);
    margin: 0 0 8px;
}

.strp-wizard-step__header p {
    font-size: 15px;
    color: var(--strp-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ---------------------------------------------------------------
   Form Elements
   --------------------------------------------------------------- */
.strp-wizard-field {
    margin-bottom: 20px;
}

.strp-wizard-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--strp-text-primary);
    margin-bottom: 6px;
}

.strp-wizard-field .description {
    font-size: 13px;
    color: var(--strp-text-muted);
    margin-top: 4px;
}

.strp-wizard-field input[type="text"],
.strp-wizard-field input[type="number"],
.strp-wizard-field input[type="password"],
.strp-wizard-field input[type="url"],
.strp-wizard-field textarea,
.strp-wizard-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--strp-border);
    border-radius: var(--strp-radius-sm);
    font-size: 14px;
    color: var(--strp-text-primary);
    background: var(--strp-surface);
    transition: border-color var(--strp-transition), box-shadow var(--strp-transition);
    box-sizing: border-box;
}

.strp-wizard-field input:focus,
.strp-wizard-field textarea:focus,
.strp-wizard-field select:focus {
    outline: none;
    border-color: var(--strp-primary);
    box-shadow: 0 0 0 3px rgba(132, 68, 249, 0.12);
}

.strp-wizard-field textarea {
    min-height: 80px;
    resize: vertical;
}

.strp-wizard-field select {
    appearance: auto;
}

/* Field groups in a row */
.strp-wizard-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---------------------------------------------------------------
   Connection Status Cards
   --------------------------------------------------------------- */
.strp-wizard-status-card {
    padding: 20px 24px;
    border-radius: var(--strp-radius-md);
    border: 1px solid var(--strp-border);
    margin-bottom: 20px;
}

.strp-wizard-status-card--connected {
    border-color: rgba(0, 163, 42, 0.3);
    background: rgba(0, 163, 42, 0.04);
}

.strp-wizard-status-card--disconnected {
    border-color: rgba(214, 54, 56, 0.3);
    background: rgba(214, 54, 56, 0.04);
}

.strp-wizard-status-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.strp-wizard-status-card__icon {
    font-size: 20px;
}

.strp-wizard-status-card__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.strp-wizard-status-card--connected .strp-wizard-status-card__title {
    color: var(--strp-success);
}

.strp-wizard-status-card--disconnected .strp-wizard-status-card__title {
    color: var(--strp-danger);
}

.strp-wizard-status-card__body {
    font-size: 14px;
    color: var(--strp-text-secondary);
    line-height: 1.5;
}

.strp-wizard-status-card__body code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* ---------------------------------------------------------------
   Mode Toggle
   --------------------------------------------------------------- */
.strp-wizard-mode-toggle {
    display: inline-flex;
    background: var(--strp-surface-tertiary);
    border-radius: var(--strp-radius-sm);
    padding: 3px;
    margin-bottom: 20px;
}

.strp-wizard-mode-toggle__btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--strp-text-secondary);
    cursor: pointer;
    transition: all var(--strp-transition);
}

.strp-wizard-mode-toggle__btn--active {
    background: var(--strp-surface);
    color: var(--strp-primary);
    box-shadow: var(--strp-shadow-sm);
    font-weight: 600;
}

/* ---------------------------------------------------------------
   Webhook Section
   --------------------------------------------------------------- */
.strp-wizard-webhook-url {
    background: var(--strp-surface-secondary);
    border: 1px solid var(--strp-border);
    border-radius: var(--strp-radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.strp-wizard-webhook-url code {
    font-size: 13px;
    color: var(--strp-text-primary);
    word-break: break-all;
    flex: 1;
}

.strp-wizard-webhook-url__copy {
    padding: 6px 14px;
    border: 1px solid var(--strp-border);
    background: var(--strp-surface);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--strp-text-secondary);
    cursor: pointer;
    transition: all var(--strp-transition);
    white-space: nowrap;
}

.strp-wizard-webhook-url__copy:hover {
    border-color: var(--strp-primary);
    color: var(--strp-primary);
}

.strp-wizard-instructions {
    background: var(--strp-surface-secondary);
    border: 1px solid var(--strp-border);
    border-radius: var(--strp-radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.strp-wizard-instructions h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--strp-text-primary);
    margin: 0 0 12px;
}

.strp-wizard-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: var(--strp-text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.strp-wizard-instructions a {
    color: var(--strp-primary);
}

/* ---------------------------------------------------------------
   Product Mapping Card
   --------------------------------------------------------------- */
.strp-wizard-product-card {
    background: var(--strp-surface-secondary);
    border: 1px solid var(--strp-border);
    border-radius: var(--strp-radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.strp-wizard-product-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--strp-text-primary);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strp-wizard-product-card__badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strp-wizard-product-card__badge--monthly {
    background: var(--strp-primary-bg);
    color: var(--strp-primary);
}

.strp-wizard-product-card__badge--annual {
    background: var(--strp-teal-bg);
    color: #0a9;
}

.strp-wizard-product-card__badge--lifetime {
    background: rgba(219, 166, 23, 0.1);
    color: #b8860b;
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.strp-wizard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    margin-top: 32px;
    border-top: 1px solid var(--strp-border);
}

.strp-wizard-actions__left {
    display: flex;
    gap: 12px;
}

.strp-wizard-actions__right {
    display: flex;
    gap: 12px;
}

.strp-wizard-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--strp-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--strp-transition);
    text-decoration: none;
    line-height: 1;
}

.strp-wizard-btn--primary {
    background: var(--strp-gradient);
    color: #fff;
}

.strp-wizard-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(132, 68, 249, 0.35);
    transform: translateY(-1px);
    color: #fff;
}

.strp-wizard-btn--primary:active {
    transform: translateY(0);
}

.strp-wizard-btn--secondary {
    background: var(--strp-surface);
    color: var(--strp-text-primary);
    border: 1px solid var(--strp-border);
}

.strp-wizard-btn--secondary:hover {
    border-color: var(--strp-primary);
    color: var(--strp-primary);
}

.strp-wizard-btn--ghost {
    background: transparent;
    color: var(--strp-text-secondary);
}

.strp-wizard-btn--ghost:hover {
    color: var(--strp-primary);
}

.strp-wizard-btn--loading {
    pointer-events: none;
    opacity: 0.7;
}

.strp-wizard-btn--loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: strpWizardSpin 0.6s linear infinite;
    display: inline-block;
    margin-left: 8px;
}

.strp-wizard-btn--secondary.strp-wizard-btn--loading::after {
    border-color: rgba(132, 68, 249, 0.2);
    border-top-color: var(--strp-primary);
}

@keyframes strpWizardSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .strp-wizard-btn--loading::after {
        animation: none;
    }
    .strp-wizard-wrap {
        animation: none;
    }
}

/* ---------------------------------------------------------------
   Notice / Alert
   --------------------------------------------------------------- */
.strp-wizard-notice {
    padding: 12px 16px;
    border-radius: var(--strp-radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strp-wizard-notice--success {
    background: rgba(0, 163, 42, 0.08);
    color: var(--strp-success);
    border: 1px solid rgba(0, 163, 42, 0.2);
}

.strp-wizard-notice--error {
    background: rgba(214, 54, 56, 0.08);
    color: var(--strp-danger);
    border: 1px solid rgba(214, 54, 56, 0.2);
}

.strp-wizard-notice--info {
    background: var(--strp-primary-bg);
    color: var(--strp-primary);
    border: 1px solid var(--strp-primary-border);
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 782px) {
    .strp-wizard-stepper {
        padding: 20px 16px 0;
    }

    .strp-wizard-stepper__label {
        display: none;
    }

    .strp-wizard-stepper__line {
        min-width: 16px;
        margin: 0 6px;
    }

    .strp-wizard-content {
        padding: 24px 16px 40px;
    }

    .strp-wizard-welcome__features {
        grid-template-columns: 1fr;
    }

    .strp-wizard-field-row {
        grid-template-columns: 1fr;
    }

    .strp-wizard-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .strp-wizard-actions__left,
    .strp-wizard-actions__right {
        width: 100%;
    }

    .strp-wizard-actions__right {
        justify-content: center;
    }

    .strp-wizard-actions__right .strp-wizard-btn {
        flex: 1;
        justify-content: center;
    }

    .strp-wizard-topbar {
        padding: 12px 16px;
    }

    .strp-wizard-welcome h2 {
        font-size: 22px;
    }

    .strp-wizard-welcome__tagline {
        font-size: 16px;
    }
}

/* RTL Support */
[dir="rtl"] .strp-wizard-stepper {
    flex-direction: row-reverse;
}

[dir="rtl"] .strp-wizard-stepper__connector {
    transform: scaleX(-1);
}

[dir="rtl"] .strp-wizard-step__field label {
    text-align: right;
}

[dir="rtl"] .strp-wizard-step__field input,
[dir="rtl"] .strp-wizard-step__field select,
[dir="rtl"] .strp-wizard-step__field textarea {
    text-align: right;
}
