/* HWSI module (Pages/HwsiPage.razor, Components/HwsiPairChoice.razor). Every rule starts with .hwsi. */

.hwsi {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.hwsi-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.hwsi-language {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1rem;
}

/* The intro: the title with the language under it, as wide as the text. */
.hwsi-intro-head {
    max-width: 46rem;
    margin-bottom: 1.25rem;
}

.hwsi-language select {
    width: auto;
}

.hwsi-intro {
    max-width: 46rem;
    font-size: 1.05rem;
    line-height: 1.55;
}

.hwsi-example {
    background: #f7f7f9;
    border: 1px solid #e2e2e8;
    border-radius: .5rem;
    padding: 1rem 1.25rem .5rem;
    margin: 1.25rem 0;
}

.hwsi-example-label {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: .5rem;
}

.hwsi-example .hwsi-pair {
    background: #fff;
}

.hwsi-intro-nav {
    max-width: 46rem;
}

.hwsi-example-read {
    margin: .25rem 0 .25rem;
}

.hwsi-progress {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.5rem;
    align-items: center;
    margin-bottom: .75rem;
    color: #555;
}

.hwsi-progress progress {
    flex: 1 1 200px;
    height: .6rem;
}

.hwsi-heading::first-letter {
    text-transform: uppercase;
}

.hwsi-heading {
    font-size: 1.25rem;
    margin: .5rem 0 1rem;
}

.hwsi-nav {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.hwsi-pair {
    border: 1px solid #ccc;
    border-radius: .5rem;
    padding: .75rem 1rem 1rem;
    margin-bottom: 1rem;
}

.hwsi-legend {
    font-size: 1rem;
    font-weight: 600;
    float: none;
    width: auto;
    padding: 0 .25rem;
    margin-bottom: .5rem;
}

.hwsi-sides {
    display: flex;
    gap: 1rem;
}

/* Each side: the statement, then its options. On wide screens the second side is mirrored, so the strongest
   option is next to its statement on both sides: A | much little | little much | B. */
.hwsi-side {
    flex: 1 1 0;
    display: flex;
    gap: .75rem;
    align-items: center;
}

.hwsi-side-second {
    flex-direction: row-reverse;
}

.hwsi-statement {
    flex: 1 1 auto;
    margin: 0;
    padding: .5rem .75rem;
    border-radius: .35rem;
    /* The share of the pair the choice gives the statement (--hwsi-fill, 0 to 1, set by HwsiPairChoice), as a fill
       from the left. No fill before a choice. */
    background: linear-gradient(#cfe5c0, #cfe5c0) no-repeat left / calc(var(--hwsi-fill, 0) * 100%) 100%, #f1ede4;
    transition: background-size .25s ease;
}

@media (prefers-reduced-motion: reduce) {
    .hwsi-statement {
        transition: none;
    }
}

.hwsi-options {
    display: flex;
    gap: .5rem;
}

.hwsi-side-second .hwsi-options {
    flex-direction: row-reverse;
}

.hwsi-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    width: 6.5rem;
    text-align: center;
    font-size: .85rem;
    cursor: pointer;
}

.hwsi-option input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.hwsi-option input:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* Narrow screens: one side below the other, statement first, options in a row under it. */
@media (max-width: 720px) {
    .hwsi-sides,
    .hwsi-side,
    .hwsi-side-second {
        flex-direction: column;
        align-items: stretch;
    }

    .hwsi-options,
    .hwsi-side-second .hwsi-options {
        flex-direction: row;
        justify-content: center;
    }

    .hwsi-option {
        flex-direction: row;
        width: auto;
        gap: .4rem;
    }
}

/* The banner of the HWSI test (Shared/HwsiLayout.razor). */
.hwsi-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .65rem 1.5rem;
    background: #fff;
    border-top: 4px solid #B60C1C;
    border-bottom: 1px solid #e3e3e3;
}

.hwsi-banner-product {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.hwsi-banner-mark {
    flex: none;
}

.hwsi-banner-name {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    min-width: 0;
}

.hwsi-banner-short {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #1f2a37;
}

.hwsi-banner-long {
    font-size: 1.05rem;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hwsi-banner-logo {
    flex: none;
    height: 35px;
    width: auto;
    border-radius: 4px;
}

@media (max-width: 720px) {
    .hwsi-banner {
        padding: .5rem 1rem;
    }

    .hwsi-banner-long {
        display: none;
    }

    .hwsi-banner-logo {
        height: 28px;
    }
}

/* The summary per role after the test (HwsiPage, completed view). */
.hwsi-summary {
    max-width: 46rem;
    margin: 1.5rem 0;
}

.hwsi-roles {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.hwsi-role {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) 1fr 2.5rem;
    gap: .75rem;
    align-items: center;
    padding: .35rem 0;
    border-bottom: 1px solid #eee;
}

.hwsi-role-bar {
    position: relative;
    display: block;
    height: .85rem;
    background: #f1ede4;
    border-radius: .45rem;
}

.hwsi-role-fill {
    display: block;
    height: 100%;
    background: #B60C1C;
    border-radius: .45rem;
}

/* The average of everyone who has taken the test: a thin dark line across the bar. */
.hwsi-role-mean {
    position: absolute;
    top: -.3rem;
    bottom: -.3rem;
    width: 3px;
    margin-left: -1.5px;
    background: #1f2a37;
    border-radius: 2px;
    box-shadow: 0 0 0 1.5px #fff;
}

.hwsi-summary-legend {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #444;
    font-size: .95rem;
}

.hwsi-legend-mark {
    display: inline-block;
    width: 3px;
    height: 1.1rem;
    background: #1f2a37;
    border-radius: 2px;
}

/* The profile (11.1d): the top group in a frame, the other roles toned down, the interval as a light band. */
.hwsi-top {
    background: #fbeef0;
    border: 1px solid #f0c9ce;
    border-radius: .6rem;
    padding: .25rem .6rem .15rem;
    margin: 1rem 0 .25rem;
}

.hwsi-top .hwsi-roles {
    margin: 0;
}

.hwsi-top .hwsi-role:last-child {
    border-bottom: 0;
}

.hwsi-top-label {
    margin: .2rem 0 0;
    font-weight: 500;
    color: #8a0a16;
}

.hwsi-roles-rest {
    margin-top: 0;
    padding: 0 .6rem;
}

.hwsi-role-other .hwsi-role-fill {
    background: #d9858d;
}

.hwsi-role-other .hwsi-role-name,
.hwsi-role-other .hwsi-role-value {
    color: #6b7280;
}

.hwsi-role-band {
    position: absolute;
    top: -.25rem;
    bottom: -.25rem;
    background: rgba(182, 12, 28, .18);
    border: 1px solid rgba(182, 12, 28, .45);
    border-radius: .3rem;
}

.hwsi-role-other .hwsi-role-band {
    background: rgba(107, 114, 128, .14);
    border-color: rgba(107, 114, 128, .35);
}

.hwsi-profile-legend {
    flex-wrap: wrap;
    gap: .4rem 1.2rem;
    margin-top: .8rem;
}

.hwsi-profile-legend > span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.hwsi-legend-top,
.hwsi-legend-band {
    display: inline-block;
    width: 1.6rem;
    height: .9rem;
    border-radius: .25rem;
}

.hwsi-legend-top {
    background: #fbeef0;
    border: 1px solid #f0c9ce;
}

.hwsi-legend-band {
    background: rgba(182, 12, 28, .18);
    border: 1px solid rgba(182, 12, 28, .45);
}

.hwsi-band-explain {
    color: #555;
    font-size: .9rem;
    margin: .6rem 0 0;
}

.hwsi-comment {
    background: #f6f7f9;
    border-left: 4px solid #B60C1C;
    padding: .7rem 1rem;
    margin: 1.2rem 0 .6rem;
}

.hwsi-role-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #444;
}

@media (max-width: 720px) {
    .hwsi-role {
        grid-template-columns: 1fr 2.5rem;
    }

    .hwsi-role-bar {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* The confirmation before the test is submitted (last step). */
.hwsi-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(31, 42, 55, .45);
}

.hwsi-dialog {
    width: 100%;
    max-width: 30rem;
    background: #fff;
    border-radius: .6rem;
    padding: 1.25rem 1.5rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.hwsi-dialog .hwsi-heading {
    margin-top: 0;
}

/* The dimensions after the roles: a bipolar line per dimension, the middle marked, a dot where the respondent is. */
.hwsi-dims {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.hwsi-dim {
    display: grid;
    grid-template-columns: minmax(6rem, 10rem) 1fr minmax(6rem, 10rem);
    gap: .25rem .75rem;
    align-items: center;
    padding: .6rem 0;
    border-bottom: 1px solid #eee;
}

.hwsi-dim-pole {
    color: #6b7280;
    overflow-wrap: anywhere;
}

.hwsi-dim-left {
    text-align: right;
}

.hwsi-dim-strong {
    color: #1f2a37;
    font-weight: 500;
}

.hwsi-dim-track {
    position: relative;
    height: 1rem;
    background: #f1ede4;
    border-radius: .5rem;
}

.hwsi-dim-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #B60C1C;
    border-radius: .5rem;
}

.hwsi-dim-mid {
    position: absolute;
    left: 50%;
    top: -.35rem;
    bottom: -.35rem;
    width: 2px;
    margin-left: -1px;
    background: #9ca3af;
}

.hwsi-dim-dot {
    position: absolute;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin: -.5rem 0 0 -.5rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #B60C1C;
    box-sizing: border-box;
}

.hwsi-dim-word {
    grid-column: 2;
    text-align: center;
    font-size: .9rem;
    color: #555;
}

@media (max-width: 720px) {
    .hwsi-dim {
        grid-template-columns: 1fr 1fr;
    }

    .hwsi-dim-left {
        text-align: left;
    }

    .hwsi-dim-pole:not(.hwsi-dim-left) {
        text-align: right;
    }

    .hwsi-dim-track,
    .hwsi-dim-word {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .hwsi-dim-track {
        order: 3;
    }

    .hwsi-dim-word {
        order: 4;
    }
}
