/* ========================================
   Referral Form Wizard Styles
   ======================================== */

/* Wizard Progress Indicator */
.wizard-progress {
    padding: 0.75rem 0;
}

.wizard-card {
    padding: 0.75rem 1rem !important;
    height: auto;
}

/* Disable hover effects on wizard cards (form pages and wizard header) */
.service-card:has(.wizard-step-content),
.service-card.wizard-card {
    transition: box-shadow 0.3s ease;
}

.service-card:has(.wizard-step-content):hover,
.service-card.wizard-card:hover {
    transform: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.wizard-steps {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wizard-steps::-webkit-scrollbar {
    display: none;
}

.wizard-step-item {
    border-bottom: 1px solid #dee2e6;
    min-width: fit-content;
}

@media (min-width: 992px) {
    .wizard-step-item {
        border-bottom: none;
        border-right: 1px solid #dee2e6;
    }

    .wizard-step-item:last-child {
        border-right: none;
    }
}

.step-circle {
    transition: all 0.3s ease;
    font-size: 0.875rem;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
}

.wizard-step-item.active .step-circle {
    background-color: #009fe3 !important;
    border-color: #009fe3 !important;
    color: white !important;
}

.wizard-step-item.active .step-label {
    color: #009fe3 !important;
    font-weight: 600 !important;
}

.wizard-step-item.completed .step-circle {
    background-color: #8cc63f !important;
    border-color: #8cc63f !important;
    color: white !important;
}

.wizard-step-item.completed .step-number {
    display: none;
}

.wizard-step-item.completed .step-check {
    display: inline-block !important;
}

.wizard-step-item.completed .step-label {
    color: #6c757d !important;
}

.wizard-step-item:not(.active):not(.completed) .step-circle {
    background-color: transparent !important;
    border-color: #6c757d !important;
    color: #6c757d !important;
}

.wizard-step-item:not(.active):not(.completed) .step-label {
    color: #6c757d !important;
}

.step-label {
    font-size: 0.875rem;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .wizard-steps {
        flex-direction: column;
    }

    .wizard-step-item {
        width: 100%;
    }

    .step-label {
        font-size: 0.8125rem;
    }
}

/* Responsive form layout - Step 1 & 2: 35%/65% */
.form-row-horizontal {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.form-row-horizontal:has(.form-label-container p.text-muted) {
    margin-bottom: 1.75rem;
}

.form-label-container {
    width: 100%;
    margin-bottom: 0.5rem;
}

.form-input-container {
    width: 100%;
}

@media (min-width: 992px) {
    /* Step 1: 50%/50% layout (6/6 columns) */
    .wizard-step-content[data-step="1"] .form-row-horizontal {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .wizard-step-content[data-step="1"] .form-row-horizontal:has(.form-label-container p.text-muted) {
        margin-bottom: 1.5rem;
    }

    .wizard-step-content[data-step="1"] .form-label-container {
        flex: 0 0 50%;
        max-width: 50%;
        padding-right: 1.5rem;
        padding-top: 0.375rem;
        margin-bottom: 0;
    }

    .wizard-step-content[data-step="1"] .form-input-container {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Step 2: 50%/50% layout (6/6 columns) */
    .wizard-step-content[data-step="2"] .form-row-horizontal {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .wizard-step-content[data-step="2"] .form-row-horizontal:has(.form-label-container p.text-muted) {
        margin-bottom: 1.5rem;
    }

    .wizard-step-content[data-step="2"] .form-label-container {
        flex: 0 0 50%;
        max-width: 50%;
        padding-right: 1.5rem;
        padding-top: 0.375rem;
        margin-bottom: 0;
    }

    .wizard-step-content[data-step="2"] .form-input-container {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .wizard-step-content[data-step="1"] .form-label,
    .wizard-step-content[data-step="2"] .form-label {
        margin-bottom: 0;
    }

    /* Step 3: 75%/25% layout with increased spacing */
    .wizard-step-content[data-step="3"] .form-row-horizontal {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 1.75rem;
    }

    .wizard-step-content[data-step="3"] .form-row-horizontal:has(.form-label-container p.text-muted) {
        margin-bottom: 1.5rem;
    }

    .wizard-step-content[data-step="3"] .form-label-container {
        flex: 0 0 75%;
        max-width: 75%;
        padding-right: 1.5rem;
        padding-top: 0.375rem;
        margin-bottom: 0;
    }

    .wizard-step-content[data-step="3"] .form-input-container {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .wizard-step-content[data-step="3"] .form-label {
        margin-bottom: 0;
    }

    /* Step 4: 66.67%/33.33% layout (8/4 columns) */
    .wizard-step-content[data-step="4"] .form-row-horizontal {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .wizard-step-content[data-step="4"] .form-row-horizontal:has(.form-label-container p.text-muted) {
        margin-bottom: 1.5rem;
    }

    .wizard-step-content[data-step="4"] .form-label-container {
        flex: 0 0 66.666667%; /* 8/12 = 66.666667% */
        max-width: 66.666667%;
        padding-right: 1.5rem;
        padding-top: 0.375rem;
        margin-bottom: 0;
    }

    .wizard-step-content[data-step="4"] .form-input-container {
        flex: 0 0 33.333333%; /* 4/12 = 33.333333% */
        max-width: 33.333333%;
    }

    /* Step 5: 50%/50% layout with increased spacing */
    .wizard-step-content[data-step="5"] .form-row-horizontal {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 1.75rem;
    }

    .wizard-step-content[data-step="5"] .form-row-horizontal:has(.form-label-container p.text-muted) {
        margin-bottom: 2rem;
    }

    .wizard-step-content[data-step="5"] .form-label-container {
        flex: 0 0 50%;
        max-width: 50%;
        padding-right: 1.5rem;
        padding-top: 0.375rem;
        margin-bottom: 0;
    }

    .wizard-step-content[data-step="5"] .form-input-container {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .wizard-step-content[data-step="4"] .form-label {
        margin-bottom: 0;
    }

    .wizard-step-content[data-step="5"] .form-label {
        margin-bottom: 0;
    }

    /* Step 6: Form fields (declarations and reCAPTCHA) use 8/4 split */
    .wizard-step-content[data-step="6"] form .form-row-horizontal {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .wizard-step-content[data-step="6"] form .form-label-container {
        flex: 0 0 66.666667%; /* 8/12 = 66.666667% */
        max-width: 66.666667%;
        padding-right: 1.5rem;
        padding-top: 0.375rem;
        margin-bottom: 0;
    }

    .wizard-step-content[data-step="6"] form .form-input-container {
        flex: 0 0 33.333333%; /* 4/12 = 33.333333% */
        max-width: 33.333333%;
    }

    .wizard-step-content[data-step="6"] form .form-label {
        margin-bottom: 0;
    }

    /* Review page: 7/5 layout (58.33%/41.67%) for all display sections */
    .review-page .wizard-step-content .form-row-horizontal {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 0;
    }

    .review-page .wizard-step-content .form-label-container {
        flex: 0 0 58.333333%; /* 7/12 = 58.333333% */
        max-width: 58.333333%;
        padding-right: 1.5rem;
        padding-top: 0.375rem;
        margin-bottom: 0;
    }

    .review-page .wizard-step-content .form-input-container {
        flex: 0 0 41.666667%; /* 5/12 = 41.666667% */
        max-width: 41.666667%;
    }

    .review-page .wizard-step-content .form-label {
        margin-bottom: 0;
    }
}

/* Review page specific styles - alternating row backgrounds */
.review-page .wizard-step-content .form-row-horizontal:nth-child(even) {
    background-color: #f8f9fa;
    padding: 0.75rem 0;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 0.25rem;
}

.review-page .wizard-step-content .form-row-horizontal:nth-child(odd) {
    padding: 0.75rem 0;
}

/* Wizard Navigation */
.wizard-navigation {
    padding: 20px 0;
    margin-top: 2rem !important;
    clear: both;
}

.wizard-navigation .btn {
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.wizard-navigation .btn-primary {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.wizard-navigation .btn-primary:hover:not(:disabled) {
    background: #e68919;
    border-color: #e68919;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(247,147,30,0.4);
    color: #fff;
}

.wizard-navigation .btn-outline-secondary {
    border-color: #009fe3;
    color: #009fe3;
    background: transparent;
}

.wizard-navigation .btn-outline-secondary:hover {
    background: #009fe3;
    border-color: #009fe3;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,159,227,0.4);
}

.wizard-navigation .btn-cta {
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

@media (max-width: 991.98px) {
    .wizard-navigation > div {
        flex-direction: column;
        gap: 1rem;
    }

    .wizard-navigation .ms-auto {
        margin-left: 0 !important;
        width: 100%;
        order: 1;
    }

    .wizard-navigation .btn-outline-secondary {
        order: 2;
    }

    .wizard-navigation .btn {
        width: 100%;
        display: block;
    }
}

.required-asterisk {
    color: #dc3545;
    margin-left: 0.25rem;
}

.form-section-divider {
    width: 50%;
    margin: 2.5rem auto;
    border: none;
    border-top: 1px solid #dee2e6;
    opacity: 0.5;
}

/* Step Heading Styles */
.wizard-step-content h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid;
}

.wizard-step-content[data-step="1"] h3,
.wizard-step-content[data-step="3"] h3,
.wizard-step-content[data-step="5"] h3 {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

.wizard-step-content[data-step="2"] h3 {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.wizard-step-content[data-step="4"] h3,
.wizard-step-content[data-step="6"] h3 {
    color: var(--green);
    border-bottom-color: var(--green);
}

/* Review section titles - smaller than main h3 */
.review-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 0;
    color: #495057;
}

/* Hero Step Info */
.hero-step-info {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
}


/* Mobile-specific styles for Start page reCAPTCHA form section */
@media (max-width: 767.98px) {
    /* Ensure everything stays centered like desktop - just prevent overflow */
    .start-page-form .text-center.mb-4 {
        text-align: center !important;
        width: 100%;
    }

    .start-page-form .text-center.mb-4 h2 {
        text-align: center !important;
        width: 100%;
    }

    /* Description text - center aligned like desktop */
    .start-page-form .text-center.mb-4 p.text-muted {
        text-align: center !important;
        width: 100%;
    }

    /* reCAPTCHA container - center aligned, prevent overflow */
    .start-page-form form .row.mt-4:first-child .col-12 {
        text-align: center !important;
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
    }

    .start-page-form form .row.mt-4:first-child .col-12 .d-flex {
        justify-content: center !important;
        width: 100%;
        overflow-x: auto;
    }

    .start-page-form .g-recaptcha {
        max-width: 100%;
        overflow: hidden;
        margin: 0 auto;
    }

    /* Button container - full width, center aligned */
    .start-page-form form .row.mt-4:last-child .col-12 {
        text-align: center !important;
        width: 100%;
    }

    .start-page-form #continueButton {
        width: 100% !important;
        display: block;
        margin: 0 auto;
    }
}

