/* =========================================================
   Common question layout
   ========================================================= */

.survey-question[hidden] {
    display: none !important;
}

.survey-question {
    margin-top: 28px;
    margin-bottom: 28px;
}

.survey-question-heading {
    margin-bottom: 10px;
}

.survey-question-heading h4 {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 500;
}

.survey-question-explanation {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.survey-question .fa-star {
    margin-left: 4px;
    font-size: 12px;
    vertical-align: top;
}

.survey-question-error {
    margin-top: 10px;
    color: #a94442;
    text-align: left;
}

/*
 * The selector is intentionally specific because the main theme applies
 * its green colour to every direct span child of an h4 element.
 */
.survey-question-heading h4 > .survey-question-optional,
fieldset.survey-question legend h4 > .survey-question-optional {
    display: inline-block;
    margin-left: 6px;
    color: #999 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    font-style: italic;
    line-height: 1;
    vertical-align: baseline;
}

.survey-question-help-type {
    margin-top: -4px;
    margin-bottom: 14px;
    color: #777;
    font-size: 13px;
    font-style: italic;
    line-height: 1.4;
}

fieldset.survey-question legend {
    width: 100%;
    margin: 0 0 14px 0;
    padding: 0;
    border: 0;
}

fieldset.survey-question legend h4 {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 500;
}


/* =========================================================
   Informational content
   ========================================================= */

.survey-content-title,
.survey-content-heading,
.survey-content-reference-title {
    margin-bottom: 10px;
}

.survey-content-title {
    margin-top: 30px;
    font-size: 22px;
    line-height: 1.35;
}

.survey-content-heading {
    margin-top: 24px;
    font-size: 18px;
    line-height: 1.4;
}

.survey-content-reference-title {
    margin-top: 18px;
    font-size: 15px;
    font-weight: 600;
}

.survey-content-text,
.survey-content-reference-text {
    margin-bottom: 20px;
    line-height: 1.5;
}

.survey-content-reference-text {
    font-size: 0.95em;
    color: #666;
}


/* =========================================================
   Standard form controls
   ========================================================= */

.survey-question .form-control {
    width: 100%;
    max-width: 100%;
}

.survey-question textarea.form-control {
    min-height: 130px;
    resize: vertical;
}

.survey-question input[type="text"],
.survey-question input[type="email"],
.survey-question select.form-control {
    min-height: 38px;
}


/* =========================================================
   Radio and checkbox choices
   ========================================================= */

.survey-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    width: 100%;
    min-height: 2.35rem;
    padding: 0.45rem 0.5rem;
    margin: 0;

    border-bottom: 1px solid #eeeeee;
}

.survey-choice:last-of-type {
    border-bottom: 0;
}

.survey-choice-input {
    position: static !important;
    display: inline-block;
    flex: 0 0 auto;

    width: 1.1rem;
    height: 1.1rem;

    margin: 0 !important;
    padding: 0;

    cursor: pointer;
}

.survey-choice-label {
    display: inline-block !important;
    flex: 1 1 auto;

    width: auto !important;
    margin: 0 !important;
    padding: 0;

    line-height: 1.4;
    font-weight: 500;

    cursor: pointer;
}

.survey-choice:has(.survey-choice-input:checked) {
    background-color: #f7f9fc;
}


/* Doodle / availability question */

.survey-doodle-choice {
    display: flex;
    align-items: center;
    max-width: 650px;
    margin-bottom: 8px;
    padding: 12px 16px;

    border: 1px solid #d6dce2;
    border-radius: 5px;
    background: #f8f9fa;
}

.survey-doodle-choice:hover {
    background: #eef3f7;
}

.survey-doodle-choice .survey-choice-input {
    width: 20px;
    height: 20px;
    margin: 0 14px 0 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.survey-doodle-label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    flex: 1;
}

.survey-doodle-choice:has(.survey-choice-input:checked) {
    background: #e6f4ea;
    border-color: #79a987;
}

.survey-doodle-choice:has(.survey-choice-input:checked)
.survey-doodle-label {
    font-weight: 600;
}

.survey-doodle-total th {
    font-weight: 600;
    background: #f5f7f5;
}

.survey-doodle-total .text-center {
    white-space: nowrap;
}

/* Doodle - participant identity */

.survey-doodle-identity {
    margin: 24px 0 26px;
    padding: 20px 22px 22px;

    background: #f5f8f3;
    border: 1px solid #cfdac8;
    border-radius: 5px;
}

.survey-doodle-identity h4 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
}

.survey-doodle-identity .row {
    margin-top: 8px;
}

.survey-doodle-identity label {
    display: block;
    margin-bottom: 7px;

    font-size: 14px;
    font-weight: 600;
}

.survey-doodle-identity .form-control {
    height: 40px;
    background: #fff;
}

.survey-required-star {
    margin-left: 3px;
    font-size: 14px;
    font-weight: 600;
}
.survey-doodle-identity-help {
    margin: -6px 0 16px;
    font-size: 13px;
    font-style: italic;
}
/* =========================================================
   Other option field
   ========================================================= */

.survey-other-wrapper {
    margin: 0.5rem 0 1rem 2.35rem;
}

.survey-other-input {
    display: block;
    width: 100%;
    max-width: 800px;
    min-height: 2.65rem;

    background-color: #ffffff !important;
    opacity: 1 !important;
}

.survey-other-input[hidden],
.survey-other-input:disabled {
    display: none !important;
}


/* =========================================================
   Rating matrix
   ========================================================= */

.rating-matrix-question {
    width: 100%;
}

.rating-matrix-wrapper {
    width: 100%;
    margin-top: 18px;
    overflow-x: auto;
}

.rating-matrix-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;

    border-collapse: separate;
    border-spacing: 0;

    border: 1px solid #d8ddd4;
    border-radius: 5px;
    overflow: hidden;
}

.rating-matrix-table th,
.rating-matrix-table td {
    padding: 12px 10px;

    border-right: 1px solid #e1e4df;
    border-bottom: 1px solid #e1e4df;

    vertical-align: middle;
}

.rating-matrix-table tr:last-child th,
.rating-matrix-table tr:last-child td {
    border-bottom: 0;
}

.rating-matrix-table th:last-child,
.rating-matrix-table td:last-child {
    border-right: 0;
}

.rating-matrix-table thead th {
    background: #f3f6f1;

    text-align: center;
    vertical-align: bottom;
    font-weight: 600;
}

.rating-matrix-item-column,
.rating-matrix-item {
    width: 42%;
    text-align: left;
}

.rating-matrix-item {
    background: #ffffff;

    font-weight: 500;
    line-height: 1.4;
}

.rating-matrix-value-column {
    width: 11.6%;
    text-align: center;
}

.rating-matrix-table td:hover {
    background: #eef6eb;
}

.rating-matrix-value {
    display: block;

    margin-bottom: 5px;

    font-size: 15px;
    font-weight: 700;
}

.rating-matrix-label {
    display: block;

    min-height: 30px;
    margin-top: 4px;

    font-size: 11px;
    font-weight: 400;
    line-height: 1.25;

    overflow-wrap: normal;
    word-break: normal;
}

.rating-matrix-choice {
    background: #ffffff;
    text-align: center;
}

.rating-matrix-choice input[type="radio"] {
    width: 18px;
    height: 18px;

    margin: 0;

    cursor: pointer;
    vertical-align: middle;
}

.rating-matrix-table tbody tr:nth-child(even) th,
.rating-matrix-table tbody tr:nth-child(even) td {
    background: #fafbf9;
}

.rating-matrix-table tbody tr:hover th,
.rating-matrix-table tbody tr:hover td {
    background: #f0f5ec;
}

.rating-matrix-table tr.has-error th,
.rating-matrix-table tr.has-error td {
    background: #fff0f0;
}


/* =========================================================
   Disclaimer
   ========================================================= */

.survey-disclaimer {
    width: 100%;
    margin: 20px 0 24px;
    padding: 0;
    line-height: 1.4;
}

.survey-disclaimer p {
    margin: 0 0 12px;
    line-height: 1.4;
}

.survey-disclaimer p:last-child {
    margin-bottom: 0;
}

.survey-disclaimer ul,
.survey-disclaimer ol {
    margin-top: 4px;
    margin-bottom: 6px;
}

/* =========================================================
   Section titles
   ========================================================= */

/* =========================================================
   Section titles
   ========================================================= */

.survey-question[data-question-type="title_no_question"] {
    margin-top: 8px !important;
    margin-bottom: 24px;
}

.survey-question[data-question-type="title_no_question"] .survey-content-title {
    display: inline-block;

    margin: 0 0 18px;
    padding-bottom: 6px;

    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: #2f2f2f;

    border-bottom: 3px solid #8ab933;
}

/* =========================================================
   Responsive behaviour
   ========================================================= */

@media (max-width: 768px) {
    .survey-question {
        margin-top: 22px;
        margin-bottom: 22px;
    }

    .survey-question-heading {
        margin-bottom: 14px;
    }

    .survey-question-explanation {
        margin-bottom: 18px;
        color: #666;
        font-size: 13px;
    }

    .survey-question-heading h4,
    fieldset.survey-question legend h4 {
        font-size: 17px;
    }

    .survey-question-help-type {
        margin-bottom: 12px;
        font-size: 12px;
    }

    .survey-choice {
        align-items: flex-start;
    }

    .survey-choice-input {
        margin-top: 3px !important;
    }

    .survey-other-wrapper {
        margin-left: 0;
    }

    .rating-matrix-table {
        min-width: 700px;
    }
}
