:root {
    --app-c-gray-light: #eee;
    --app-c-gray: #2a2a2a;
    --app-c-green: #91f591;
    --app-c-orange: #f58432;
    --app-c-red: #ff5c68;
    --app-c-yellow: #ffc333;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: clamp(0.5em, 0.3182em + 0.9091vw, 1em);
}

body {
    font: 1rem/1.25 Rubik, ui-system, sans-serif;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
blockquote {
    line-height: 1.25;
    text-wrap: balance;
}

h1 {
    font-size: 4rem;
}

h2 {
    font-size: 3rem;
}

h3 {
    font-size: 2rem;
}

h4 {
    font-size: 1rem;
}

h5 {
    font-size: 0.75rem;
}

h6 {
    font-size: 0.5rem;
}

p {
    line-height: 2;
    margin-block: 2em;
    text-wrap: pretty;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    border: 0.0625rem solid #ccc;
    color: inherit;
    font: inherit;
    line-height: inherit;

    &:focus-visible {
        outline: 0.0625rem solid #666;
    }
}

textarea {
    min-height: 15em;
    width: 100%;
}

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.layout-header {
    align-items: center;
    background-color: var(--app-c-gray);
    color: #fff;
    display: flex;
    gap: 2rem;
    padding: 1rem;

    & a {
        color: inherit;
        text-decoration: none;
    }
}

.layout-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 2rem;
}

.layout-footer {
    background-color: var(--app-c-gray);
    padding: 1rem;
}

.logo-img {
    width: 8.75rem;
}

.brand-link {
    display: block;
}

.header-nav {
    align-items: center;
    display: flex;
    gap: 2rem;
}

.header-profile {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-inline-start: auto;
}

.page-title {
    margin-inline: auto;
    text-align: center;
}

.pagination-panel {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.button {
    --app-button-bg-c: var(--app-c-orange);

    align-items: center;
    background-color: var(--app-button-bg-c);
    border: none;
    border-radius: 0.5em;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    padding: 0.75em 1em;
    transition: scale 0.2s;
    text-decoration: none;

    &[data-button-variant='ghost'] {
        --app-button-bg-c: transparent;
        color: var(--app-c-orange);
        outline: 0.0625rem solid var(--app-c-orange);
        outline-offset: -0.0625rem;
    }

    &:hover {
        scale: 1.05;
    }
}

.container {
    margin-inline: auto;
    max-width: 75rem;
    width: 100%;
}

.container-auto {
    width: auto;
}

.container-center {
    margin-block: auto;
}

.input-text {
    padding: 0.75em;
}

.question-page {
    padding: 2rem;
}

.page-header {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.exam-header {
    --exam-header-bg-c: transparent;

    background-color: var(--exam-header-bg-c);
    margin: -2rem -2rem 2rem;
    padding-inline: 2rem;

    &[data-header='instruction'] {
        --exam-header-bg-c: var(--app-c-gray-light);
    }

    &[data-header='test'] {
        --exam-header-bg-c: var(--app-c-yellow);
    }

    &[data-header='test-success'] {
        --exam-header-bg-c: var(--app-c-green);
    }

    &[data-header='test-failed'] {
        --exam-header-bg-c: var(--app-c-red);
    }
}

.form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0;
    max-width: 30rem;
}

.form-full {
    max-width: none;
}

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

.form-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    &[data-direction='horizontal'] {
        align-items: center;
        flex-direction: row;
        gap: 1rem;
    }
}

.form-action-box {
    display: flex;
    gap: 1rem;

    & > * {
        flex: 1;
    }
}

.table {
    width: 100%;

    & th {
        line-height: 1.5;
        padding: 1em;
        text-align: left;
    }

    & td {
        border-top: 0.0625rem solid #ccc;
        line-height: 1.5;
        padding: 1em;
        text-align: left;
    }
}

.table-actions {
    display: flex;
    gap: 0.5em;
}

.tab {
    display: none;

    &[data-active] {
        display: block;
    }
}

.tab-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-block-start: 4rem;
}

.input-checkbox {
    appearance: none;
    border: 0.0625rem solid var(--app-c-orange);
    display: flex;
    height: 1.5em;
    margin: 0;
    padding: 0;
    position: relative;
    width: 1.5em;

    &:not(:disabled) {
        cursor: pointer;
    }

    &:checked {
        &::before {
            background-color: var(--app-c-orange);
            content: '';
            display: block;
            inset: 0.25rem;
            position: absolute;
        }
    }

    &:focus-visible {
        outline-color: var(--app-c-orange);
    }
}

.user-answer-status {
    &[data-answer-status] {
        outline-offset: 0.5rem;
    }

    &[data-answer-status='1'] {
        outline: 0.125rem solid var(--app-c-green);
    }

    &[data-answer-status='-1'] {
        outline: 0.125rem solid var(--app-c-red);
    }
}

.ml-auto {
    margin-inline-start: auto;
}

.fc-license-message {
    display: none;
}

.fc-scrollgrid-sync-table td {
    cursor: pointer;
}
