/* Pricing / Special Programs - Small Business Program Application Styles
   Phase 3E: moved out of a template-embedded <style> block (CSP hardening --
   style-src-elem cannot go strict while a template ships its own <style>
   element). Rules below are unchanged from that block. */

/* Hidden-until-JS: the initial state for controls whose visibility this
   page's own wizard script (apply-small-business-program/ui.js) drives
   directly via element.style.display after DOMContentLoaded (prevBtn,
   submitBtn, processingAnimation). Deliberately NOT !important -- a plain
   inline style declaration set by JS already outranks a non-!important
   stylesheet rule in the cascade regardless of selector specificity, so this
   only supplies the pre-JS/no-JS-yet paint and never fights the script's
   later `style.display = 'inline-flex' | 'flex'` assignments. */
.hidden-until-js {
    display: none;
}

/* Page Structure */
.page--application {
    background-color: var(--qc-color-bg-light);
}

/* Hero Section */
.page__hero {
    background: linear-gradient(135deg, var(--qc-color-primary), var(--qc-color-primary-dark));
    color: #ffffff;
    padding: 3rem 0;
    text-align: center;
}

.page__hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.page__hero-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 650px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Notification Bar */
.page__notification {
    background-color: var(--qc-color-bg-white);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--qc-color-border);
}

.page__notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.page__notification-icon {
    color: var(--qc-color-primary);
}

.page__notification-text {
    margin: 0;
    color: var(--qc-color-text-dark);
    font-weight: 500;
}
.page__notification-text strong {
    color: var(--qc-color-primary);
}

/* Application Container */
.application {
    padding: 3rem 0 5rem;
}

.application__content {
    max-width: 900px;
    margin: 0 auto;
}

/* Form Container */
.application__form-container {
    background-color: var(--qc-color-bg-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow-lg);
    padding: 2.5rem;
}

/* --- NEW Progress Stepper --- */
.application__progress {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    position: relative;
}

.application__progress-line {
    position: absolute;
    top: 20px; /* Vertically center with the icons */
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--qc-color-border);
    z-index: 1;
}

.application__progress-track {
    height: 100%;
    width: 0%;
    background-color: var(--qc-color-primary);
    transition: width 0.4s ease-in-out;
}

.application__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    width: 100px; /* Give steps some width */
}

.application__step-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--qc-color-bg-white);
    border: 2px solid var(--qc-color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.application__step-icon,
.application__step-icon-check {
    color: var(--qc-color-text-light);
    transition: all 0.4s ease;
    position: absolute;
}
.application__step-icon-check {
    transform: translateY(40px);
}

.application__step-label {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--qc-color-text-light);
    transition: color 0.4s ease;
}

/* Active State */
.application__step.application__step--active .application__step-icon-wrapper {
    border-color: var(--qc-color-primary);
    box-shadow: 0 0 0 4px rgba(106, 61, 232, 0.1);
}
.application__step.application__step--active .application__step-icon {
    color: var(--qc-color-primary);
}
.application__step.application__step--active .application__step-label {
    color: var(--qc-color-primary);
    font-weight: 600;
}

/* Completed State */
.application__step.application__step--complete .application__step-icon-wrapper {
    background-color: var(--qc-color-primary);
    border-color: var(--qc-color-primary);
}
.application__step.application__step--complete .application__step-icon {
    transform: translateY(-40px); /* Move original icon up */
}
.application__step.application__step--complete .application__step-icon-check {
    transform: translateY(0); /* Move checkmark in */
    color: white;
}
.application__step.application__step--complete .application__step-label {
    color: var(--qc-color-text-dark);
}

/* Form Structure */
.application__form-steps h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--qc-color-text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--qc-color-border);
}
.application__form-steps .form-group {
    margin-bottom: 1.25rem;
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- NEW: Form Field Design --- */
.form-group label {
    display: block;
    font-weight: 500;
    color: var(--qc-color-text-dark);
    margin-bottom: 0.5rem;
}
.input-wrapper {
    position: relative;
}
.input-wrapper .icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--qc-color-text-light);
    transition: color 0.3s ease;
}
.form-control, .form-select {
    height: calc(2.25rem + 10px);
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.75rem; /* Left padding for icon */
    font-size: 1rem;
    background-color: var(--qc-color-bg-light);
    border: 1px solid var(--qc-color-border);
    border-radius: var(--qc-radius-md);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--qc-color-primary);
    box-shadow: 0 0 0 3px rgba(106, 61, 232, 0.15);
    background-color: var(--qc-color-bg-white);
    outline: none;
}
.form-control:focus + .icon, .form-select:focus + .icon {
    color: var(--qc-color-primary);
}

/* Adjust padding for selects without icons if needed */
.form-select.no-icon {
    padding-left: 1rem;
}

/* --- NEW: Address Fields Group --- */
.address-group {
    border: 1px solid var(--qc-color-border);
    border-radius: var(--qc-radius-md);
    padding: 1.5rem 1.5rem 0.5rem;
    margin-top: 1rem;
    position: relative;
}
.address-group__legend {
    font-weight: 600;
    color: var(--qc-color-text-dark);
    padding: 0 0.5rem;
    background-color: var(--qc-color-bg-white);
    /* Position legend to "cut" the border */
    position: absolute;
    top: -0.7em;
    left: 1rem;
    font-size: 0.9em;
}
.address-group .row {
    --bs-gutter-x: 1rem; /* Adjust spacing between columns */
}


/* --- REDESIGNED Welcome Section --- */
.welcome-section {
    display: none; /* Hidden by default */
    margin: 2rem 0;
    background-color: var(--qc-color-bg-light);
    border-radius: var(--qc-radius-lg);
    padding: 2rem;
    border: 1px solid var(--qc-color-border);
    animation: fadeIn 0.5s ease-in-out;
}

.welcome-section__header {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-section__title {
    color: var(--qc-color-text-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.welcome-section__subtitle {
    color: var(--qc-color-text-medium);
    max-width: 600px;
    margin: 0 auto;
}

.welcome-section__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.welcome-section__card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background-color: var(--qc-color-bg-white);
    padding: 1.5rem;
    border-radius: var(--qc-radius-md);
    box-shadow: var(--qc-shadow-sm);
    transition: var(--qc-transition-standard);
}
.welcome-section__card:hover {
    transform: translateY(-5px);
    box-shadow: var(--qc-shadow-md);
}

.welcome-section__card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--qc-color-primary-light), var(--qc-color-primary));
    color: white;
    font-size: 1.5rem;
}

.welcome-section__card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--qc-color-text-dark);
    margin-bottom: 0.25rem;
}

.welcome-section__card-description {
    color: var(--qc-color-text-medium);
    font-size: 0.9rem;
    line-height: 1.6;
}


/* Modals (Minor tweaks for consistency) */
.form-check-label {
    cursor: pointer;
}
.modal-header {
    background: var(--qc-color-primary);
    color: white;
}
.service-info-icon, .field-info-icon {
    color: var(--qc-color-primary);
    margin-left: 0.5rem;
    cursor: pointer;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: .25rem;
    font-size: .875em;
    color: #dc3545;
}

/* Processing Animation */
.processing-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 31, 46, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.processing-animation__content {
    background-color: var(--qc-color-bg-white);
    border-radius: var(--qc-radius-lg);
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--qc-shadow-lg);
}

.processing-animation__icon {
    color: var(--qc-color-primary);
    margin-bottom: 1.5rem;
}
.processing-animation__icon i {
    font-size: 3rem;
    animation: pulse 1.5s infinite ease-in-out;
}

.processing-animation__title {
    color: var(--qc-color-text-dark);
    margin-bottom: 0.5rem;
}

.processing-animation__description {
    color: var(--qc-color-text-medium);
    margin-bottom: 1.5rem;
}

.processing-animation__progress-bar-container {
    height: 8px;
    background-color: var(--qc-color-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.processing-animation__progress-bar {
    height: 100%;
    background: var(--qc-color-primary);
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.processing-animation__percentage {
    color: var(--qc-color-primary);
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Form Buttons */
.application__buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    border-top: 1px solid var(--qc-color-border);
    padding-top: 2rem;
}

.application__button {
    padding: 0.75rem 1.5rem;
    border-radius: var(--qc-radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}
.application__button .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}
.application__button i {
    font-size: 1.25rem;
}

.application__button--primary {
    background-color: var(--qc-color-primary);
    color: white;
}
.application__button--secondary {
    background-color: var(--qc-color-bg-gray);
    color: var(--qc-color-text-dark);
}
.application__button--success {
    background-color: var(--qc-color-accent);
    color: white;
}
.application__button:hover {
    transform: translateY(-2px);
    box-shadow: var(--qc-shadow-md);
}

.service-info__list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--qc-color-primary);
    font-weight: bold;
}

.service-info__list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.service-info__list {
    list-style: none;
    padding-left: 0;
}

/* Responsive Styles */
@media (max-width: 767px) {
    .page__hero-title { font-size: 1.75rem; }
    .application__form-container { padding: 1.5rem; }

    .application__progress {
        align-items: center;
    }
    .application__step-label {
        display: none; /* Hide labels on mobile */
    }
    .application__progress-line {
        top: 20px;
    }

    .welcome-section { padding: 1.5rem; }
    .welcome-section__grid { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
    .application__buttons {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    .application__button {
        width: 100%;
        justify-content: center;
    }
}
