:root {
    --primary: #22A569;
    --primary-light: #ebf3f0;
    --primary-dark-first: #131313;
    --primary-dark-second: #072115;
    --primary-dark-third: #0E422A;
    --on-primary: #fff;
    --body: #fafafa;
    --on-body: #000;
    --on-body-light: #343434;
    --on-body-verylight: #787878;
    --surface: #eee;
    --border-color: #ddd;
    --on-surface: #000;
    --dialog-border-radius: 6px;
    --padding: 16px;
    --navbar-height: 72px;
}

@media (min-width: 768px) {
    :root {
        --padding: 42px;
    }
}

@media screen and (prefers-color-scheme: dark) {
    :root {
        --on-primary: #fff;
        --body: #1D1D1D;
        --on-body: #fff;
        --surface: #333;
        --on-surface: #fff;
    }

    * {
        color-scheme: dark;
    }
}

* {
    outline-color: var(--primary);
    outline-offset: 4px;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

small+h1 {
    margin-top: 2px;
}

small {
    display: inline-block;
    line-height: 16px;
    color: var(--on-body-verylight)
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

form {
    margin: 0;
}

main {
    min-height: 100%;
    background-color: var(--body);
    transition: transform 0.2s ease-out;
}

img {
    max-width: 100%;
    height: auto;
}

/* utils classes */

.autoflex,
.row {
    display: flex;
    gap: 16px;
}

.autoflex>* {
    flex: 1;
}

.center {
    align-items: center;
}

.flex.col {
    flex-direction: column;
}

@media (max-width: 900px) {
    .autoflex {
        flex-direction: column;
    }
}

header>nav {
    padding: 0 22px;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-dark-second);
    z-index: 9;
    position: sticky;
}

header .spacer {
    flex: 1;
}

header [aria-label=accueil] {
    padding-right: 48px;
}

[role=searchbox] {
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
}

[role=searchbox]>* {
    height: 100%;
}

[role=searchbox] input {
    width: 100vw;
    max-width: 430px;
    padding: 0 16px;
    border: none;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    font-size: 16px;
}

[role=searchbox] input::placeholder {
    color: #757575;
}

[role=searchbox] button {
    width: 48px;
    display: grid;
    place-items: center;
    background-color: var(--primary);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

[role=searchbox] aside {
    --side-search-width: 230px;
    display: none;
    background-color: white;
    position: absolute;
    top: 100%;
    left: 0;
    right: calc(48px - var(--side-search-width));
    height: auto;
    border-radius: 4px;
    border-top-left-radius: 0px;
    overflow: hidden;
}

[role=searchbox] aside::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: rgba(0, 0, 0, 0.4);
}

[role=searchbox] ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: calc(100% - var(--side-search-width));
}

[role=searchbox] aside>a {
    max-width: 100%;
    margin: 8px;
    text-decoration: none;
    color: var(--on-surface)
}

[role=searchbox]:focus-within input {
    border-bottom-left-radius: 0px;
}

[role=searchbox]:focus-within aside {
    display: flex;
}

[role=searchbox] ul li {
    cursor: pointer;
    max-width: 100%;
}

[role=searchbox] ul li a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    height: 100%;
}

[role=searchbox] ul li a:hover {
    background-color: var(--surface);
}

[role=searchbox] ul li a:focus-visible {
    outline-offset: -1px;
    outline: 1px dotted var(--on-surface);
    background-color: var(--surface);
}

input:focus {
    outline-offset: -1px;
    outline: 1px dotted var(--on-body);
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu ul li {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 16px;
}

.menu ul a {
    display: block;
    text-decoration: none;
    color: var(--on-surface);
}

.menu ul a:hover {
    background-color: var(--body);
}

.menu ul a:focus-visible {
    outline-offset: -1px;
    outline: 1px dotted var(--on-surface);
    background-color: var(--body);
}

.menu .links {
    padding: 0 16px;
    max-width: 320px;
    display: flex;
    gap: 2px 8px;
    flex-flow: row wrap;
    font-size: 14px;
    color: var(--on-body-verylight)
}

.menu .links a {
    text-decoration: underline;
    text-decoration-style: dotted;
    color: unset;
}

.card {
    border: 2px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.card.small {
    min-width: 220px;
    max-width: 220px;
}

.card.small img {
    height: 120px;
    width: 100%;
    object-fit: cover;
}

.card .inner {
    padding: 4px 12px;
}

.card p {
    font-size: 18px;
    margin: 0;
}

.card span {
    font-size: 14px;
    color: var(--on-body-verylight)
}

.card[aria-current=true] {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

nav.scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    font-size: 16px;
    color: #888;
}

label span {
    color: #323232;
}

label input {
    padding: 12px;
    border: none;
    background-color: transparent;
    font-size: 16px;
    width: 100%;
    border-bottom: 2px solid #8884;
    background-color: rgba(127, 127, 127, 0.05);
}

select {
    padding: 0 16px;
    width: 100%;
    height: 48px;
    border: none;
    background-color: rgba(127, 127, 127, 0.05);
    font-size: 16px;
    color: var(--on-body);
    border-bottom: 2px solid #8884;
}

button {
    padding: 4px 12px;
    border: none;
    background-color: transparent;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: bold;
}

.button {
    position: relative;
    padding: 0 32px;
    height: 42px;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background-color: var(--surface);
    color: var(--on-surface);
    border: none;
    border-radius: 2px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s ease-in, box-shadow 0.1s ease-in;
    overflow: hidden;
}

.button.shiny::before,
.button.shiny::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 100%;
    transform: skewX(-22deg);
    background-color: #fff2;
    animation: shiny 3s cubic-bezier(.92, .32, .58, .84) infinite;
}

.button.shiny::after {
    background-color: #fff1;
    width: 42px;
}

@keyframes shiny {
    from {
        left: -100%;
    }

    to {
        left: 110%;
    }
}

.button svg {
    fill: var(--on-surface);
    height: 22px;
    width: auto;
}

.button,
.button span {
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
    overflow: hidden;
}

.button.block {
    width: 100%;
}

.button.big {
    height: 52px;
    font-size: 16px;
}

.button.colored {
    background-color: var(--primary);
    color: var(--on-primary);
}

.button.colored svg {
    fill: var(--on-primary);
}

.button.flat {
    background-color: transparent;
    color: var(--on-surface);
    box-shadow: none;
}

.button.flat:hover {
    background-color: var(--surface);
    color: var(--on-surface);
}

.button:hover {
    filter: brightness(0.9);
}

.button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0);
}

.buttons {
    display: flex;
    gap: 8px;
}

@keyframes bottomSheetEnter {
    0% {
        transform: translateY(100%);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes bottomSheetExit {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(100%);
    }
}

@keyframes showBackdrop {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes hideBackdrop {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.helper {
    padding: 12px;
    position: absolute;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--primary);
    color: var(--on-primary);
}

.helper::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--primary) transparent;
}

.helper button {
    width: fit-content;
    align-self: flex-end;
    color: var(--on-primary);
}

.menu {
    position: relative;
    width: fit-content;
}

.menu dialog {
    padding: 12px 0;
    margin: 0;
    width: max-content;
    z-index: 99;
    border: none;
    background-color: var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform-origin: top left;
}

.menu .js-backdrop {
    position: fixed;
    inset: 0;
    background-color: var(--primary-dark-first);
    opacity: .5;
    cursor: text;
}

.menu.bottom.left dialog {
    left: unset;
    right: 0;
    top: 100%;
    transform-origin: top right;
}

.menu.top.right dialog {
    top: unset;
    bottom: 100%;
    left: 0;
    transform-origin: bottom left;
}

.menu.top.left dialog {
    top: unset;
    left: unset;
    bottom: 100%;
    right: 0;
    transform-origin: bottom right;
    overflow: hidden;
}

.menu.left.aside dialog {
    right: 100%;
}

.menu.right.aside dialog {
    left: 100%;
}

.menu dialog[open] {
    animation: showMenu .3s cubic-bezier(.25, -0.27, .08, .59);
}

@media (prefers-reduced-motion: reduce) {
    .menu dialog[open] {
        animation: none;
    }
}

.menu .content {
    padding: 16px;
}

.menu ul li {
    min-width: 170px;
}

.menu ul a,
.menu ul button {
    padding: 0;
    font-weight: inherit;
    text-transform: inherit;
    font-size: inherit;
    background-color: var(--surface);
}

@keyframes showMenu {
    0% {
        transform: scaleX(0) scaleY(0);
    }

    30% {
        transform: scaleX(1.05) scaleY(1);
    }

    100% {
        transform: scaleX(1) scaleY(1);
    }
}

progress {
    overflow: hidden;
    accent-color: var(--primary);
    position: relative;
    appearance: none;
    width: 100%;
    height: 4px;
    border: none;
}

progress::-webkit-progress-bar {
    background-color: var(--surface);
}

progress::-webkit-progress-value {
    background-color: var(--primary);
    transition: width .9s ease;
}

progress:indeterminate::before,
progress:indeterminate::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary);
}

progress:indeterminate::before {
    animation: progressLinearBefore 3s ease-in infinite;
}

progress:indeterminate::after {
    animation: progressLinearAfter 3s ease-out infinite;
}

@keyframes progressLinearBefore {
    0% {
        transform: translateX(-75%) scaleX(.5);
    }

    50% {
        transform: translateX(100%) scaleX(1);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes progressLinearAfter {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(-100%) scaleX(1);
    }

    95% {
        transform: translateX(100%) scaleX(0);
    }

    100% {
        transform: translateX(100%) scaleX(0);
    }
}

[aria-busy=true] {
    position: relative;
    user-select: none;
    pointer-events: none;
}

[aria-busy=true]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fffe;
    opacity: .5;
}

[aria-busy=true]::after {
    content: "";
    position: absolute;
    top: calc(50% - 20px);
    left: calc(50% - 20px);
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-sizing: border-box;
    border: 4px solid var(--primary);
    clip-path: polygon(50% 50%, 0% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
    animation: 1.6s to-loader linear infinite;
    background: none !important;
}

.completed::after {
    content: "";
}

@keyframes to-loader {
    0% {
        transform: rotate(0deg);
        clip-path: polygon(50% 50%, 0% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
    }

    20% {
        clip-path: polygon(50% 50%, 0% 0%, 50% 0%, 100% 0%, 100% 50%, 100% 50%, 100% 50%, 100% 50%, 100% 50%);
    }

    30% {
        clip-path: polygon(50% 50%, 0% 0%, 50% 0%, 100% 0%, 100% 50%, 100% 100%, 50% 100%, 50% 100%, 50% 100%);
    }

    40% {
        clip-path: polygon(50% 50%, 0% 0%, 50% 0%, 100% 0%, 100% 50%, 100% 100%, 50% 100%, 0% 100%, 0% 50%);
    }

    50% {
        clip-path: polygon(50% 50%, 50% 0%, 50% 0%, 100% 0%, 100% 50%, 100% 100%, 50% 100%, 0% 100%, 0% 50%);
    }

    60% {
        clip-path: polygon(50% 50%, 100% 50%, 100% 50%, 100% 50%, 100% 50%, 100% 100%, 50% 100%, 0% 100%, 0% 50%);
    }

    70% {
        clip-path: polygon(50% 50%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0% 100%, 0% 50%);
    }

    80% {
        clip-path: polygon(50% 50%, 0% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 50%);
    }

    90% {
        transform: rotate(360deg);
        clip-path: polygon(50% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%);
    }

    100% {
        clip-path: polygon(50% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%, 0% 50%);
    }
}

@media (min-width: 768px) {

    @keyframes panelEnter {
        0% {
            opacity: 0;
            transform: translateY(-3%);
        }

        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes panelExit {
        0% {
            opacity: 1;
            transform: translateY(0);
        }

        100% {
            opacity: 0;
            transform: translateY(3%);
        }
    }

    .modal header,
    .modal .content {
        padding: 16px 72px;
    }
}

@keyframes modalEnter {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalExit {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    10% {
        opacity: 0;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.modal {
    padding: 0;
    position: fixed;
    max-height: calc(100% - 72px);
    min-width: 320px;
    max-width: 600px;
    border: none;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--body);
    z-index: 99;
    border-radius: 3px;
    animation: modalExit 0.2s cubic-bezier(.46, .11, .56, .31) forwards;
}

.modal[open] {
    animation: modalEnter 0.3s cubic-bezier(.4, 0, 0, .97) forwards;
}

.modal::backdrop {
    background-color: #fffd;
    animation: hideBackdrop 0.s ease-in;
}

.modal header {
    padding: 16px var(--padding);
    position: sticky;
    top: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    border-bottom: 1px solid var(--surface);
    background-color: var(--body);
}

.modal header span {
    font-size: 22px;
}

.modal .content {
    padding: var(--padding);
}

@media (max-width: 900px) {
    .modal {
        margin: 0;
        padding: 0;
        position: fixed;
        left: 0;
        top: unset;
        bottom: 0;
        max-height: calc(100% - 72px);
        min-width: 100%;
        border: none;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        background-color: var(--body);
        animation: bottomSheetExit 0.2s cubic-bezier(.46, .11, .56, .31) forwards;
        z-index: 99;
    }

    .modal::backdrop {
        background-color: rgba(0, 0, 0, 0.5);
        animation: hideBackdrop 0.s ease-in;
    }

    .modal[open] {
        animation: bottomSheetEnter 0.3s cubic-bezier(.4, 0, 0, .97) forwards;
    }

    .modal[open]::backdrop {
        animation: showBackdrop 0.3s cubic-bezier(.4, 0, 0, .97);
    }

    .modal[open]~main {
        border-radius: var(--dialog-border-radius);
        transform: scale(0.9);
        transition: transform 0.3s ease-out;
    }
}