/* Clean Professional Wizard Layout - Fixes all messy form layouts */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

/* Main Container Structure */
.wizard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #ffffff;
    min-height: 100vh;
}

.container-fluid .row {
    margin: 0;
    padding: 0;
}

/* Card Layout Fixes */
.card {
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header {
    background: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 16px 24px;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
}

.card-body {
    padding: 24px;
    background: white;
}

/* Form Layout Organization */
.wizard-form-section {
    padding: 20px 0;
}

.wizard-form-section h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0056b3;
}

/* Step Indicators - Force Horizontal Layout */
.wizard-steps {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 30px 0;
    padding: 0 20px;
}

.wizard-step {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    text-align: center;
    position: relative;
}

/* Horizontal Form Grid System - Enhanced for Better UX */
.form-row, .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
    align-items: flex-start;
}

.form-col, .col-md-6, .col-md-4, .col-md-3, .col-12, .col-sm-6 {
    padding-left: 15px;
    padding-right: 15px;
    margin-bottom: 20px;
}

.col-md-6, .form-col {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

/* Enhanced Horizontal Form Layout for Better User Experience */
.horizontal-form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.horizontal-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.horizontal-form-row .form-group {
    flex: 1;
    min-width: 250px;
    margin-bottom: 0;
}

.horizontal-form-row .form-group.full-width {
    flex: 1 1 100%;
}

.horizontal-form-row .form-group.half-width {
    flex: 1 1 calc(50% - 10px);
}

.horizontal-form-row .form-group.third-width {
    flex: 1 1 calc(33.333% - 14px);
}

/* Mobile Responsiveness for Horizontal Forms */
@media (max-width: 768px) {
    .form-row, .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .form-col, .col-md-6, .col-md-4, .col-md-3, .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .horizontal-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .horizontal-form-row .form-group {
        margin-bottom: 20px;
        min-width: unset;
    }
}

/* Enhanced Form Controls for Horizontal Layout */
.form-group, .mb-3 {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.form-label.required-field::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

.form-control, .form-select {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control-lg, .form-select-lg {
    padding: 14px 18px;
    font-size: 1.1rem;
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: #0056b3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

/* Enhanced Card Layout for Better Organization */
.card {
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f8 100%);
    border-bottom: 1px solid #e3e6f0;
    padding: 18px 24px;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    font-size: 1.15rem;
    color: #2c3e50;
    font-weight: 600;
}

.card-body {
    padding: 28px;
    background: white;
}

/* Enhanced Form Text and Help Text */
.form-text {
    margin-top: 6px;
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Better Visual Separation */
.wizard-form-section {
    padding: 30px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wizard-form-section:last-child {
    border-bottom: none;
}

.form-control-lg, .form-select-lg {
    padding: 12px 16px;
    font-size: 1.05rem;
}

.form-control:focus, .form-select:focus {
    border-color: #0056b3;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Input Group Styling */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 6px 0 0 6px;
}

.input-group .form-control {
    border-radius: 0 6px 6px 0;
}

/* Checkbox and Radio Styling */
.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.75em;
    margin-bottom: 10px;
}

.form-check-input {
    float: left;
    margin-left: -1.75em;
    margin-top: 0.25em;
    width: 1.1em;
    height: 1.1em;
    vertical-align: top;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 3px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #0056b3;
    border-color: #0056b3;
}

.form-check-label {
    display: block;
    cursor: pointer;
    font-size: 0.95rem;
    color: #495057;
}

.form-check-group {
    padding: 10px 0;
}

/* Progress Bar and Steps */
.wizard-progress-container {
    margin: 30px 0;
    padding: 0 20px;
}

.step-indicator {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: #0056b3;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
}

.step-indicator i {
    font-size: 1.2rem;
}

.step-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.85rem;
    white-space: nowrap;
    color: #6c757d;
}

.progress-connector {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 10px;
    align-self: center;
}

.progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #0056b3, #007bff);
    transition: width 0.3s ease;
}

/* Alert and Info Boxes */
.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-info {
    color: #004085;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Button Styling */
.wizard-actions {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 12px 24px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    color: #fff;
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-primary:hover {
    background-color: #004494;
    border-color: #003d82;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-outline-secondary {
    color: #6c757d;
    background-color: transparent;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

/* Document Icon */
.document-icon-large {
    margin-bottom: 20px;
}

.document-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-icon i {
    font-size: 2.5rem;
    color: white;
}

/* Wizard Tip Box */
.wizard-tip {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #0056b3;
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
}

.wizard-tip-icon {
    color: #ffc107;
    margin-right: 10px;
    font-size: 1.3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .wizard-container {
        padding: 20px 10px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .step-indicator {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .wizard-actions .d-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    .wizard-actions button {
        width: 100%;
    }
}

/* Fix Spacing and Alignment */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: #0056b3 !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }

.ms-auto { margin-left: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

.px-4 { 
    padding-left: 1.5rem !important; 
    padding-right: 1.5rem !important;
}

.py-3 { 
    padding-top: 1rem !important; 
    padding-bottom: 1rem !important;
}

.py-4 { 
    padding-top: 1.5rem !important; 
    padding-bottom: 1.5rem !important;
}

/* Display Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-block { display: inline-block !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }

.flex-fill { flex: 1 1 auto !important; }
.gap-3 { gap: 1rem !important; }

/* Border Utilities */
.border-0 { border: 0 !important; }
.border-bottom { border-bottom: 1px solid #dee2e6 !important; }

/* Shadow Utilities */
.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
}

/* Background Utilities */
.bg-light { background-color: #f8f9fa !important; }
.bg-white { background-color: #fff !important; }
.bg-primary { background-color: #0056b3 !important; }

/* Font Utilities */
.fw-bold { font-weight: 700 !important; }
.lead { 
    font-size: 1.25rem; 
    font-weight: 300;
}

/* Ensure Clean Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #212529;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

li {
    margin-bottom: 5px;
}

/* Remove any floating or positioning issues */
.wizard-form-section::after,
.form-row::after,
.row::after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure forms don't overflow */
.wizard-form-section {
    overflow: visible;
    position: relative;
}

/* Clean validation styling */
.is-invalid {
    border-color: #dc3545 !important;
}

.is-valid {
    border-color: #28a745 !important;
}