body {
    margin: 0;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

a:link, a:visited {
    text-decoration: none;
    color: #FFF;
}

.note-block a:link,
.note-block a:visited {
    color: #006;
    text-decoration: underline;
}

h1 {
    margin-top: 0;
}

form {
    position: relative;
}
form label {
    display: inline-block;
    position: relative;
    margin-top: 24px;
}
form label input {
    position: relative;
    z-index: 1;
    padding: 4px 6px;
}
form label span {
    position: absolute;
    z-index: 2;
    left: 8px;
    top: 4px;
    pointer-events: none;
    font-size: 16px;
    color: #777;
    transition: all 0.2s linear;
}
form label input:focus + span,
form label input:-webkit-autofill + span,
form label input.filled + span {
    top: -18px;
    font-size: 12px;
}

input {
    padding: 4px;
    border: 1px solid #666;
    background-color: #EEE;
}
input[type="submit"],
input[type="button"] {
    min-width: 96px;
    border-radius: 3px;
    box-shadow: 1px 1px 0 #EEE inset, 2px 2px 0 #FFF inset;
}

.form {
    display: inline-flex;
    flex-direction: column;
}

form .invalid {
    outline: 2px solid #F00;
}

.header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 32px;
    border-bottom: 1px solid #666;
    position: absolute;
    top: 0;
    left: 0;
    color: #FFF;
    background: linear-gradient(180deg, rgba(51, 51, 51, 0) 0%, rgba(34, 34, 34, 1) 100%),
            repeating-linear-gradient(-55deg, #222, #222 10px, #333 10px, #333 20px);
    padding: 0 8px;
    box-sizing: border-box;
    z-index: 1024;
}
.header a:link, .header a:visited {
    color: #FFF;
}
.header .logo {
    display: inline-block;
    position: absolute;
    left: 8px;
    top: auto;
}
.header .manage-cookies-shorten {
    display: inline;
}
.header .menu {
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    margin-right: 8px;
}

#languageSelect {
    font-size: 12px;
}
#languageSelect .selected-text {
    margin-right: 4px;
}

.list-container {
    display: inline-block;
    position: relative;
    width: auto;
    height: 26px;
    border: 1px solid #000;
    background-color: transparent;
    color: #000;
    cursor: default;
    user-select: none;
}
.list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: auto;
    min-width: 80px;
    position: absolute;
    right: 0;
    top: 26px;
    background-color: transparent;
}
.list-container.open .list {
    display: inline-flex;
}
.list-element {
    margin-top: 2px;
    cursor: pointer;
}
.list-element-selected {
    padding: 0 4px;
}
.list-container.open .list-element-selected .caret {
    transform: rotate(180deg);
}
.list-element-selected:hover {
    box-shadow: -1px -1px 0 #BBB inset;
}
.list-element-selected,
.list-element {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 24px;
    background-color: #FFF;
    border: 1px solid #000;
}
.list-element-selected img,
.list-element img {
    height: 14px;
    padding-right: 4px;
    width: auto;
}

.forbidden403 {
    display: block;
    font-size: 64px;
    font-family: 'Arial', sans-serif;
    text-shadow: 1px 1px 0 #000;
    margin-top: 32px;
}

.footer a:link {
    font-weight: bold;
    color: #FFF;
    text-shadow: 1px 1px 0 #000;
    margin: 0 8px;
}


/* --- mainpage start --- */
body.mainpage {
    min-height: calc(100vh - 96px);
    margin: 64px 0 32px 0;
    padding: 0 16px;
    box-sizing: border-box;
    background: #FFF url('../img/mainpage_background.webp') no-repeat fixed center / cover;
    max-width: 100vw;
}
body.mainpage .login-form,
body.mainpage .registration-form {
    display: inline-block;
    padding: 0 16px 32px;
    background: #EEE;
    border-radius: 0;
    box-shadow: 4px 2px 1px rgb(0, 0, 0, 0.4);
    min-width: 194px;
}
body.mainpage .login-form:before,
body.mainpage .registration-form:before {
    content: "";
    display: inline-block;
    width: 100%;
    height: 26px;
    box-sizing: border-box;
    background: transparent url('../img/spiral.png') repeat-x 0 0;
    position: relative;
    top: -7px;
    left: 0;
    pointer-events: none;
    z-index: 2;
}
body.mainpage .error-container {
    display: block;
    margin: 16px;
    background-color: #FFADAD;
    border-left: 2px solid #F00;
    padding: 4px;
}
body.mainpage .info-container {
    display: block;
    margin: 16px;
    background-color: #adb4ff;
    border-left: 2px solid #00F;
    padding: 4px;
}
body.mainpage .footer {
    margin: 32px 0;
}
/* --- mainpage end --- */

/* --- notebook start --- */
body.notebook {
    min-height: calc(100vh - 96px);
    margin: 48px 0 32px 0;
    padding: 0 16px;
    box-sizing: border-box;
    background: #FFF;
    max-width: 100vw;
}
body.notebook .footer {
    margin: 16px 0;
}
body.notebook :not(.header) a:link,
body.notebook :not(.header) a:visited {
    color: #008;
    text-shadow: none;
}
body.notebook .add-note-btn {
    display: block;
    width: calc(80vw - 32px);
    max-width: 512px;
    height: auto;
    padding: 12px 16px;
    box-sizing: border-box;
    margin: 8px auto;
    background-color: #DDD;
    border: 2px solid #000;
    border-radius: 8px;
    box-shadow: 2px 2px 0 #FFF inset;
    position: relative;
    left: 0;
    top: 0;
    cursor: pointer;
}
body.notebook .add-note-btn:active {
    box-shadow: -2px -2px 0 #000 inset;
    left: 1px;
    top: 2px;
}
/* --- notebook end --- */

.notebook-container {
    position: relative;
}

.note-modal {
    display: block;
    width: 100vw;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 8;
}
.note-modal form {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 32px);
    max-width: 600px;
    margin: 40px auto;
    background-color: #FFF;
    border: 1px solid #000;
    box-shadow: 2px 4px 8px #000;
}
.note-modal form input,
.note-modal form textarea {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    border: none;
    background-color: transparent;
    color: #000;
    padding: 10px 8px;
    margin: 0;
}
.note-modal form textarea {
    resize: none;
    max-height: 50vh;
}

.note-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 32px;
}
.note-list .note {
    display: inline-block;
    padding: 0 16px 16px;
    background: #EEE;
    border-radius: 0;
    box-shadow: 4px 2px 1px rgb(0, 0, 0, 0.4);
    min-width: 194px;
    text-align: left;
    margin: 12px;
}
.note-list .note:before {
    content: "";
    display: inline-block;
    width: 100%;
    height: 26px;
    box-sizing: border-box;
    background: transparent url('../img/spiral.png') repeat-x 0 0;
    position: relative;
    top: -7px;
    left: 0;
    pointer-events: none;
    z-index: 2;
}
.note-list .note .title {
    font-weight: bold;
    margin-bottom: 4px;
    padding-right: 24px;
    box-sizing: border-box;
    position: relative;
    word-wrap: break-word;
}
.note-list .note .description {
    max-height: 50vh;
    overflow-x: hidden;
    overflow-x: auto;
    white-space: pre-line;
    word-wrap: break-word;
}
.note-list .note .title .btn-settings {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: transparent url('../img/icon_settings.png') no-repeat center / contain;
    position: absolute;
    right: 0;
    top: 0;
    opacity: 0.6;
    cursor: pointer;
}
.note-list .note .title .btn-settings:hover,
.note-list .note .title .btn-settings:active {
    opacity: 1;
}

.header-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.settings-btn {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: transparent url('../img/icon_settings.png') no-repeat center / contain;
    cursor: pointer;
    margin: 0 12px;
    position: relative;
}
.settings-btn:hover {
    transform: scale(1.1);
}
.settings-btn:active {
    left: 1px;
    top: 2px;
    transform: none;
}

.note-settings-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 0;
    top: 0;
    border: none;
    background-color: rgb(255, 255, 148);
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 5;
}
.note-settings-panel:before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgb(255, 253, 148);
    position: absolute;
    right: 8px;
    top: -10px;
    filter: drop-shadow(0 -4px 4px rgba(0, 0, 0, 0.5));
}
.note-settings-panel:after {
    content: "";
    display: block;
    width: 28px;
    height: 4px;
    position: absolute;
    right: 4px;
    top: 0;
    background-color: rgb(255, 255, 148);
}
.note-setting {
    display: block;
    width: 100%;
    padding: 4px;
    cursor: pointer;
}
.note-setting:hover {
    background-color: rgb(230, 230, 41);
}
.btn-note-settings-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    padding: 4px;
    margin-right: 2px;
    box-sizing: border-box;
    align-self: flex-end;
}

.hidden { display: none !important; }
.t-shadow { text-shadow: 1px 1px 0 #000; }
.t-shadow-strong { text-shadow: 1px 1px 0 #000, 0 0 12px rgba(0, 0, 0, 0.8); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-64 { margin-top: 64px; }

@media (max-width: 400px) {
    .header .manage-cookies-shorten {
        display: none;
    }
}

/* mobile size */
@media (max-width: 799px) or (pointer: coarse) {

}
