/* One family for the whole form. intake-studio.css pairs two faces - Inter for
   body copy, Space Grotesk for question labels - which reads as mismatched
   typography on a form, so the respondent view uses the body face throughout
   and separates the question by weight instead. */
.intake-studio {
    font-family: var(--is-font-sans);
    line-height: 1.6;
}

    .intake-studio .is-rich-text,
    .intake-studio .is-rich-text * {
        font-family: var(--is-font-sans) !important;
        font-size: inherit !important;
        line-height: inherit !important;
    }

        .intake-studio .is-rich-text h1,
        .intake-studio .is-rich-text h2,
        .intake-studio .is-rich-text h3,
        .intake-studio .is-rich-text h4,
        .intake-studio .is-rich-text h5,
        .intake-studio .is-rich-text h6 {
            font-size: 1.15em !important;
            font-weight: 600;
            margin: 0 0 0.5rem;
        }

        /* !important because pasted markup carries its own inline margins, which is
           what makes the spacing between paragraphs look uneven. */
        .intake-studio .is-rich-text p {
            margin: 0 0 0.75rem !important;
        }

            .intake-studio .is-rich-text p:last-child {
                margin-bottom: 0 !important;
            }

        .intake-studio .is-rich-text br + br {
            display: none;
        }

        .intake-studio .is-rich-text ul,
        .intake-studio .is-rich-text ol {
            margin: 0 0 0.75rem;
            padding-left: 1.5rem;
        }

        .intake-studio .is-rich-text li {
            margin-bottom: 0.25rem;
        }

    /* Questions and their options share that same family; the question stays
       distinct through weight and size rather than a second typeface. */
    .intake-studio .question-card .form-check-label {
        font-family: var(--is-font-sans);
        line-height: 1.6;
    }

    /* The question text itself. */
    .intake-studio .question-card > .card > .card-body > .form-check-label {
        font-size: 1em;
        font-weight: 600;
    }

    /* Individual radio / checkbox options read as body copy, not as headings. */
    .intake-studio .question-card .form-check .form-check-label {
        font-size: 0.95em;
        font-weight: 400;
    }

#surveyProgress {
    transition: width 0.5s ease;
}

/* Question card styles */
.question-card {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card shadow and borders */
.card {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

    .card:hover {
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    }

/* Radio and checkbox container spacing */
.radio-group .form-check,
.checkbox-group .form-check {
    margin-bottom: 0.5rem;
    padding-left: 1.8rem;
}

/* Improve spacing for radio and checkbox inputs */
.form-check-input {
    margin-top: 0.3rem;
    margin-left: -1.8rem;
}

/* Scale question specific styling */
.form-check-inline {
    margin-right: 1rem;
}

/* Navigation buttons */
#prevBtn, #nextBtn, #submitBtn {
    min-width: 100px;
    transition: all 0.3s ease;
}

/* Validation error styling */
.validation-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* Animation for showing validation errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.validation-error:not(:empty) {
    animation: shake 0.6s ease;
}

/* File upload styling */
.file-upload-label {
    display: block;
    width: 100%;
}

.file-count {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Question counter and percentage display */
#questionCounter, #percentageComplete {
    font-size: 0.9rem;
}

/* Extra padding for card body to improve question display */
.card-body {
    padding: 1.5rem;
}

/* Make sure form inputs have consistent height */
.form-control, .form-select {
    min-height: 38px;
}

    /* Better focus states for inputs */
    .form-control:focus,
    .form-select:focus,
    .form-check-input:focus {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

.intake-studio .char-counter {
    margin-top: 0.25rem;
    text-align: right;
}

    .intake-studio .char-counter.is-at-limit {
        color: hsl(var(--is-destructive));
        font-weight: 600;
    }

.intake-studio .question-card .radio-group .form-check,
.intake-studio .question-card .checkbox-group .form-check {
    cursor: pointer;
}

    .intake-studio .question-card .radio-group .form-check .form-check-label,
    .intake-studio .question-card .checkbox-group .form-check .form-check-label {
        display: block;
        margin: -0.6rem -0.75rem -0.6rem -2.4rem;
        padding: 0.6rem 0.75rem 0.6rem 2.4rem;
        cursor: pointer;
    }

.intake-studio .question-card .form-check-inline .form-check-label {
    cursor: pointer;
}
.intake-studio .dateTimePickerDiv {
    /* min() so the field keeps a usable width on a desktop but never pushes past the card
       on a narrow phone, where 220px is wider than the card itself. */
    min-width: min(220px, 100%);
    max-width: 100%;
}

    .intake-studio .dateTimePickerDiv .input-group {
        flex-wrap: wrap;
        max-width: 100%;
    }

        .intake-studio .dateTimePickerDiv .input-group > .form-control {
            min-width: min(110px, 100%);
        }

        .intake-studio .dateTimePickerDiv .input-group > .validation-error {
            flex: 0 0 100%;
            margin-top: 0.25rem;
        }
