:root {
    --color-neutral-1: hsl(60 10% 99%);
    --color-neutral-2: hsl(60 10% 94%);
    --color-neutral-3: hsl(60 10% 90%);
    --color-neutral-4: hsl(60 10% 30%);
    --color-neutral-5: hsl(60 10% 5%);
    --color-primary-1: hsl(150 30% 80%);
    --color-primary-2: hsl(150 30% 34%);
    --color-accent-1: hsl(210 30% 88%);
    --color-accent-2: hsl(210 30% 80%);
    --color-accent-3: hsl(210 30% 40%);
    --color-alert-1: hsl(0 30% 88%);
    --color-alert-2: hsl(0 30% 40%);

    --size-0: calc(var(--size-1) * 0.5);
    --size-1: 0.875rem;
    --size-2: calc(var(--size-1) * 2);
    --size-3: calc(var(--size-1) * 3);
    --size-4: calc(var(--size-1) * 4);

    --font-size-0: calc(var(--font-size-1) * 0.75);
    --font-size-1: var(--size-1);
    --font-size-2: calc(var(--font-size-1) * 1.125);
    --font-size-3: calc(var(--font-size-1) * 1.25);

    --line-height: 1.6;
    --box-shadow-primary: 2px 2px var(--color-primary-1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--color-neutral-2);
}

body {
    color: var(--color-neutral-5);
    display: grid;
    grid-template-rows: min-content 1fr min-content;
    grid-template-areas:
        "header"
        "main"
        "footer";
    font-family: "IBM Plex Mono", monospace;
    font-size: var(--size-1);
    letter-spacing: -0.03rem;
    line-height: var(--line-height);
    min-height: 100dvh;
}

/* grid layout */

header,
main,
footer {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

body > header {
    grid-area: header;
    padding-top: var(--size-4);
}

body > main {
    grid-area: main;
}

body > footer {
    grid-area: footer;
    padding-bottom: var(--size-4);
}

@media only screen and (max-width: 720px) {
    body > header {
        padding-top: var(--size-0);
    }

    body > footer {
        padding-bottom: var(--size-0);
    }
}

/* wrapper defaults */

.container {
    display: flex;
    flex: 1;
    margin: 0 auto;
    max-width: 720px;
    padding: var(--size-1);
    width: 100%;
}

header .container {
    flex-direction: row;
    justify-content: space-between;
}

main .container {
    flex-direction: column;
}

section {
    margin-bottom: var(--size-2);
}

main header {
    margin-bottom: var(--size-2);
}

/* defaults */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: bold;
}

h1 {
    font-size: var(--font-size-3);
    margin-top: var(--size-1);
    margin-bottom: calc(var(--size-2) - 4px);
}

h2 {
    margin-bottom: var(--size-1);
}

h3,
h4,
h5,
h6 {
    margin-bottom: var(--size-0);
}

a {
    color: var(--color-primary-2);
}

p {
    margin-bottom: var(--size-1);
}

p:last-child {
    margin-bottom: 0;
}

textarea {
    line-height: inherit;
}

button {
    background: none;
    border: 1px solid;
    border-radius: 4px;
    box-shadow: var(--box-shadow-primary);
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

hr {
    margin-bottom: var(--size-2);
    border: none;
    border-bottom: 1px solid;
}

form label {
    display: block;
    margin-bottom: var(--size-0);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea {
    background: var(--color-neutral-1);
    border: 1px solid;
    box-shadow: var(--box-shadow-primary);
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: var(--size-1);
    width: 100%;
}

form input:focus,
form textarea:focus {
    outline: none;
}

form input::placeholder,
form textarea::placeholder {
    opacity: 0.6;
    color: inherit;
}

form button[type="submit"] {
    background: var(--color-primary-1);
    color: inherit;
    width: 100%;
    padding: var(--size-1);
}

form ul.errorlist {
    background: var(--color-alert-1);
    border: 1px solid;
    padding: var(--size-1);
}

form > ul.errorlist {
    margin-bottom: var(--size-1);
}

form label + ul.errorlist {
    margin-bottom: var(--size-0);
}

/* class targets */

img.icon {
    height: calc(var(--size-1) * 1.25);
}

a.logo {
    font-weight: bold;
    color: var(--color-primary-2);
    text-decoration: none;
}

div:has(> .logo) {
    display: flex;
    flex-direction: column;
}

form button.logout {
    background: var(--color-neutral-2);
    padding: var(--size-0);
}

.no-js-message {
    background: var(--color-alert-1);
    border: 1px solid;
    box-shadow: var(--box-shadow-primary);
    padding: var(--size-1);
}
