/* Full Screen Auth Override with Header/Footer */
body {
    overflow-x: hidden;
    /* deploy check 1 */
}

/* Auth Wrapper: Standard block flow, min-height to push footer down */
.auth-wrapper {
    min-height: calc(100vh - 160px);
    /* Approx assumption for header/footer */
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    background: white;
    display: flex;
    justify-content: center;
}


footer {
    margin-top: 0 !important;
}

/* Ensure container is not constrained to centered box if inherited */
main,
.main-content {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Auth Card: Flex container for Split Layout */
/* Removing fixed 100vh to allow header/footer to exist naturally */
.auth-card,
.register-card {
    width: 100% !important;
    max-width: none !important;
    min-height: 85vh;
    /* Large height for "full screen" feel */
    height: auto;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: row;
}

/* Split layout: Brand 45%, Form 55% */
.auth-brand-side {
    width: 45%;
    /* No fixed height, stretch with parent */
    min-height: 85vh;
    padding: 60px;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    align-items: center;
    position: relative;
    background-size: cover;
    /* Ensure BG looks good */
}

.auth-form-side {
    width: 55%;
    /* No fixed height, stretch with parent */
    padding: 60px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    align-items: center;
}

/* Ensure content inside form side is constrained for readability */
.auth-form-side>* {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* Grid for fields */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {

    .auth-card,
    .register-card {
        flex-direction: column;
        min-height: auto;
    }

    .auth-brand-side {
        display: none !important;
        width: 100%;
        min-height: 200px;
        padding: 40px 20px;
        flex: none;
    }


    .auth-form-side {
        width: 100%;
        min-height: auto;
        padding: 40px 24px;
        flex: 1;
    }
}

/* --- Auth Register Wizard Styles (Migrated) --- */

/* Wizard Animations */
.wizard-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout overrides */
.auth-form-side {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
}

.auth-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

#wizardForm {
    display: flex;
    flex-direction: column;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 2px;
    background: #E5E7EB;
    z-index: 0;
}

.step-item {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 25%;
}

.step-circle {
    width: 30px;
    height: 30px;
    background: #fff;
    border: 2px solid #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    color: #6B7280;
    transition: all 0.3s;
}

.step-item.active .step-circle,
.step-item.completed .step-circle {
    border-color: var(--primary-brand, #dc2626);
    background: var(--primary-brand, #dc2626);
    color: #fff;
}

.step-label {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-item.active .step-label {
    color: var(--primary-brand, #dc2626);
    font-weight: 700;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .auth-form-side {
        padding: 20px;
    }
}

/* Field Styles */
.form-group {
    margin-bottom: 0;
    position: relative;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

/* Input & Select Common Styles */
.auth-input,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    width: 100%;
    height: 48px !important;
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 0 12px;
    display: flex !important;
    align-items: center !important;
}

.input-with-icon .auth-input {
    padding-left: 44px;
}

.auth-input:focus,
.select2-container--open .select2-selection {
    border-color: var(--primary-brand, #dc2626) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Icon Positioning */
.input-with-icon {
    position: relative;
}

.input-with-icon>i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
    z-index: 10;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Select2 Specifics */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;
    padding-left: 44px !important;
    padding-right: 20px !important;
    color: #111827 !important;
    width: 100%;
    display: block;
}

.select2-container--default .select2-selection--multiple {
    padding-left: 44px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    height: auto !important;
    min-height: 48px !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 0 !important;
    line-height: 38px !important;
    height: 38px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    margin-left: 0 !important;
    padding: 0 !important;
    position: relative;
    top: 0;
}

.select2-search__field::placeholder {
    color: #6B7280 !important;
    opacity: 1;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 12px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-brand, #dc2626) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 4px !important;
    padding: 4px 8px 4px 24px !important;
    /* Extra left padding for the 'x' */
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    margin-right: 6px !important;
    position: relative;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8) !important;
    border: none !important;
    font-weight: bold !important;
    margin-right: 0 !important;
    position: absolute !important;
    left: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 16px !important;
    line-height: 1 !important;
    padding: 0 !important;
    transition: color 0.2s !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff !important;
    background: transparent !important;
}

/* Ensure Select2 Dropdown is not cut off */
.select2-container--open {
    z-index: 9999 !important;
}

.select2-dropdown {
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    background: #fff !important;
}

/* Force dropdown below the input */
.select2-container--default .select2-dropdown--below {
    margin-top: 4px !important;
}

/* Fix for country list z-index and UI flaw */
.iti__country-list {
    z-index: 10000 !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.iti--separate-dial-code .iti__selected-dial-code {
    font-size: 14px !important;
    color: #374151 !important;
}

/* Select2 Flag Styles */
.select2-flag {
    margin-right: 10px;
    display: inline-block;
    width: 20px;
    height: 15px;
    vertical-align: middle;
    border-radius: 2px;
}

.select2-results__options {
    max-height: 300px !important;
}


/* Wizard Actions */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #F3F4F6;
}

.btn-prev {
    background: #F3F4F6;
    color: #374151;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-prev:hover {
    background: #E5E7EB;
}

.btn-next {
    background: var(--primary-brand, #dc2626);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

.btn-next:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3);
}

/* Warnings & Errors */
.is-invalid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}

.error-msg {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}

/* Selection Cards (Step 4) */
.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.selection-card {
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.selection-card:hover,
.selection-card.selected {
    border-color: var(--primary-brand, #dc2626);
    background: #FEF2F2;
}

.selection-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: #FEE2E2;
    color: var(--primary-brand, #dc2626);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* Utils for Headers/Footers */
.auth-header-center {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    font-weight: 800;
    color: #111827;
    font-size: 26px;
    margin-bottom: 8px;
}

.auth-subtitle-text {
    color: #6B7280;
    font-size: 15px;
}

.wizard-purpose-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111;
}

.wizard-purpose-text {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 20px;
}

.auth-footer-container {
    margin-top: 20px;
    text-align: center;
    padding-top: 10px;
    border-top: 1px dashed #E5E7EB;
}

.auth-footer-link {
    color: var(--primary-brand, #dc2626);
    font-weight: 600;
    text-decoration: none;
}