.container > .card {
    max-height: 95vh;
    overflow-x: hidden;
    overflow-y: scroll;
}

body {
    background-color: #EB671B;
    background-image: url("/images/bg.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.new-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.login-form {
    width: 30rem;
    max-width: 100%;
    margin: 0 auto;
}

.new-form-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.new-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.new-input > span {
    font-weight: 600;
}

.new-input > input, select {
    padding: 0.5rem 1rem !important;
    border-radius: 9999px !important;
    border: 1px solid #D1D5DB !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.new-input > input:focus {
    outline: none;
    border-color: #F59E0B;
}

.new-radio-input {
    display: grid;
    grid-template-columns: 1rem 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 1rem !important;
    border-radius: 9999px !important;
    border: 1px solid #D1D5DB !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.new-radio-input > input {
    height: 1rem;
    width: 1rem;
    appearance: none;
    border-radius: 9999px;
    border: 2px solid #9C9C9F;
}

.new-radio-input > input:checked {
    background-image: url("/images/icons/ratio-checked.svg");
    border: none;
}

.new-image-radio-input{
    display: grid;
    grid-template-columns: 1rem 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 1rem !important;
    max-width: 100%;
    border-radius: 1rem !important;
    border: 1px solid #D1D5DB !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.new-image-radio-input > input {
    height: 1rem;
    min-width: 1rem;
    appearance: none;
    border-radius: 9999px;
    border: 2px solid #9C9C9F;
}

.new-image-radio-input > input:checked {
    background-image: url("/images/icons/ratio-checked.svg");
    border: none;
}

.answer-image {
    max-width: 100%;
    max-height: 7rem;
    object-fit: contain;
    justify-self: start;
}

.orange-button, .gray-button {
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    color: #FFF;
    border: none;
    width: fit-content;
}

.orange-button {
    background-color: #FF6700;
}

.gray-button {
    background-color: #3E3E3E;
}

.orange-button:focus, .gray-button:focus {
    outline: none;
}

.orange-button:hover, .gray-button:hover {
    color: white;
}

.quiz-card {
    padding: 2.5rem;
    border-radius: 1.5rem;
    background: #FFF;
    box-shadow: 10px 15px 20px -5px rgba(0, 0, 0, 0.40);
    width: 55rem;
    min-width: fit-content;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.quiz-card[data-small] {
    width: 45rem;
}

.quiz-card > .quiz-card-header {
    display: flex;
    justify-content: center;
    align-items: center;
}

.quiz-card > .quiz-card-header[data-auth] {
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.quiz-card > .errors-container {
    border: solid 1px #D83F31;
    padding: 0.5rem 1rem 0.5rem 2rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: #D83F31;
}

.tests-container {
    width: 100%;
    max-width: 40rem;
}

.tests-header-container {
    width: 100%;
    max-width: 450px;
}

.tests-to-complete-table-header {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.tests-to-complete-table-header > .header-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-weight: 700;
    border-bottom: 2px solid #999;
    padding-bottom: 0.25rem;
    width: 100%;
    max-width: 450px;
}

.tests-to-complete-table-header > .header-container p {
    margin: 0;
}

.tests-to-complete-table-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
}

.tests-to-complete-table-row > .items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 450px;
}

.tests-to-complete-table-row p {
    margin: 0;
    font-weight: 500;
}

.completed-tests-table-header {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.completed-tests-table-header > .header-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    font-weight: 700;
    border-bottom: 2px solid #999;
    padding-bottom: 0.25rem;
    width: 100%;
    max-width: 450px;
}

.completed-tests-table-header > .header-container p {
    margin: 0;
}

.completed-tests-table-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
}

.completed-tests-table-row > .items {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
    max-width: 450px;
}

.completed-tests-table-row p {
    margin: 0;
    font-weight: 500;
}

.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    width: 45rem;
    max-width: 100%;
    margin: 0 auto;
}

.quiz-container > .quiz-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.quiz-image-frame {
    margin: 0;
    display: flex;
    justify-content: center;
}

.quiz-image {
    border-radius: 1.5rem;
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 18rem;
    object-fit: contain;
}

/* Rich text authored in the admin CKEditor fields. */
.quiz-question-description,
.quiz-message {
    margin: 0;
}

.quiz-question-description {
    color: #4B5563;
}

.quiz-question-description p,
.quiz-message p {
    margin: 0 0 0.6rem;
}

.quiz-question-description ul,
.quiz-question-description ol,
.quiz-message ul,
.quiz-message ol {
    margin: 0 0 0.6rem;
    padding-left: 1.25rem;
}

.quiz-question-description > :last-child,
.quiz-message > :last-child {
    margin-bottom: 0;
}

.quiz-question-description a,
.quiz-message a {
    color: #C2410C;
}

.quiz-question-description img,
.quiz-message img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.quiz-container > .quiz-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* #quizContent sits between .quiz-body and its children, so it carries its own
   column layout and the selectors below stay descendant rather than direct-child. */
.quiz-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.quiz-content.is-hidden {
    display: none;
}

.quiz-body .quiz-info {
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.quiz-body .quiz-prompt h4 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.35rem;
}

.quiz-timer {
    align-self: flex-end;
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: #FFF4EC;
    border: 1px solid #F6D5BC;
    color: #B4460B;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.quiz-timer-value {
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    text-align: right;
}

.quiz-timer.is-low {
    background: #FDECEC;
    border-color: #F0BFBF;
    color: #B42318;
}

/* Intro/outro prose shares the same column as the question and its answers. */
.quiz-message {
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
}

/* Keeps the submit/continue button clear of the answers above it, and lines its
   right edge up with the column rather than the full card width. */
.quiz-actions {
    width: 100%;
    max-width: 30rem;
    margin: 2rem auto 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.quiz-questions {
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 40rem) {
    .ranking-columns {
        grid-template-columns: 1fr;
    }
}

.ranking-column-title {
    margin: 0 0 0.5rem;
    font-weight: 700;
    border-bottom: 2px solid #999;
    padding-bottom: 0.25rem;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    min-height: 7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px dashed #D1D5DB;
    border-radius: 1rem;
    counter-reset: ranking;
}

.ranking-item {
    padding: 0.5rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.75rem;
    background: #FFF;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: grab;
    user-select: none;
}

.ranking-item:hover {
    border-color: #FF6700;
}

.ranking-item.is-dragging {
    opacity: 0.4;
    cursor: grabbing;
}

[data-ranking-target] .ranking-item::before {
    counter-increment: ranking;
    content: counter(ranking) ". ";
    font-weight: 700;
    color: #FF6700;
}
