* {
    box-sizing: border-box;
}

:root {
    --color-orange: #FF6B30;
    --color-orange-accent: #e86a33;
    --color-grey: #e1e1e1;
    --color-red: #c80046;
    --color-text: #414b55;
    --color-background: #FAFAFAFF;
    --color-background-accent: #FFF;
}

html {
    min-height: 100vh;
    display: flex;
}

body {
    display: flex;
    background-color: var(--color-background);
    flex-direction: column;
    align-items: center;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    min-height: 100vh;
    width: 100vw;
    color: var(--color-text);
}

.page {
    display: flex;
    flex-direction: column;
    padding: 15px;
    flex-grow: 1;
    max-width: 960px;
    word-break: break-word;
}

.center {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.row {
    flex-direction: row;
}

#titlebar {
    background: url("/banner.svg") no-repeat bottom;
    background-size: cover;
    padding: 15px 15px 30px 15px;
    width: 100%;
    display: flex;
    align-items: center;
}

#titlebar > h1 {
    margin: 0 10px 0 10px;
    color: white;
    font-size: 32px;
    font-weight: 700;
    flex-grow: 1;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
}

#titlebar > img {
    max-height: 37px;
    border-radius: 3px;
    cursor: pointer;
}

#titlebar a {
    color: white;
    margin: 0 10px;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
}

#titlebar > #toggle-mobile-nav {
    display: none;
}

#titlebar a:hover {
    box-shadow: 0 3px rgba(255, 255, 255, 0.6);
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

input {
    border: 3px solid var(--color-grey);
    color: var(--color-text);
    border-radius: 32px;
    padding: 12px 20px;
    font-size: 18px;
    outline: 0;
    margin-bottom: 20px;
    min-width: 350px;
    background: var(--color-background-accent);
    transition: border 0.2s ease;
}

input:focus {
    border: 3px solid var(--color-orange);
}

input::placeholder {
    text-align: center;
}

button,
.button {
    border: 0;
    text-decoration: none;
    background-color: var(--color-orange);
    color: white;
    font-size: 21px;
    padding: 10px 25px;
    border-radius: 32px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: bold;
    display: flex;
    justify-content: center;
    cursor: pointer;
    outline: 0;
    margin-bottom: 20px;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.1s ease;
}

button:hover,
.button:hover {
    background-color: #ed6d35;
}

.book-cover {
    box-shadow: 1px 1px 5px 1px rgba(70, 70, 70, 0.2);
    border-radius: 6px;
    max-height: 400px;
    max-width: 256px;
}

.book-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 20px;
    margin-left: 30px;
}

.book-info .avatar {
    border-radius: 50%;
    max-height: 45px;
    margin-left: 5px;
}

.book-info h1 {
    margin: 0 0 10px 0;
}

.book-info h3 {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin: 0 0 5px 0;
}

.book-info p {
    word-break: break-word;
}

.book-info button {
    font-size: 19px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(70, 70, 70, 0.6);
    justify-content: center;
    align-items: center;
}

.modal > div {
    display: flex;
    padding: 30px;
    margin: 10px;
    border-radius: 3px;
    box-shadow: 1px 1px 5px 1px rgba(50, 50, 50, 0.2);
    background-color: var(--color-background);
    flex-direction: column;
    align-items: center;
}

.modal > div > h1 {
    margin: 0 0 20px 0;
    font-weight: 500;
    font-size: 21px;
}

.modal > div > p {
    margin: 0 0 20px 0;
    font-weight: 400;
    font-size: 16px;
}

.active {
    display: flex!important;
}

.lds-ring {
    display: inline-block;
    position: relative;
    width: 48px;
    height: 48px;
}

.lds-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-orange);
    border-radius: 50%;
    animation: lds-ring 0.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--color-orange) transparent transparent transparent;
}

.lds-ring div:nth-child(1) {
    animation-delay: -0.15s;
}

.lds-ring div:nth-child(2) {
    animation-delay: -0.1s;
}

.lds-ring div:nth-child(3) {
    animation-delay: -0.05s;
}

@keyframes lds-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    color: var(--color-red);
    text-align: center;
}

code {
    padding: 5px 10px;
    background-color: var(--color-grey);
    color: var(--color-text);
    border-radius: 8px;
    word-break: break-word;
}

a {
    color: var(--color-orange-accent);
}

@media only screen and (max-width: 920px) {
    h1 {
        font-size: 30px;
    }

    #titlebar > nav {
        position: absolute;
        top: 58px;
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: center;
        background-color: var(--color-orange);
        padding: 10px;
        left: 0;
    }

    #titlebar > nav > a {
        margin: 5px 0;
    }

    #titlebar > h1 {
        display: none;
    }

    #titlebar > #toggle-mobile-nav {
        display: block;
        margin-left: auto;
    }

    .page {
        text-align: center;
    }

    .row {
        flex-direction: column;
        align-items: center;
    }

    input {
        min-width: 300px;
    }

    .book-cover {
        margin-bottom: 20px;
    }

    .book-info {
        text-align: center;
        align-items: center;
        margin: 0;
        padding: 0;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #1e1e1e;
        --color-background-accent: #191919;
        --color-text: #e1e3e6;
        --color-grey: #505050;
        --color-red: #c80046;
    }
}
