/*
    The "What best describes you?" question.
    Used by the sign-up form and the accounts:user-type page
    (accounts/templates/accounts/includes/user_type_question.html).
*/

.rs-user-type-question {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.rs-user-type-legend {
    color: #0d1a2b;
    float: none;
    font-size: 0.78rem;
    font-weight: 800;
    margin: 0;
    padding: 0;
    width: auto;
}

.rs-user-type-help {
    color: #5b6b7f;
    font-size: 0.78rem;
    line-height: 1.35;
    margin: 0.15rem 0 0.55rem;
}

.rs-user-type-options {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: minmax(0, 1fr);
}

/* One answer: a card with an icon, a title, a lighter line, and a check mark when picked. */
.rs-user-type-option {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d5e0ec;
    border-radius: 0.9rem;
    cursor: pointer;
    display: flex;
    gap: 0.85rem;
    margin: 0;
    min-height: 4rem;
    padding: 0.7rem 0.9rem;
    position: relative;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.rs-user-type-option:hover {
    border-color: #0d1a2b;
}

/* The radio button is hidden from sight only; the card shows the choice. */
.rs-user-type-input {
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 1px;
}

.rs-user-type-icon {
    align-items: center;
    color: #0d1a2b;
    display: flex;
    flex: 0 0 auto;
    font-size: 1.55rem;
    height: 2.2rem;
    justify-content: center;
    width: 2.2rem;
}

/* The site sets its own size on icons, so the size is set on the icon itself. */
.rs-user-type-icon .bi {
    font-size: 1.6rem;
    line-height: 1;
}

.rs-user-type-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

/* 16px so iPhones do not zoom in when an answer is tapped. */
.rs-user-type-label {
    color: #0d1a2b;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.rs-user-type-hint {
    color: #6b7a8c;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.3;
}

/* The check mark: hidden until its answer is picked. */
.rs-user-type-check {
    align-items: center;
    background: linear-gradient(90deg, #2dd4bf, #43c8f7);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    flex: 0 0 auto;
    font-size: 0.95rem;
    height: 1.6rem;
    justify-content: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
    width: 1.6rem;
}

/* The picked answer. */
.rs-user-type-option:has(.rs-user-type-input:checked) {
    background: #f3fdfb;
    border-color: #0d1a2b;
    box-shadow: 0 0 0 1px #0d1a2b;
}

.rs-user-type-option:has(.rs-user-type-input:checked) .rs-user-type-check {
    opacity: 1;
    transform: scale(1);
}

/* Keyboard focus. */
.rs-user-type-option:has(.rs-user-type-input:focus-visible) {
    outline: 2px solid #0b7797;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .rs-user-type-option,
    .rs-user-type-check {
        transition: none;
    }
}

.rs-user-type-question--error .rs-user-type-option {
    border-color: #e6a4a4;
}

.rs-user-type-error {
    color: #b42318;
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0.5rem 0 0;
}

/* The question page: the card grows with its content. */
.rs-user-type-card {
    min-height: 0;
    padding-bottom: 1.6rem;
}

.rs-user-type-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Dark theme. */
[data-theme="dark"] .rs-user-type-legend,
[data-theme="dark"] .rs-user-type-label,
[data-theme="dark"] .rs-user-type-icon {
    color: #e6edf5;
}

[data-theme="dark"] .rs-user-type-help,
[data-theme="dark"] .rs-user-type-hint {
    color: #a9b8c9;
}

[data-theme="dark"] .rs-user-type-option {
    background: #142233;
    border-color: #2c4159;
}

[data-theme="dark"] .rs-user-type-option:hover {
    border-color: #e6edf5;
}

[data-theme="dark"] .rs-user-type-option:has(.rs-user-type-input:checked) {
    background: #12332f;
    border-color: #2dd4bf;
    box-shadow: 0 0 0 1px #2dd4bf;
}

[data-theme="dark"] .rs-user-type-error {
    color: #ffb4a8;
}
