/* Survey-first flow styles: progress bar, role step, step layout.
 * Progress widths are predefined classes (sf-w-1..sf-w-6) so JS never sets
 * inline styles, keeping us compliant with the strict CSP.
 */

.sf-progress {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.sf-progress-track {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.sf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f8cff, #2bb673);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.sf-w-1 { width: 16.66%; }
.sf-w-2 { width: 33.33%; }
.sf-w-3 { width: 50%; }
.sf-w-4 { width: 66.66%; }
.sf-w-5 { width: 83.33%; }
.sf-w-6 { width: 100%; }

.sf-progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.survey-step-title {
    margin-bottom: 0.25rem;
}

.sf-role-step .survey-step-title,
.sf-role-step > .text-muted {
    text-align: center;
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Selectable role cards: the real radio is visually hidden, the label is the
 * card. Selected state via :checked + label sibling - no JS needed. */
.role-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border: 1.5px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    color: #212529;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.role-card::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid #adb5bd;
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.role-card:hover {
    border-color: #4f8cff;
    box-shadow: 0 2px 8px rgba(79, 140, 255, 0.15);
}

.role-radio:checked + .role-card {
    border-color: #2f6fed;
    background: #f0f6ff;
    box-shadow: 0 2px 8px rgba(47, 111, 237, 0.18);
}

.role-radio:checked + .role-card::before {
    border-color: #2f6fed;
    background: #2f6fed;
    box-shadow: inset 0 0 0 3px #fff;
}

.role-radio:focus-visible + .role-card {
    outline: 2px solid #2f6fed;
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .role-options {
        grid-template-columns: 1fr;
    }
}

.sf-terms {
    font-size: 1rem;
    background: #f0f6ff;
    border: 1px solid #b6d4fe;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.sf-terms .form-check-input {
    margin-left: 0;
    margin-top: 0;
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
}

.sf-terms.sf-terms-error {
    border-color: #dc3545;
    background: #fdf0f0;
}

.invalid-feedback-block {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.4rem;
}

.sf-nav-spacer {
    flex: 1 1 auto;
}

.survey-nav {
    gap: 0.75rem;
}

.survey-nav .btn {
    min-width: 160px;
}

/* Step-1 footer: terms acceptance and nav buttons on one row */
.sf-actions-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sf-terms-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.sf-terms-wrap .sf-terms {
    max-width: none;
    margin: 0;
}

.sf-actions-row .survey-nav {
    flex: 1 1 auto;
}

@media (max-width: 576px) {
    .sf-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .sf-actions-row .survey-nav {
        width: 100%;
    }
}
