/* Typography Variables - SimplexTheme Compatible */
:root {
    /* --font-primary: Inherited from wigstheme.css (Montserrat) */
    --font-secondary: var(--font-default);

    /* SimplexTheme Font Sizes */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Spacing Variables for Consistent Layout */
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
}

/*!
 * B2B Registration Wizard Styles
 * Compatible with SimplexTheme and Bootstrap 3
 */

/* B2B Registration Wizard Container */
.b2b-registration-wizard {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: var(--space-8);
    margin-top: var(--space-6);
    position: relative;
    z-index: 1;
}

/* Tab Navigation Styling - Fixed for SimplexTheme */
.b2b-registration-wizard .nav-tabs {
    border-bottom: 2px solid #e7e7e7;
    background: #f8f9fa;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 10;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-around;
}

.b2b-registration-wizard .nav-tabs > li {
    flex: 1;
    margin-bottom: 0;
    border-bottom: none;
    display: flex;
    justify-content: center;
}

.b2b-registration-wizard .nav-tabs > li > a {
    font-family: var(--font-default);
    color: #666;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 15px 20px;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    width: 100%;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: var(--text-base);
    line-height: 1.5;
}

.b2b-registration-wizard .nav-tabs > li > a:hover,
.b2b-registration-wizard .nav-tabs > li > a:focus {
    background: rgba(140, 59, 74, 0.1);
    color: var(--red, #8c3b4a);
    border: none;
}

.b2b-registration-wizard .nav-tabs > li.active > a,
.b2b-registration-wizard .nav-tabs > li.active > a:hover,
.b2b-registration-wizard .nav-tabs > li.active > a:focus {
    color: var(--red, #8c3b4a);
    background: #fff;
    border: none;
    border-bottom: 3px solid var(--red, #8c3b4a);
}

.b2b-registration-wizard .nav-tabs > li.disabled > a {
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.b2b-registration-wizard .nav-tabs > li.disabled > a:hover {
    background: transparent;
    color: #ccc;
}

/* Tab Number and Title */
.tab-number {
    background: var(--red, #8c3b4a);
    color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-tabs > li.disabled .tab-number {
    background: #ccc;
}

.nav-tabs > li.active .tab-number,
.nav-tabs > li .tab-number.current {
    background: var(--red, #8c3b4a);
    transform: scale(1.05);
    box-shadow: 0 1px 3px rgba(140, 59, 74, 0.2);
}

.nav-tabs > li .tab-number.completed {
    background: #28a745;
    color: #fff;
}

.nav-tabs > li .tab-number.completed::after {
    content: "\2713";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}

.tab-title {
    font-family: var(--font-default);
    font-weight: 600;
    font-size: var(--text-md);
    line-height: 1.25;
    letter-spacing: 0;
}

/* Tab Content - Enhanced spacing */
.b2b-registration-wizard .tab-content {
    background: #fff;
    padding: 0;
    position: relative;
    z-index: 5;
    margin-top: 0;
    border-top: 1px solid #e7e7e7;
}

.b2b-registration-wizard .tab-pane {
    padding: var(--space-8) var(--space-10);
    min-height: 1100px;
    position: relative;
    z-index: 1;
    background: #fff;
}

/* Fieldset Headers - Fixed overlap with tabs */
.fieldset-header {
    margin-bottom: var(--space-6);
    margin-top: 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: var(--space-4);
    padding-top: var(--space-2);
    position: relative;
    z-index: 1;
}

.fieldset-header h3 {
    font-family: var(--font-default);
    color: var(--grey-black, #333);
    margin: 0 0 12px 0;
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.25;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.fieldset-header .help-text {
    font-family: var(--font-default);
    color: #666;
    font-size: var(--text-base);
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* Form Groups */
.b2b-registration-wizard .form-group {
    margin-bottom: var(--space-5);
}

.b2b-registration-wizard .form-control {
    font-family: var(--font-default);
    border: 1px solid #e7e7e7;
    border-radius: 3px;
    padding: 8px 12px;
    font-size: var(--text-base);
    line-height: 1.5;
    transition: border-color 0.2s ease;
    height: 34px;
    font-weight: 400;
    color: #333;
    box-sizing: border-box;
}

.b2b-registration-wizard .form-control:focus {
    border-color: var(--grey-black, #333);
    box-shadow: 0 0 0 1px rgba(140, 59, 74, 0.08);
    outline: none;
}

.b2b-registration-wizard .input-validation-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* Ensure consistent sizing for all input types */
.b2b-registration-wizard input[type="text"],
.b2b-registration-wizard input[type="email"],
.b2b-registration-wizard input[type="password"],
.b2b-registration-wizard input[type="tel"],
.b2b-registration-wizard select,
.b2b-registration-wizard textarea {
    height: 34px;
    padding: 8px 12px;
    font-size: var(--text-base);
    line-height: 1.5;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    box-sizing: border-box;
}

.b2b-registration-wizard textarea {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

/* Labels */
.b2b-registration-wizard .control-label {
    font-family: var(--font-default);
    font-weight: 600;
    color: var(--grey-black, #333);
    margin-bottom: 8px;
    font-size: var(--text-base);
    line-height: 1.5;
    letter-spacing: 0;
}

/* Required Field Indicators - Position to right of labels */
.b2b-registration-wizard .form-title-required {
    font-family: var(--font-default);
    color: var(--red, #8c3b4a);
    font-size: var(--text-sm);
    font-weight: 400;
    display: inline;
    white-space: nowrap;
    line-height: 1.4;
    margin-left: 5px;
}

/* Only add asterisk to labels for required fields */
.b2b-registration-wizard .form-group:has(.form-title-required) .control-label::after {
    content: "*";
    color: var(--red, #8c3b4a);
    font-size: var(--text-sm);
    font-weight: 400;
    margin-left: 5px;
    display: inline;
}

/* Alternative approach for better browser support - show asterisk for specific required fields */
.b2b-registration-wizard label[for="Email"]::after,
.b2b-registration-wizard label[for="ConfirmEmail"]::after,
.b2b-registration-wizard label[for="Username"]::after,
.b2b-registration-wizard label[for="Password"]::after,
.b2b-registration-wizard label[for="ConfirmPassword"]::after,
.b2b-registration-wizard label[for="Company"]::after,
.b2b-registration-wizard label[for="Attention"]::after,
.b2b-registration-wizard label[for="ContactName"]::after,
.b2b-registration-wizard label[for="SellerPermitId"]::after,
.b2b-registration-wizard label[for="CountryId"]::after,
.b2b-registration-wizard label[for="StreetAddress"]::after,
.b2b-registration-wizard label[for="City"]::after,
.b2b-registration-wizard label[for="StateProvinceId"]::after,
.b2b-registration-wizard label[for="ZipPostalCode"]::after,
.b2b-registration-wizard label[for="Phone"]::after {
    content: "*";
    color: var(--red, #8c3b4a);
    font-size: var(--text-sm);
    font-weight: 400;
    margin-left: 5px;
    display: inline;
}

/* Hide ALL original required field indicators since we're using ::after */
.b2b-registration-wizard .form-title-required,
.b2b-registration-wizard .visible-lg.form-title-required,
.b2b-registration-wizard .visible-md.form-title-required,
.b2b-registration-wizard .visible-sm.form-title-required,
.b2b-registration-wizard .visible-xs.form-title-required {
    display: none !important;
}

/* Also hide any <span class="required">*</span> elements */
.b2b-registration-wizard .required,
.b2b-registration-wizard span.required {
    display: none !important;
}

/* Remove duplicate asterisk - nopCommerce already provides it via nop-required tag helper */

/* Fix spacing around required indicators */
.b2b-registration-wizard .visible-xs.form-title-required,
.b2b-registration-wizard .visible-lg.form-title-required,
.b2b-registration-wizard .visible-md.form-title-required,
.b2b-registration-wizard .visible-sm.form-title-required {
    margin: 5px 0;
    padding: 2px 5px;
}

/* Validation Messages - Display under field, not on right side */
.b2b-registration-wizard .field-validation-error {
    color: #dc3545;
    font-size: var(--text-xs);
    margin-top: 5px;
    display: block;
    width: 100%;
    max-width: none;
    clear: both;
    text-align: left;
    font-family: var(--font-default);
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Override Bootstrap form layout to move validation messages under inputs */
.b2b-registration-wizard .form-group {
    position: relative;
}

/* Reposition validation messages from right column to below input */
.b2b-registration-wizard .form-group .col-sm-3:last-child {
    position: absolute;
    left: 25%; /* Start after the label column (col-sm-3 = 25%) */
    top: 100%;
    width: 75%; /* Take remaining width */
    margin-top: 5px;
    padding-left: 15px; /* Bootstrap column padding */
}

/* Exception: File upload validation messages need different positioning */
.b2b-registration-wizard .form-group:has([id="seller-permit-file"]) .col-sm-3:last-child,
.b2b-registration-wizard #seller-permit-file ~ .col-sm-3 {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    margin-top: 20px !important;
    padding-left: 0 !important;
    clear: both;
    z-index: 10;
}

/* Hide the required field indicators in the repositioned column */
.b2b-registration-wizard .form-group .col-sm-3:last-child .form-title-required {
    display: none;
}

.b2b-registration-wizard .field-validation-valid {
    display: none;
}

/* Standard File Upload Styling (Admin-like) */
.file-upload-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.file-upload-wrapper input[type="file"] {
    width: 100%;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-default);
    font-size: 14px;
    color: #333;
    display: block;
    box-sizing: border-box;
    height: auto;
    text-indent: 0;
    overflow: visible;
}

.file-upload-wrapper input[type="file"]:hover {
    border-color: var(--red, #8c3b4a);
    background: rgba(140, 59, 74, 0.05);
    color: var(--red, #8c3b4a);
}

.file-upload-wrapper input[type="file"]:focus {
    border-color: var(--red, #8c3b4a);
    background: rgba(140, 59, 74, 0.08);
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 59, 74, 0.1);
}

/* Help text styling */
.file-upload-wrapper .help-block {
    margin-top: 8px;
    color: #6b7280;
    font-size: var(--text-xs);
    font-family: var(--font-default);
    line-height: 1.4;
}


/* Address Sections */
.address-section {
    margin-bottom: var(--space-10);
    padding: var(--space-6);
    background: #fafafa;
    border-radius: 4px;
    border-left: 2px solid var(--red, #8c3b4a);
}

.address-section h4 {
    font-family: var(--font-default);
    color: var(--grey-black, #333);
    margin: 0 0 var(--space-5) 0;
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.25;
}

.address-section .help-text {
    color: #666;
    font-size: 13px;
    margin-bottom: 15px;
    font-style: italic;
}

/* Checkbox Styling */
.b2b-registration-wizard .checkbox {
    margin-top: 0;
    margin-bottom: 0;
}

.b2b-registration-wizard .checkbox label {
    font-weight: 500;
    color: var(--grey-black, #333);
    cursor: pointer;
    padding-left: 25px;
    position: relative;
}

.b2b-registration-wizard .checkbox input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 3px;
    margin: 0;
    transform: scale(1.2);
}

/* Wizard Buttons - Updated to match screenshot */
.wizard-buttons {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e7e7e7;
    text-align: right;
}

.wizard-buttons .btn {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    margin-left: 10px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    min-width: 120px;
}

/* Next/Continue button: shop accent (SAB001 primary buttons are rose, white text 7.4:1) */
.wizard-buttons .btn-primary {
    background: var(--red, #8c3b4a);
    border-color: var(--red, #8c3b4a);
    color: #fff;
}

.wizard-buttons .btn-primary:hover,
.wizard-buttons .btn-primary:focus {
    background: var(--dark-red, #6e2a39);
    border-color: var(--dark-red, #6e2a39);
    color: #fff;
}

/* Previous button styling */
.wizard-buttons .btn-default {
    background: #fff;
    border-color: #d1d5db;
    color: #6B7280;
}

.wizard-buttons .btn-default:hover,
.wizard-buttons .btn-default:focus {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.wizard-buttons .fa {
    margin: 0 5px;
}

/* Additional Sections Styling */
.newsletter-section,
.captcha-section,
.privacy-section {
    background: #fafafa;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.privacy-section h4 {
    color: var(--grey-black, #333);
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
}

.accept-privacy-policy,
.accept-consent {
    margin-bottom: 15px;
}

.accept-privacy-policy label,
.accept-consent label {
    font-weight: 500;
    color: var(--grey-black, #333);
    cursor: pointer;
    padding-left: 25px;
    position: relative;
}

.accept-privacy-policy input[type="checkbox"],
.accept-consent input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 3px;
    margin: 0;
    transform: scale(1.2);
}

.read {
    color: var(--red, #8c3b4a);
    text-decoration: underline;
    cursor: pointer;
    margin-left: 10px;
}

.read:hover {
    color: var(--dark-red, #6e2a39);
}

/* Responsive Design - Desktop 1200px and below */
@media (max-width: 1200px) {
    /* Fix tab navigation for desktop breakpoint */
    .b2b-registration-wizard .nav-tabs {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .b2b-registration-wizard .nav-tabs > li {
        flex: 1;
        min-width: 200px;
        text-align: center;
    }

    .b2b-registration-wizard .nav-tabs > li > a {
        padding: 15px 10px;
        min-height: 60px;
        justify-content: center;
        text-align: center;
    }

    /* Fix fieldset header spacing */
    .fieldset-header {
        margin-bottom: 25px;
        padding-bottom: 12px;
    }

    .fieldset-header h3 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    /* Adjust tab content padding */
    .b2b-registration-wizard .tab-pane {
        padding: 25px 20px;
        min-height: 800px; /* Increased for medium screens with Company tab content */
    }

    /* Fix text overlap issues */
    .fieldset-header {
        clear: both;
        margin-top: 10px;
    }

    /* Ensure proper spacing for tab navigation */
    .b2b-registration-wizard .tab-content {
        margin-top: 15px;
        clear: both;
    }

    /* Prevent text overlap with tabs */
    .b2b-registration-wizard .nav-tabs + .tab-content {
        margin-top: 0;
        border-top: 1px solid #e7e7e7;
    }
}

/* Desktop responsive improvements for 992px-1200px range */
@media (max-width: 1200px) and (min-width: 993px) {
    .b2b-registration-wizard .nav-tabs > li > a {
        padding: 12px 8px;
        font-size: 14px;
    }

    .tab-title {
        font-size: 14px;
    }

    .tab-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
        margin-right: 8px;
    }

    /* Fix spacing at this breakpoint */
    .fieldset-header {
        margin-top: 5px;
    }

    .fieldset-header h3 {
        font-size: 20px;
    }
}

/* Medium desktop responsive (769px-992px) */
@media (max-width: 992px) and (min-width: 769px) {
    .b2b-registration-wizard .nav-tabs > li {
        flex: 1;
        min-width: 180px;
    }

    .b2b-registration-wizard .nav-tabs > li > a {
        padding: 10px 6px;
        font-size: 13px;
        min-height: 55px;
    }

    .tab-title {
        font-size: 13px;
    }

    .tab-number {
        width: 26px;
        height: 26px;
        font-size: 12px;
        margin-right: 6px;
    }

    .fieldset-header h3 {
        font-size: 20px;
    }

    .b2b-registration-wizard .tab-pane {
        padding: 20px 15px;
        min-height: 750px; /* Increased for tablet screens to accommodate Company tab */
    }
}

/* Mobile responsive design - 768px and below */
@media (max-width: 768px) {
    /* Mobile fixes for page title and tabs */
    .registration-page .page-title.panel-heading h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    /* Override desktop layout for true mobile */
    .b2b-registration-wizard .nav-tabs {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
        flex-wrap: nowrap !important;
    }

    /* Fix tab pane positioning on mobile */
    .b2b-registration-wizard .tab-pane {
        position: relative;
        transform: none;
    }

    .b2b-registration-wizard .nav-tabs > li {
        float: none;
        width: 100% !important;
        display: block;
        margin-bottom: 0;
        flex: none !important;
        min-width: auto !important;
    }

    .b2b-registration-wizard .nav-tabs > li > a {
        padding: 15px 20px;
        text-align: center;
        justify-content: center;
        min-height: 60px;
        display: flex;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    .tab-title {
        font-size: 14px;
    }

    .b2b-registration-wizard .tab-pane {
        padding: 20px 15px;
        min-height: 700px; /* Increased for mobile screens to accommodate Company tab */
    }

    .fieldset-header h3 {
        font-size: 20px;
    }

    .address-section {
        padding: 20px 15px;
    }

    .wizard-buttons {
        text-align: center;
    }

    .wizard-buttons .btn {
        width: 100%;
        margin: 5px 0;
    }

    /* Stack form labels and inputs on mobile */
    .b2b-registration-wizard .form-horizontal .control-label {
        text-align: left;
        margin-bottom: 8px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .b2b-registration-wizard .nav-tabs {
        flex-direction: column !important;
    }

    .b2b-registration-wizard .nav-tabs > li {
        width: 100% !important;
        display: block;
        float: none;
        flex: none !important;
        min-width: auto !important;
    }

    .tab-number {
        width: 25px;
        height: 25px;
        font-size: 12px;
        margin-right: 8px;
    }

    .tab-title {
        font-size: 13px;
    }

    .b2b-registration-wizard .nav-tabs > li > a {
        padding: 12px 15px;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .b2b-registration-wizard .form-control {
        border-width: 1px;
    }

    .b2b-registration-wizard .form-control:focus {
        box-shadow: 0 0 0 1px rgba(140, 59, 74, 0.2);
    }
}

/* Prevent horizontal overflow on narrow screens */
@media (max-width: 1200px) {
    .b2b-registration-wizard {
        overflow-x: hidden;
    }

    .b2b-registration-wizard .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .b2b-registration-wizard .nav-tabs::-webkit-scrollbar {
        height: 3px;
    }

    .b2b-registration-wizard .nav-tabs::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .b2b-registration-wizard .nav-tabs::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }
}

/* Animation for smooth transitions */
.b2b-registration-wizard .tab-pane {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.b2b-registration-wizard .tab-pane.active {
    opacity: 1;
}

/* Progress indicator styling */
.b2b-registration-wizard .nav-tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--red, #8c3b4a);
    transition: all 0.3s ease;
    width: 0;
}

.b2b-registration-wizard .nav-tabs > li:nth-child(1).active ~ ::after {
    width: 33.33%;
}

.b2b-registration-wizard .nav-tabs > li:nth-child(2).active ~ ::after {
    width: 66.66%;
}

.b2b-registration-wizard .nav-tabs > li:nth-child(3).active ~ ::after {
    width: 100%;
}

/* Focus styles for accessibility */
.b2b-registration-wizard .nav-tabs > li > a:focus {
    outline: 2px solid var(--red, #8c3b4a);
    outline-offset: 2px;
}

.b2b-registration-wizard .btn:focus {
    outline: 2px solid var(--red, #8c3b4a);
    outline-offset: 2px;
}

.b2b-registration-wizard .form-control:focus {
    outline: none;
}

/* Loading states */
.b2b-registration-wizard .please-wait {
    color: #666;
    font-style: italic;
    font-size: 12px;
}

/* Fix for SimplexTheme Integration - Page Title Separation */
.registration-page .page-title.panel-heading {
    margin-bottom: 20px;
    position: relative;
    z-index: 5;
}

.registration-page .page-title.panel-heading h1 {
    font-family: var(--font-default);
    color: var(--grey-black, #333);
    font-size: var(--text-3xl);
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.25;
}

.registration-page .page-title.panel-heading .subtitle {
    font-family: var(--font-default);
    color: #666;
    font-size: var(--text-md);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 10px;
    text-align: center;
    line-height: 1.5;
}

/* Enhanced Tab Interaction States */
.b2b-registration-wizard .nav-tabs > li.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.b2b-registration-wizard .nav-tabs > li:not(.disabled) > a {
    cursor: pointer;
}

.b2b-registration-wizard .nav-tabs > li:not(.disabled) > a:hover {
    background: rgba(140, 59, 74, 0.05);
    border-bottom: 3px solid rgba(140, 59, 74, 0.3);
}

/* Fix tab transition animations */
.b2b-registration-wizard .tab-pane {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateX(20px);
    min-height: 1100px !important; /* Force override for Company tab content */
}

.b2b-registration-wizard .tab-pane.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateX(0);
}

.b2b-registration-wizard .tab-content {
    position: relative;
    min-height: 1500px !important; /* Increased to accommodate Company tab content */
}

/* Error state for file upload */
#seller-permit-file-error.field-validation-error {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* Fix for seller permit file input truncation */
#seller-permit-file {
    width: 100%;
    height: 34px;
    padding: 8px 12px;
    margin-bottom: 20px;
    box-sizing: border-box;
    overflow: visible;
}

/* Ensure adequate bottom padding for Company tab */
.b2b-registration-wizard #company-tab {
    padding-bottom: 80px !important;
}

/* Add bottom margin to last form group in Company tab */
.b2b-registration-wizard #company-tab .form-group:last-child {
    margin-bottom: 40px;
}

/* Fix seller permit file validation message positioning */
.b2b-registration-wizard #seller-permit-file-error {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    padding: 8px 12px !important;
    padding-left: 0 !important;
    display: block;
    color: #dc3545;
    font-size: 12px;
    font-family: var(--font-default);
    font-weight: 400;
    line-height: 1.4;
    clear: both;
    z-index: 10;
    min-height: 20px;
    background: transparent;
}

/* Ensure the form group containing seller permit file has enough space */
.b2b-registration-wizard .form-group:has([id="seller-permit-file"]) {
    margin-bottom: 40px;
    padding-bottom: 15px;
    min-height: 120px; /* Ensure enough space for enhanced file upload + validation */
}

/* Alternative selector for better browser support */
.b2b-registration-wizard input#seller-permit-file {
    margin-bottom: 15px;
}

/* Fix validation message column positioning for file upload */
.b2b-registration-wizard .form-group:has([id="seller-permit-file"]) .col-sm-3:last-child {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    margin-top: 10px;
    padding-left: 0;
    clear: both;
}

/* Specific styling for file upload wrapper to accommodate validation message */
.b2b-registration-wizard .file-upload-wrapper {
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

/* Ensure help-block doesn't interfere with validation message */
.b2b-registration-wizard .file-upload-wrapper .help-block {
    margin-bottom: 10px;
}

/* Fix for z-index stacking issues */
.registration-page .page {
    position: relative;
    z-index: 1;
}

.b2b-registration-wizard {
    isolation: isolate; /* Create new stacking context */
}

/* Enhanced Visual Separation */
.b2b-registration-wizard .nav-tabs::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: #e7e7e7;
    z-index: 1;
}

/* Step Progress Indicator Enhancement */
.b2b-registration-wizard .nav-tabs::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 2px;
    background: var(--red, #8c3b4a);
    transition: all 0.3s ease;
    width: 33.33%; /* Default to first step */
    z-index: 15;
}

.b2b-registration-wizard .nav-tabs[data-current-step="2"]::after {
    width: 66.66%;
}

.b2b-registration-wizard .nav-tabs[data-current-step="3"]::after {
    width: 100%;
}

/* ===== MOBILE FIX (<=767px) =====
   The desktop wizard reserves a tall fixed min-height (1500px, set above) so the
   absolutely-stacked tabs fit the multi-column Company step. On a phone every step
   is a single column and the ACTIVE pane is in-flow (position:relative), so that
   reserve leaves a ~1000px empty gap below the form (the Account step is ~456px).
   Let the container size to its active step instead. Appended after the 1500px rule
   so it wins on equal specificity + !important without depending on file load order. */
@media (max-width: 767.98px) {
    /* Desktop stacks the wizard steps as absolutely-positioned panes and reserves a
       tall fixed height (.tab-content 1500px + .tab-pane 1100px) so the slide animation
       has room. On a phone that reserve leaves a ~1000px empty gap under step 1, and
       simply zeroing the min-heights collapses the container so steps 2/3 (still
       absolute) render on top of the footer. Fix on mobile by laying the steps out in
       NORMAL FLOW: only the active pane is shown (display:block, static), so the
       container always fits the current step. The slide transition is dropped on mobile
       (acceptable) in exchange for a correct, gap-free layout. */
    .b2b-registration-wizard .tab-content { min-height: 0 !important; }
    .b2b-registration-wizard .tab-pane {
        position: static !important; min-height: 0 !important;
        transform: none !important; transition: none !important;
    }
    .b2b-registration-wizard .tab-pane:not(.active) { display: none !important; }
    .b2b-registration-wizard .tab-pane.active {
        display: block !important; opacity: 1 !important; visibility: visible !important;
    }
}
/* ============================================================================
   MOBILE app-like registration (<=767px) — appended LAST so it wins the legacy
   mobile blocks above (which stack the 3 step-tabs vertically, ~150px of
   chrome). Best-practice pattern: ONE compact horizontal stepper row
   (numbered circles + small labels + connector line) and 44px form controls.
   ============================================================================ */
@media (max-width: 767.98px) {

    /* --- horizontal compact stepper ------------------------------------- */
    .b2b-registration-wizard .nav-tabs {
        flex-direction: row !important;
        align-items: flex-start;
        background: none;
        border-bottom: 1px solid #ececec;
        padding: 4px 0 10px;
    }
    .b2b-registration-wizard .nav-tabs > li {
        display: flex !important;
        width: auto !important;
        flex: 1 1 0 !important;
        position: relative;
    }
    /* connector line between the step circles (drawn first, circles cover it) */
    .b2b-registration-wizard .nav-tabs > li + li::before {
        content: "";
        position: absolute;
        top: 21px;                       /* centre of the 30px circle (+6px pad) */
        inset-inline-start: -50%;
        width: 100%;
        height: 2px;
        background: #e3e3e3;
    }
    .b2b-registration-wizard .nav-tabs > li > a {
        position: relative;              /* paints above the connector */
        flex-direction: column;
        gap: 6px;
        min-height: 44px;
        padding: 6px 4px !important;
        border-bottom: 0 !important;     /* active red underline -> red circle */
        background: none !important;
    }
    .b2b-registration-wizard .tab-number {
        margin-right: 0;                 /* desktop puts the label beside it */
        width: 30px !important; height: 30px !important; font-size: 13px !important;
    }
    .b2b-registration-wizard .tab-title { font-size: 12px; line-height: 1.2; }

    /* --- 44px touch ergonomics ------------------------------------------ */
    .b2b-registration-wizard .form-control,
    .b2b-registration-wizard input[type="text"],
    .b2b-registration-wizard input[type="email"],
    .b2b-registration-wizard input[type="password"],
    .b2b-registration-wizard input[type="tel"],
    .b2b-registration-wizard select {
        min-height: 44px;
        box-sizing: border-box;
    }
    .b2b-registration-wizard .btn,
    .b2b-registration-wizard button[type="submit"] {
        min-height: 44px;
    }
    .b2b-registration-wizard input[type="checkbox"],
    .registration-page .checkbox input[type="checkbox"] {
        width: 20px; height: 20px;
    }
    /* the Newsletter row is a BS3 .checkbox OUTSIDE the wizard — give the whole
       label a 44px tap row */
    .registration-page .checkbox label {
        display: flex; align-items: center; gap: 10px;
        min-height: 44px; font-size: 15px;
    }
}

/* live email availability check (step 1) */
.email-availability {
    margin-top: -10px;
}

.email-availability-checking {
    color: #666;
    padding-left: 5px;
}

.email-already-registered {
    display: block;
    clear: both;
    padding-left: 5px;
}
