/**
 * Authority Mailer SMTP - Onboarding Wizard Stylesheet (Redesigned)
 *
 * Save as: wp-content/plugins/authority-mailer-smtp/assets/css/onboarding.css
 *
 * Professional wizard styling that matches the dashboard and email log pages.
 * Uses unified header structure and consistent layout patterns.
 *
 * @package Authority Mailer
 * @since 2.1.0
 */

/* ==========================================================================
   CSS Custom Properties (Unified with Dashboard & Email Log)
   ========================================================================== */

:root {
    /* Brand Colors - MATCHING DASHBOARD */
    --mm-brand-primary: #6366F1;
    --mm-brand-primary-dark: #4F46E5;
    --mm-brand-primary-light: rgba(99, 102, 241, 0.1);
    --mm-brand-accent: #8B5CF6;

    /* Wizard accent now matches brand primary */
    --mm-wizard-accent: #6366F1;
    --mm-wizard-accent-dark: #4F46E5;
    --mm-wizard-accent-light: rgba(99, 102, 241, 0.1);

    /* Semantic Colors */
    --mm-success: #10B981;
    --mm-success-light: #D1FAE5;
    --mm-success-dark: #047857;
    --mm-danger: #EF4444;
    --mm-danger-light: #FEE2E2;
    --mm-danger-dark: #B91C1C;
    --mm-warning: #F59E0B;
    --mm-warning-light: #FEF3C7;
    --mm-warning-dark: #92400E;

    /* Neutral Colors */
    --mm-gray-50: #F9FAFB;
    --mm-gray-100: #F3F4F6;
    --mm-gray-200: #E5E7EB;
    --mm-gray-300: #D1D5DB;
    --mm-gray-400: #9CA3AF;
    --mm-gray-500: #6B7280;
    --mm-gray-600: #4B5563;
    --mm-gray-700: #374151;
    --mm-gray-800: #1F2937;
    --mm-gray-900: #111827;

    /* Layout */
    --mm-radius-sm: 6px;
    --mm-radius: 10px;
    --mm-radius-lg: 14px;
    --mm-radius-xl: 20px;

    /* Shadows */
    --mm-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --mm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --mm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --mm-shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.1), 0 3px 6px -2px rgba(0, 0, 0, 0.05);
    --mm-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -5px rgba(0, 0, 0, 0.04);

    /* Typography */
    --mm-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mm-font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

    /* Transitions */
    --mm-transition-fast: 0.12s ease;
    --mm-transition: 0.2s ease;
    --mm-transition-slow: 0.3s ease;
}

/* ==========================================================================
   Page Wrapper (Matching Dashboard)
   ========================================================================== */

.authority-mailer-wizard-layout {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: var(--am-gray-50);
    box-sizing: border-box;
    font-family: var(--am-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove WordPress default margins */
.authority-mailer-wizard-layout .wrap {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Wizard Body Layout - FIXED FOR TWO COLUMN LAYOUT
   ========================================================================== */

.authority-mailer-wizard-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 10px;
    background: var(--am-gray-50);
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
}

/* Enable two-column layout on desktop */
@media (min-width: 1024px) {
    .authority-mailer-wizard-body {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 768px) {
    .authority-mailer-wizard-body {
        padding: 20px;
        grid-template-columns: 1fr; /* Single column on mobile */
    }
}

/* ==========================================================================
   Main Wizard Container
   ========================================================================== */

.authority-mailer-wizard-main {
    max-width: 100%;
    margin: 0;
    padding: 0;
    /* This is the left column in the grid */
}

/* Add white background container for main content */
.wpmsl-onboarding-wrap {
    margin: 0 auto;
    color: var(--am-gray-900);
    background: #fff;
    border: 1px solid var(--am-gray-200);
    border-radius: var(--am-radius-lg);
    padding: 32px;
    box-shadow: var(--am-shadow-sm);
}

@media (max-width: 768px) {
    .wpmsl-onboarding-wrap {
        padding: 24px 20px;
    }
}

/* ==========================================================================
   Hero Header (Simplified for Dashboard Consistency)
   ========================================================================== */

.wpmsl-onboarding-hero {
    text-align: center;
    margin-bottom: 32px;
    padding: 0 0 24px 0;
    border-bottom: 1px solid var(--am-gray-200);
}

.wpmsl-onboarding-hero h1 {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--am-gray-900);
    letter-spacing: -0.01em;
}

.wpmsl-hero-sub {
    margin: 0;
    color: var(--am-gray-500);
    font-size: 15px;
    line-height: 1.5;
}

/* ==========================================================================
   Progress Stepper (Cleaner Design)
   ========================================================================== */

.wpmsl-steps {
    display: none !important;
}

.wpmsl-simple-stepper {
    margin: 0 0 32px;
    padding: 0;
}

.wpmsl-simple-stepper .track {
    background: var(--am-gray-200);
    height: 4px;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.wpmsl-simple-stepper .track .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--am-brand-primary) 0%, var(--am-brand-accent) 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.wpmsl-simple-stepper .steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
}

.wpmsl-simple-stepper .step {
    flex: 1 1 0;
    text-align: center;
    background: transparent;
    border: none;
}

.wpmsl-simple-stepper .step .step-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-direction: column;
    width: 100%;
    transition: transform 0.2s ease;
}

.wpmsl-simple-stepper .step .step-btn:hover {
    transform: translateY(-2px);
}

.wpmsl-simple-stepper .step .dot {
    width: 48px;
    height: 48px;
    line-height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--am-gray-300);
    color: var(--am-gray-500);
    font-weight: 600;
    font-size: 16px;
    box-shadow: var(--am-shadow-xs);
    transition: all 0.3s ease;
}

.wpmsl-simple-stepper .step .dot svg {
    width: 20px;
    height: 20px;
}

.wpmsl-simple-stepper .step .label {
    display: block;
    font-size: 12px !important;
    font-weight: 500;
    color: var(--am-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 8px;
    transition: color 0.2s ease;
}

/* Active step styling */
.wpmsl-simple-stepper .step.active .dot {
    background: var(--am-brand-primary);
    border-color: var(--am-brand-primary);
    color: #fff;
    box-shadow: var(--am-shadow), 0 0 16px rgba(99, 102, 241, 0.3);
}

.wpmsl-simple-stepper .step.active .label {
    color: var(--am-brand-primary);
    font-weight: 600;
}

/* Completed step styling */
.wpmsl-simple-stepper .step.completed .dot {
    background: var(--am-success);
    border-color: var(--am-success);
    color: #fff;
}

.wpmsl-simple-stepper .step.completed .label {
    color: var(--am-gray-700);
}

/* ==========================================================================
   Card Component (Matching Dashboard Cards)
   ========================================================================== */

.wpmsl-card {
    background: var(--am-gray-50);
    border: 1px solid var(--am-gray-200);
    border-radius: var(--am-radius-lg);
    padding: 24px;
    box-shadow: none;
    margin-bottom: 24px;
}

/* Constrain form content within cards */
.wpmsl-card > form,
.wpmsl-card > div > form {

}

.wpmsl-card-heading {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--am-gray-900);
    line-height: 1.3;
}

.wpmsl-card-subheading {
    margin: 0 0 24px;
    font-size: 12px !important;
    color: var(--am-gray-500);
    line-height: 1.6;
}

.wpmsl-muted {
    color: var(--am-gray-500);
    font-size: 12px !important;
    margin: 0 0 20px;
    line-height: 1.6;
}

.wpmsl-step-meta {
    display: inline-block;
    font-size: 12px !important;
    font-weight: 600;
    color: var(--am-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* ==========================================================================
   Provider/Mailer Tile Grid (Improved Layout)
   ========================================================================== */

.wpmsl-mailers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
    padding-top: 24px;
    border-top: 1px solid var(--am-gray-200);
}

@media (max-width: 600px) {
    .wpmsl-mailers-grid {
        grid-template-columns: 1fr;
    }
}

.wpmsl-mailer-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border: 2px solid var(--am-gray-200);
    border-radius: var(--am-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 50px;
}

.wpmsl-mailer-tile:hover {
    border-color: var(--am-gray-300);
    box-shadow: var(--am-shadow-sm);
    transform: translateY(-2px);
}

.wpmsl-mailer-tile.selected {
    background: var(--am-brand-primary-light);
    border-color: var(--am-brand-primary);
    box-shadow: var(--am-shadow), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wpmsl-mailer-tile.selected::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--am-brand-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpmsl-mailer-tile.selected::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px !important;
    font-weight: 700;
    z-index: 2;
}

/* Hide native radio button */
.wpmsl-mailer-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wpmsl-mailer-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpmsl-mailer-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.wpmsl-mailer-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wpmsl-mailer-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--am-gray-900);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PRO badge */
.wpmsl-pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* PRO mailer styling */
.wpmsl-mailer-tile[data-pro="1"] {
    opacity: 0.8;
}

.wpmsl-mailer-tile[data-pro="1"]:hover {
    opacity: 1;
}

.wpmsl-mailer-tile[data-pro="1"] .wpmsl-mailer-title {
    color: var(--am-gray-700);
}

/* ==========================================================================
   Form Components - TWO COLUMN LAYOUT
   ========================================================================== */

/* Form container */
.wpmsl-card form {
    max-width: 100%;
}

/* Two-column grid for provider forms */
.wpmsl-form-grid {
    display: block;
}

.wpmsl-form-grid--split {
    display: grid;
    grid-template-columns: 2fr auto 1fr;
    gap: 0;
    align-items: start;
}

/* Left column - Main form fields */
.wpmsl-form-col--main {
    padding-right: 40px;
    min-width: 0; /* Allows proper text wrapping */
}

/* Vertical divider between columns */
.wpmsl-vertical-divider {
    width: 1px;
    background: var(--am-gray-200);
    height: 100%;
    min-height: 300px;
    margin: 0 40px;
}

/* Right column - Toggle switches */
.wpmsl-form-col--toggles {
    max-width: 320px;
    min-width: 280px;
}

@media (max-width: 900px) {
    .wpmsl-form-grid--split {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .wpmsl-vertical-divider {
        display: none;
    }

    .wpmsl-form-col--main,
    .wpmsl-form-col--toggles {
        padding: 0;
    }
}

/* Section headings within forms */
.wpmsl-section-subheading {
    font-size: 12px !important;
    font-weight: 700;
    color: var(--am-gray-900);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wpmsl-section-subheading--spaced {
    margin-top: 24px;
}

/* Section divider */
.wpmsl-section-divider {
    height: 1px;
    background: var(--am-gray-200);
    margin: 24px 0;
}

/* Form rows */
.wpmsl-form-row {
    margin-bottom: 20px;
}

/* Form labels - vertical layout */
.wpmsl-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px !important;
    font-weight: 600;
    color: var(--am-gray-700);
}

/* Input fields */
.wpmsl-form-input {
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
    font-size: 12px !important;
    border: 1px solid var(--am-gray-300);
    border-radius: var(--am-radius-sm);
    background: #fff;
    color: var(--am-gray-900);
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.wpmsl-form-input:focus {
    outline: none;
    border-color: var(--am-brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wpmsl-form-input::placeholder {
    color: var(--am-gray-400);
}

.wpmsl-form-input[type="number"] {
    max-width: 150px;
}

/* Toggle blocks */
.wpmsl-toggle-block {
    margin-bottom: 24px;
}

.wpmsl-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Toggle control wrapper */
.wpmsl-toggle-control {
    flex-shrink: 0;
}

/* Hide the actual checkbox */
.wpmsl-toggle-control input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Style the label as a toggle switch */
.wpmsl-switch-label {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: var(--am-gray-300);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wpmsl-switch-knob {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: block;
}

/* Checked state - GREEN */
.wpmsl-toggle-control input[type="checkbox"]:checked + .wpmsl-switch-label {
    background: var(--am-success);
}

.wpmsl-toggle-control input[type="checkbox"]:checked + .wpmsl-switch-label .wpmsl-switch-knob {
    transform: translateX(20px);
}

/* Focus state */
.wpmsl-toggle-control input[type="checkbox"]:focus + .wpmsl-switch-label {
    outline: 2px solid var(--am-brand-primary);
    outline-offset: 2px;
}

/* Toggle meta text */
.wpmsl-toggle-meta {
    flex: 1;
}

.wpmsl-toggle-title {
    display: block;
    font-size: 12px !important;
    font-weight: 600;
    color: var(--am-gray-900);
    margin: 0 0 4px;
    line-height: 1.4;
}

.wpmsl-toggle-desc {
    display: block;
    font-size: 12px !important;
    font-weight: 400;
    color: var(--am-gray-600);
    line-height: 1.5;
    margin: 0;
}

/* Mailer description and CTA row */
.wpmsl-mailer-description {
    margin-bottom: 16px;
    color: var(--am-gray-600);
    line-height: 1.6;
}

.wpmsl-mailer-description p {
    font-size: 14px !important;
    font-weight: bold;
}

.wpmsl-mailer-cta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--am-gray-200);
    flex-wrap: wrap;
}

.wpmsl-mailer-help-link {
    font-size: 12px !important;
    color: var(--am-brand-primary);
    text-decoration: none;
}

.wpmsl-mailer-help-link:hover {
    text-decoration: underline;
}

/* Card Actions (button container) */
.wpmsl-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--am-gray-200);
    flex-wrap: wrap;
}

.wpmsl-actions-left {
    display: flex;
    gap: 12px;
}

.wpmsl-actions-right {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

@media (max-width: 600px) {
    .wpmsl-card-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wpmsl-actions-left,
    .wpmsl-actions-right {
        width: 100%;
        margin-left: 0;
    }

    .wpmsl-actions-right {
        order: -1;
    }
}

.wpmsl-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px !important;
    font-weight: 600;
    color: var(--am-gray-700);
}

.wpmsl-field-label.required::after {
    content: ' *';
    color: var(--am-danger);
}

.wpmsl-field-input,
.wpmsl-field-select,
.wpmsl-field-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px !important;
    border: 1px solid var(--am-gray-300);
    border-radius: var(--am-radius-sm);
    background: #fff;
    color: var(--am-gray-900);
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.wpmsl-field-input:focus,
.wpmsl-field-select:focus,
.wpmsl-field-textarea:focus {
    outline: none;
    border-color: var(--am-brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wpmsl-field-input::placeholder {
    color: var(--am-gray-400);
}

.wpmsl-field-textarea {
    min-height: 100px;
    resize: vertical;
}

.wpmsl-btn-primary,
.wpmsl-btn-secondary,
.wpmsl-btn-text,
.wpmsl-btn-success,
.wpmsl-btn-danger,
.authority-mailer-save,
.wpmsl-prev,
.wpmsl-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1.3;
    border-radius: var(--am-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    box-sizing: border-box;
    font-family: inherit;
    white-space: nowrap;
}

.wpmsl-btn svg,
.wpmsl-btn-primary svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Primary button */
.wpmsl-btn-primary,
.authority-mailer-save {
    background: var(--am-brand-primary);
    color: #fff;
    box-shadow: var(--am-shadow-sm);
}

.wpmsl-btn-primary:hover,
.authority-mailer-save:hover {
    background: var(--am-brand-primary-dark);
    color: #fff;
    box-shadow: var(--am-shadow);
    transform: translateY(-1px);
}

.wpmsl-btn-primary:active,
.authority-mailer-save:active {
    transform: translateY(0);
}

/* Secondary button */
.wpmsl-btn-secondary,
.wpmsl-prev {
    background: var(--am-gray-100);
    color: var(--am-gray-700);
    border: 1px solid var(--am-gray-300);
}

.wpmsl-btn-secondary:hover,
.wpmsl-prev:hover {
    background: var(--am-gray-200);
    border-color: var(--am-gray-400);
    color: var(--am-gray-900);
}

/* Text/Ghost button */
.wpmsl-btn-text {
    background: transparent;
    color: var(--am-gray-600);
    padding: 8px 16px;
}

.wpmsl-btn-text:hover {
    background: var(--am-gray-100);
    color: var(--am-gray-900);
}

/* Success button */
.wpmsl-btn-success {
    background: var(--am-success);
    color: #fff;
    box-shadow: var(--am-shadow-sm);
}

.wpmsl-btn-success:hover {
    background: var(--am-success-dark);
    color: #fff;
    box-shadow: var(--am-shadow);
}

/* Danger button */
.wpmsl-btn-danger {
    background: var(--am-danger);
    color: #fff;
}

.wpmsl-btn-danger:hover {
    background: var(--am-danger-dark);
    color: #fff;
}

/* Disabled state */
.wpmsl-btn:disabled,
.wpmsl-btn.disabled,
.wpmsl-btn-primary:disabled,
.authority-mailer-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading state */
.wpmsl-btn.loading,
.wpmsl-btn-primary.loading,
.authority-mailer-save.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.wpmsl-btn.loading::after,
.wpmsl-btn-primary.loading::after,
.authority-mailer-save.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    left: 50%;
    top: 50%;
    margin-left: -8px;
    margin-top: -8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button group */
.wpmsl-btn-group {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--am-gray-200);
}

.wpmsl-btn-group-left {
    justify-content: flex-start;
}

.wpmsl-btn-group-center {
    justify-content: center;
}

.wpmsl-btn-group-between {
    justify-content: space-between;
}

@media (max-width: 600px) {
    .wpmsl-btn-group {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wpmsl-btn-group .wpmsl-btn {
        width: 100%;
    }
}

/* ==========================================================================
   Alert/Notice Components
   ========================================================================== */

.wpmsl-alert {
    padding: 14px 18px;
    border-radius: var(--am-radius);
    margin-bottom: 20px;
    font-size: 12px !important;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wpmsl-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.wpmsl-alert-success {
    background: var(--am-success-light);
    color: var(--am-success-dark);
    border: 1px solid var(--am-success);
}

.wpmsl-alert-success svg {
    color: var(--am-success);
}

.wpmsl-alert-error {
    background: var(--am-danger-light);
    color: var(--am-danger-dark);
    border: 1px solid var(--am-danger);
}

.wpmsl-alert-error svg {
    color: var(--am-danger);
}

.wpmsl-alert-warning {
    background: var(--am-warning-light);
    color: var(--am-warning-dark);
    border: 1px solid var(--am-warning);
}

.wpmsl-alert-warning svg {
    color: var(--am-warning);
}

.wpmsl-alert-info {
    background: var(--am-brand-primary-light);
    color: var(--am-brand-primary-dark);
    border: 1px solid var(--am-brand-primary);
}

.wpmsl-alert-info svg {
    color: var(--am-brand-primary);
}

/* ==========================================================================
   Test Email Section
   ========================================================================== */

.wpmsl-test-section {
    background: var(--am-gray-50);
    border: 1px solid var(--am-gray-200);
    border-radius: var(--am-radius-lg);
    padding: 24px;
    margin-top: 24px;
}

.wpmsl-test-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--am-gray-900);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpmsl-test-heading svg {
    width: 20px;
    height: 20px;
    color: var(--am-brand-primary);
}

.wpmsl-test-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.wpmsl-test-form .wpmsl-field-row {
    flex: 1 1 auto;
    margin-bottom: 0;
    min-width: 250px;
}

.wpmsl-test-form .wpmsl-btn {
    flex-shrink: 0;
}

/* Inline test email form in step 3 (the div with inline styles) */
.wpmsl-card > div[style*="display:flex"] {
    max-width: 100%;
    margin-top: 20px;
}

.wpmsl-card > div[style*="display:flex"] label {
    flex-shrink: 0;
}

.wpmsl-card > div[style*="display:flex"] input[type="email"] {
    flex: 1 1 auto;
    max-width: 350px;
}

.wpmsl-card > div[style*="display:flex"] button {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .wpmsl-test-form {
        flex-direction: column;
        align-items: stretch;
    }

    .wpmsl-test-form .wpmsl-field-row {
        width: 100%;
    }

    .wpmsl-card > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .wpmsl-card > div[style*="display:flex"] input[type="email"] {
        max-width: 100%;
        width: 100%;
    }

    .wpmsl-card > div[style*="display:flex"] button {
        width: 100%;
    }
}

/* Test log textarea */
.wpmsl-config-test-area {
    margin-top: 20px;
}

.wpmsl-config-test-log {
    width: 100%;
    max-width: 100%;
    height: 220px;
    padding: 12px;
    box-sizing: border-box;
    font-family: var(--am-font-mono);
    font-size: 12px !important;
    line-height: 1.5;
    border: 1px solid var(--am-gray-300);
    border-radius: var(--am-radius-sm);
    background: var(--am-gray-900);
    color: #10B981;
    resize: vertical;
}

/* ==========================================================================
   Email Log Section
   ========================================================================== */

.wpmsl-email-log {
    margin-top: 32px;
}

.wpmsl-email-log-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--am-gray-900);
    margin: 0 0 16px;
}

.wpmsl-email-log-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--am-gray-500);
}

.wpmsl-email-log-empty svg {
    width: 48px;
    height: 48px;
    color: var(--am-gray-300);
    margin-bottom: 16px;
}

/* ==========================================================================
   Welcome Step
   ========================================================================== */

.wpmsl-welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.wpmsl-welcome-feature {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--am-gray-50);
    border: 1px solid var(--am-gray-200);
    border-radius: var(--am-radius-lg);
    transition: all 0.2s ease;
}

.wpmsl-welcome-feature:hover {
    background: #fff;
    box-shadow: var(--am-shadow-sm);
    transform: translateY(-2px);
}

.wpmsl-welcome-feature-icon {
    width: 48px;
    height: 48px;
    background: var(--am-brand-primary-light);
    border-radius: var(--am-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpmsl-welcome-feature-icon svg {
    width: 20px;
    height: 20px;
    color: var(--am-brand-primary);
}

.wpmsl-welcome-feature-title {
    font-size: 12px !important;
    font-weight: 600;
    color: var(--am-gray-900);
    margin: 0 0 4px;
}

.wpmsl-welcome-feature-text {
    font-size: 12px !important;
    color: var(--am-gray-500);
    margin: 0;
    line-height: 1.5;
}

.wpmsl-center {
    text-align: center;
}

.wpmsl-welcome-actions {
    margin-top: 32px;
}

/* ==========================================================================
   SIDEBAR COMPONENT - STICKY ON DESKTOP
   ========================================================================== */

.authority-mailer-wizard-sidebar {
    display: block !important; /* Force visibility as per requirements */
    visibility: visible !important;
    opacity: 1 !important;
}

/* Desktop: sticky sidebar */
@media (min-width: 1024px) {
    .authority-mailer-wizard-sidebar {
        top: 32px;
        align-self: start;
        width: 340px;
        z-index: 10;
    }
}

/* Tablet: static sidebar below main content */
@media (min-width: 768px) and (max-width: 1023px) {
    .authority-mailer-wizard-sidebar {
        position: static;
        width: 100%;
        margin-top: 24px;
    }
}

/* Mobile: static sidebar below main content */
@media (max-width: 767px) {
    .authority-mailer-wizard-sidebar {
        position: static;
        width: 100%;
        margin-top: 24px;
    }
}

/* ==========================================================================
   PRO Upgrade Card Styles
   ========================================================================== */

.am-card {
    background: #fff;
    border: 1px solid var(--am-gray-200);
    border-radius: var(--am-radius-lg);
    box-shadow: var(--am-shadow-xs);
    overflow: hidden;
}

.am-card-body {
    padding: 24px;
}

/* ==========================================================================
   Gmail Right Panel
   ========================================================================== */

.wpmsl-gmail-right {
    min-width: 260px;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wpmsl-step {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.wpmsl-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .wpmsl-onboarding-wrap {
        border-radius: var(--am-radius);
    }
}

@media (max-width: 600px) {
    .wpmsl-card {
        padding: 20px 16px;
    }

    .wpmsl-card-heading {
        font-size: 20px;
    }

    .wpmsl-onboarding-hero h1 {
        font-size: 24px;
    }

    .wpmsl-simple-stepper .step .label {
        font-size: 12px !important;
    }

    .wpmsl-simple-stepper .step .dot {
        width: 40px;
        height: 40px;
        font-size: 12px !important;
    }

    .wpmsl-simple-stepper .step .dot svg {
        width: 18px;
        height: 18px;
    }
}


/**
 * Improved SendLayer Settings UI Styles
 *
 * Features:
 * - Modern, clean design
 * - Better visual hierarchy
 * - Improved accessibility
 * - Smooth animations
 * - Responsive layout
 * - Clear information architecture
 */

/* ==========================================================================
   Base Container
   ========================================================================== */

.wpmsl-mailer-settings--improved {
  max-width: 1200px;
  margin: 0 auto;
}

/* ==========================================================================
   Info Banner
   ========================================================================== */

.wpmsl-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f0f6ff;
  border-left: 4px solid #4361ee;
  border-radius: 4px;
  margin-bottom: 24px;
}

.wpmsl-info-banner .wpmsl-info-icon {
  flex-shrink: 0;
  color: #4361ee;
  margin-top: 2px;
}

.wpmsl-info-banner .wpmsl-info-content {
  flex: 1;
  color: #1e293b;
}

.wpmsl-info-banner .wpmsl-info-content p {
  margin: 0;
  line-height: 1.6;
}

/* ==========================================================================
   CTA Row Enhancement
   ========================================================================== */

.wpmsl-mailer-cta-row--enhanced {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.wpmsl-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #4361ee 0%, #3730a3 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(67, 97, 238, 0.2);
}

.wpmsl-btn-primary:hover {
  background: linear-gradient(135deg, #3730a3 0%, #312e81 100%);
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
  transform: translateY(-1px);
  color: #ffffff;
}

.wpmsl-btn-primary:active {
  transform: translateY(0);
}

.wpmsl-btn-primary:focus {
  outline: none;
}

.wpmsl-btn-primary .wpmsl-btn-icon,
.wpmsl-btn-primary .wpmsl-btn-arrow {
  flex-shrink: 0;
}

.wpmsl-btn-primary .wpmsl-btn-arrow {
  transition: transform 0.2s ease;
}

.wpmsl-btn-primary:hover .wpmsl-btn-arrow {
  transform: translateX(3px);
}

.wpmsl-mailer-help-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  text-decoration: none;
  font-size: 12px !important;
  transition: color 0.2s ease;
}

.wpmsl-mailer-help-link:hover {
  color: #4361ee;
}

.wpmsl-mailer-help-link .wpmsl-help-icon {
  flex-shrink: 0;
}

/* ==========================================================================
   Form Sections
   ========================================================================== */

.wpmsl-settings-section {
  margin-bottom: 32px;
}

.wpmsl-section-header {
  margin-bottom: 20px;
}

.wpmsl-section-subheading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.wpmsl-section-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #4361ee;
}

.wpmsl-section-description {
  margin: 0;
  color: #64748b;
  font-size: 12px !important;
  line-height: 1.6;
}

/* ==========================================================================
   Form Rows
   ========================================================================== */

.wpmsl-form-row {
  margin-bottom: 24px;
}

.wpmsl-form-row:last-child {
  margin-bottom: 0;
}

.wpmsl-form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 12px !important;
  color: #334155;
}

.wpmsl-label-required {
  color: #dc2626;
  font-weight: 600;
}

.wpmsl-form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px !important;
  color: #1e293b;
  background: #ffffff;
  transition: all 0.2s ease;
}

.wpmsl-form-input:hover {
  border-color: #94a3b8;
}

.wpmsl-form-input:focus {
  outline: none;
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.wpmsl-form-input::placeholder {
  color: #94a3b8;
}

.wpmsl-form-input:required:invalid {
  border-color: #cbd5e1;
}

.wpmsl-form-input:required:valid {
  border-color: #10b981;
}

/* Input Group (for password field with toggle) */
.wpmsl-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.wpmsl-input-group .wpmsl-form-input {
  padding-right: 48px;
}

.wpmsl-input-toggle-visibility {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.wpmsl-input-toggle-visibility:hover {
  background: #f1f5f9;
  color: #4361ee;
}

.wpmsl-input-toggle-visibility:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

/* Field Help Text */
.wpmsl-field-help {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 0 0;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 4px;
  font-size: 12px !important;
  line-height: 1.5;
  color: #64748b;
}

.wpmsl-field-help .wpmsl-help-inline-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: #94a3b8;
}

.wpmsl-field-help--with-link a {
  color: #4361ee;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.wpmsl-field-help--with-link a:hover {
  color: #3730a3;
  text-decoration: underline;
}

.wpmsl-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.wpmsl-inline-link svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Section Divider
   ========================================================================== */

.wpmsl-section-divider {
  height: 1px;
  background: linear-gradient(to right, #e2e8f0, transparent);
  margin: 32px 0;
}

/* ==========================================================================
   Toggle Blocks
   ========================================================================== */

.wpmsl-toggle-block {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.wpmsl-toggle-block:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wpmsl-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.wpmsl-toggle-control {
  flex-shrink: 0;
}

.wpmsl-toggle-meta {
  flex: 1;
}

.wpmsl-toggle-title {
  display: block;
  margin: 0 0 6px 0;
  font-size: 12px !important;
  font-weight: 600;
  color: #1e293b;
}

.wpmsl-toggle-row .wpmsl-form-help {
  margin: 0;
  padding: 0;
  background: transparent;
  font-size: 12px !important;
  line-height: 1.5;
  color: #64748b;
}

.wpmsl-form-help {
  font-size: 12px !important;
}

/* Switch Toggle Styling */
.wpmsl-toggle-control input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.wpmsl-switch-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.wpmsl-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wpmsl-toggle-control input[type="checkbox"]:checked + .wpmsl-switch-label {
  background: #10b981;
}

.wpmsl-toggle-control input[type="checkbox"]:checked + .wpmsl-switch-label .wpmsl-switch-knob {
  transform: translateX(20px);
}

.wpmsl-toggle-control input[type="checkbox"]:focus + .wpmsl-switch-label {
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* ==========================================================================
   Sidebar Help & Tips
   ========================================================================== */

.wpmsl-sidebar-help,
.wpmsl-sidebar-tip {
  margin-top: 24px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.wpmsl-sidebar-help-header,
.wpmsl-sidebar-tip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #334155;
}

.wpmsl-sidebar-help-header svg,
.wpmsl-sidebar-tip-header svg {
  flex-shrink: 0;
  color: #4361ee;
}

.wpmsl-sidebar-help-header strong,
.wpmsl-sidebar-tip-header strong {
  font-size: 12px !important;
  font-weight: 600;
}

.wpmsl-sidebar-help-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wpmsl-sidebar-help-list li {
  margin-bottom: 8px;
}

.wpmsl-sidebar-help-list li:last-child {
  margin-bottom: 0;
}

.wpmsl-sidebar-help-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #475569;
  text-decoration: none;
  font-size: 12px !important;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.wpmsl-sidebar-help-list a:hover {
  background: #ffffff;
  color: #4361ee;
  transform: translateX(2px);
}

.wpmsl-sidebar-help-list a svg {
  flex-shrink: 0;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.wpmsl-sidebar-help-list a:hover svg {
  color: #4361ee;
}

.wpmsl-sidebar-tip {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fbbf24;
}

.wpmsl-sidebar-tip-header svg {
  color: #f59e0b;
}

.wpmsl-sidebar-tip-content {
  margin: 0;
  font-size: 12px !important;
  line-height: 1.6;
  color: #78350f;
}

/* ==========================================================================
   Form Status Messages
   ========================================================================== */

.wpmsl-form-status {
  margin-top: 24px;
  padding: 16px;
  border-radius: 6px;
  font-size: 12px !important;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wpmsl-form-status--success {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.wpmsl-form-status--error {
  background: #fee2e2;
  border: 1px solid #dc2626;
  color: #991b1b;
}

.wpmsl-form-status--warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #78350f;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 782px) {
  .wpmsl-form-grid--split {
    flex-direction: column;
  }

  .wpmsl-vertical-divider {
    display: none;
  }

  .wpmsl-form-col--main,
  .wpmsl-form-col--toggles {
    width: 100%;
  }

  .wpmsl-mailer-cta-row--enhanced {
    flex-direction: column;
    align-items: stretch;
  }

  .wpmsl-btn-primary {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .wpmsl-info-banner {
    flex-direction: column;
  }

  .wpmsl-section-subheading {
    font-size: 16px;
  }

  .wpmsl-field-help {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
}

/* Primary button gets custom focus treatment */
.wpmsl-btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3), 0 0 0 4px rgba(67, 97, 238, 0.2);
}

/* Remove focus outline on mouse click (but keep for keyboard navigation) */
.wpmsl-btn-primary:focus:not(:focus-visible) {
  outline: none;
}

/* Add custom focus style for buttons */
button:focus-visible {
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .wpmsl-form-input {
    border-width: 2px;
  }

  .wpmsl-btn-primary {
    border: 2px solid #ffffff;
  }

  .wpmsl-toggle-block {
    border-width: 2px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .wpmsl-mailer-settings--improved {
    color: #e2e8f0;
  }

  .wpmsl-info-banner {
    background: #1e293b;
    border-color: #4361ee;
  }

  .wpmsl-form-input {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
  }

  .wpmsl-toggle-block {
    background: #1e293b;
    border-color: #475569;
  }

  .wpmsl-section-subheading,
  .wpmsl-form-label {
    color: #f1f5f9;
  }

  .wpmsl-section-description,
  .wpmsl-field-help {
    color: #94a3b8;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .wpmsl-btn-primary,
  .wpmsl-mailer-help-link,
  .wpmsl-sidebar-help,
  .wpmsl-sidebar-tip {
    display: none;
  }

  .wpmsl-form-grid--split {
    display: block;
  }

  .wpmsl-vertical-divider {
    display: none;
  }

  .wpmsl-form-input {
    border: 1px solid #000;
  }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.wpmsl-form--loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.wpmsl-form--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #e2e8f0;
  border-top-color: #4361ee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hide header actions during onboarding wizard */
.am-header-actions {
  display: none !important;
}
