@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-Medium.ttf");
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-MediumItalic.ttf");
    font-style: italic;
    font-weight: 400;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-Bold.ttf");
    font-style: normal;
    font-weight: 700;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-BoldItalic.ttf");
    font-style: italic;
    font-weight: 700;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-SemiBold.ttf");
    font-style: normal;
    font-weight: 600;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-SemiBoldItalic.ttf");
    font-style: italic;
    font-weight: 600;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-Italic.ttf");
    font-style: italic;
    font-weight: 400;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-Light.ttf");
    font-style: normal;
    font-weight: 300;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat/Montserrat-LightItalic.ttf");
    font-style: italic;
    font-weight: 300;
}

:root {
    --color-1: #edeaea;
    --color-2: #765ab0;
    --color-3: #200229;
    --color-4: #111;
    --color-error: #c0392b;

    --border-radius: 0.5em;

    --star-size: 32px;
    --star-color: var(--color-3);
    --star-background: var(--color-2);
}

* {
    font-family: 'Comfortaa', sans-serif;
    box-sizing: border-box;
}

html,
body {
    background-color: var(--color-1);
    height: fit-content;
    line-height: 1.5em;
    font-size: 100%;
    margin: 0;
    padding: 0;
}

/* HEADER E NAVBAR */
header {
    padding-top: 2em;
    background-color: var(--color-2);
    text-align: center;
}

header h1 {
    background-image: url("../img/logo-v2.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    text-indent: -9999em;
    font-size: 5em;
    color: var(--color-1);
    line-height: 1.5em;
    margin: 0;
}

.navbar,
#breadcrumb,
main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar {
    margin-top: 1em;
    display: flex;
}

.main-navbar {
    margin-right: auto;
}

.user-navbar {
    margin-left: auto;
}

.navbar ul {
    list-style-type: none;
    padding: 0.5em 0;
    margin-top: 0;
    margin-bottom: 0;
}

.navbar ul li {
    display: inline-block;
    padding: 0.75em 0.75em 0.75em 2.5em;
    margin: 0 0.25em;
    background-repeat: no-repeat;
    background-position: 0.75em center;
}

.navbar ul li,
.navbar a {
    color: var(--color-1);
    text-decoration: none;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    font-weight: 600;
}

.navbar li.current {
    background-color: var(--color-3);
}

#homeNav {
    background-image: url("../img/home.svg");
}

#exploreNav {
    background-image: url("../img/archive.svg");
}

#creationsNav {
    background-image: url("../img/share-2.svg");
}

#catNav {
    background-image: url("../img/grid.svg");
}

#createNav {
    background-image: url("../img/plus.svg");
}

#favsNav {
    background-image: url("../img/star-outline.svg");
}

#profileNav {
    background-image: url("../img/user.svg");
}

#logoutNav {
    background-image: url("../img/log-out.svg");
}

#loginNav {
    background-image: url("../img/log-in.svg");
}

#btnFavourite {
    background-image: url("../img/like.svg");
}

#btnDelete,
#btnDeleteReview {
    background-image: url("../img/trash.svg");
}

#btnEdit {
    background-image: url("../img/edit.svg");
}

/* GLOBAL */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-4);
}

main {
    margin-bottom: 2em;
}

.section-error p {
    font-size: 1.1em;
    padding: 1em;
    color: var(--color-1);
    background-color: var(--color-error);
    border-radius: var(--border-radius);
}

/* PAGINA HOME */
.search-section {
    text-align: center;
    margin-bottom: 4em;
}

.search-section h1 {
    display: inline-block;
    line-height: 1.5em;
    margin: 1em 0;
    max-width: 800px;
}

.search-section form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-section form #site-search {
    width: 100%;
    font-size: 1.1em;
    padding: 1em;
    border-top-left-radius: 1em;
    border-bottom-left-radius: 1em;
}

.search-section form .search-btn {
    padding: 0.5em 1.5em;
    border-top-right-radius: 1em;
    border-bottom-right-radius: 1em;
}

/* PAGINA DRINK */
.row {
    display: flex;
}

.btn {
    border: none;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    padding: 0.75em 1em;
    background-color: var(--color-2);
    justify-items: center;
    color: var(--color-1);
}

.btn:active {
    background-color: var(--color-3);
}

.btn-danger {
    background-color: var(--color-error);
}

.btn-warning {
    background-color: var(--star-background);
}

.btn:hover {
    cursor: pointer;
}

.btn-icon {
    padding: 0.75em 0.75em 0.75em 2.75em;
    background-repeat: no-repeat;
    background-position: 0.75em center;
    background-size: 20px 20px;
}

.actions {
    margin-bottom: 1.5em;
}

.actions .btn {
    text-decoration: none;
    font-size: 0.85em;
    margin-right: 0.5em;
}

.drink-image {
    width: 30%;
    height: 20em;
    padding: 1em;
    text-align: center;
}

.drink-image img {
    width: 100%;
    height: auto;
}

.drink-info {
    width: 70%;
    padding: 1.5em;
}

.drink-info h1 {
    margin: 0 0 0.75em 0;
}

.drink-info p {
    margin: 0.75em 0;
}

.drink-ingredients,
.drink-prep {
    width: 50%;
}

.drink-ingredients li,
.drink-prep li {
    margin-bottom: 0.75em;
}


/* REVIEW */
.reviews {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.review {
    display: flex;
    margin-bottom: 1em;
}

.review-icon {
    flex-basis: 7em;
    margin: 1em;
}

.review-icon img {
    width: 100%;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.review-stars {
    --percent: calc(var(--rating) / 5 * 100%);

    display: inline-block;
    font-size: var(--star-size);
    font-family: Times;
    line-height: 1;
}

.review-stars::before {
    content: '★★★★★';
    letter-spacing: 3px;
    background: linear-gradient(90deg, var(--star-background) var(--percent), var(--star-color) var(--percent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.review-body {
    flex-basis: 100%;
}

.review-body .review-text,
.review-body .review-form {
    display: block;
    margin: 0.5em 0;
}

.review-body .review-form {
    margin-bottom: 2em;
}

.review-form fieldset {
    text-align: right;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
}

.review-form fieldset>* {
    text-align: left;
}

.review-body time {
    font-size: 0.85em;
    display: block;
}

.review-form input,
.review-form textarea {
    display: block;
    padding: 0.5em;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    border: none;
    font-size: 1em;
    background-color: #fff;
    margin: 0;
    width: 100%;
    border: 2px solid var(--color-4);
}

.review-form .form-group {
    margin: 0.5em 0;
}

.review-form #rating {
    width: 10em;
}

.review-body .btn-danger {
    font-size: 0.85em;
    text-decoration: none;
    display: inline-block;
}

/* DRINK CARD */
.drink-list {
    list-style: none;
    padding: 0;
    margin: 1rem auto 2.5rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, 1fr);
}

.drink-card {
    background-color: #fff;
    border: 1px solid var(--color-4);
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.drink-card img {
    width: 100%;
}


/* HOME PAGE */


/* NUOVO DRINK */

.drink-form {
    text-align: right;
}

.drink-form>* {
    text-align: left;
}

.drink-form .input-error {
    font-size: 0.9em;
    color: var(--color-error);
    margin: 0.5em 0 0 0;
    font-weight: 600;
}

.drink-form fieldset {
    margin-bottom: 0.5em;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
}

.drink-form input,
.drink-form textarea,
.drink-form select {
    display: block;
    padding: 0.5em;
    width: 80%;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    border: none;
    font-size: 1em;
    background-color: #fff;
    margin: 0;
    width: 100%;
    border: 2px solid var(--color-4);
}

.drink-form textarea {
    resize: horizontal;
    height: 4em;
}

.form-group {
    width: 100%;
    margin-bottom: 0.5em;
}

li .form-group {
    margin: 0 0.5em;
}

li .form-group.input-quantity {
    width: 30%;
}

button:hover {
    cursor: pointer;
}

.info-fieldset {
    display: flex;
    flex-wrap: wrap;
}

.input-category {
    flex-basis: 40%;
    padding-right: 1em;
}

.input-name {
    flex-basis: 60%;
}

.input-description {
    width: 100%;
    flex-basis: 100%;
}

.drink-form button {
    color: var(--color-1);
    border: 2px solid var(--color-3);
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    background-color: var(--color-2);
}

.drink-form button:active {
    background-color: var(--color-3);
}

.form-list {
    margin: 0;
}

.form-list li button {
    align-self: flex-end;
    display: inline-block;
    padding: 0.4em 0.5em;
}

.form-list li {
    margin-bottom: 1em;
}

.form-group label {
    display: block;
    margin-bottom: 0.5em;
    font-size: 0.9em;
}

.form-row {
    display: flex;
}

.list-fieldset {
    text-align: center;
}

.list-fieldset>* {
    text-align: left;
}

.list-fieldset .btn-add,
.drink-form .btn-submit {
    font-size: 1em;
    padding: 0.5em 2em;
    display: inline-block;
}

.drink-form .btn-submit {
    margin-top: 1em;
}


/*  PAGINA LOGIN / REGISTRAZIONE     */

.login-font {
    font-family: "Montserrat", 'Comfortaa', sans-serif;
}

.login-page :focus {
    outline: 3px solid #8B6FB5;
    outline-offset: 3px;
}

.login-page :focus-visible {
    outline: 3px solid #8B6FB5;
    outline-offset: 3px;
}

.login-page :focus:not(:focus-visible) {
    outline: 3px solid #8B6FB5;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.login-page #error-messages p {
    font-size: large;
    font-weight: 900;
}

.login-page {
    font-family: "Montserrat";
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-page header {
    position: relative;
    width: 100%;
    height: 2em;
    font-size: 5em;
    margin-top: 0;
    line-height: 1em;
    background-image: url('../img/title.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.login-page header h1 {
    position: absolute;
    left: -9999px;
}

.login-page .container {
    position: relative;
    width: min(850px, 95vw);
    height: min(550px, 90vh);
    background-color: #EDEAEA;
    -webkit-border-radius: 30px;
    -moz-border-radius: 30px;
    border-radius: 30px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 1);
    margin: 20px;
    overflow: hidden;
}

.login-page .container label {
    position: absolute;
    left: 9999px;
}

.login-page .container h2 {
    font-size: 2.7em;
    margin-bottom: 10%;
}

.login-page .box {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: #EDEAEA;
    color: #23022E;
    display: flex;
    align-items: center;
    text-align: center;
    z-index: 1;
    transition: .5s ease-in-out 1s, visibility 0s 1s;
}

.login-page .container.active .box {
    right: 50%;
}

.login-page .box p {
    font-weight: bold;
}

.login-page .box.register {
    display: none;
}

.login-page .container.active .box.register {
    display: flex;
}

.login-page .box.login {
    display: flex;
}

.login-page .container.active .box.login {
    display: none;
}

.login-page form {
    width: 100%;
}

.login-page .input {
    position: relative;
    margin: 15px 0;
}

.login-page .input input {
    padding: 1em 3em 1em 1.4em;
    width: 80%;
    -webkit-border-radius: var(--border-radius);
    -moz-border-radius: var(--border-radius);
    border-radius: var(--border-radius);
    border: none;
}

.login-page .btn {
    margin-top: 8%;
    width: 50%;
    height: 3em;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
    border: none;
    background-color: #23022E;
    color: #EDEAEA;
    font-size: 1em;
    font-weight: 900;
}

.login-page .input img {
    position: absolute;
    right: 50px;
    top: 10px;
}

.login-page .curtain-box {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    text-align: center;
}

.login-page .curtain-box::before {
    content: '';
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;
    background: #23022E;
    -webkit-border-radius: 150px;
    -moz-border-radius: 150px;
    border-radius: 150px;
    z-index: 2;
    transition: 1.5s ease-in-out;
}

.login-page .container.active .curtain-box::before {
    left: 50%;
}

.login-page .curtain h2 {
    color: #EDEAEA;
}

.login-page .curtain p {
    margin: 0;
}

.login-page .curtain {
    position: absolute;
    width: 50%;
    height: 100%;
    color: #EDEAEA;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: 1.5s ease-in-out;
}

.login-page .curtain.left {
    left: 0;
}

.login-page .container.active .curtain.left {
    left: -50%;
}

.login-page .curtain .btn {
    background: transparent;
    border: 3px solid #EDEAEA;
}

.login-page .curtain.right {
    right: -50%;
    transition: 1s ease-in-out;
}

.login-page .container.active .curtain.right {
    right: 0;
}

@media (pointer: coarse) {

    .login-page .btn,
    .login-page .input input {
        min-height: 44px;
    }
}

/* Animazioni ridotte */
@media (prefers-reduced-motion: reduce) {

    .login-page .box,
    .login-page .curtain-box::before,
    .login-page .curtain,
    .login-page .container.active .curtain-box::before,
    .login-page .container.active .curtain.left,
    .login-page .container.active .curtain.right {
        transition: none !important;
        animation: none !important;
    }

    .login-page .box {
        transition: visibility 0s !important;
    }
}

/* PAGINE DI ERRORI */
.error-header h1 {
    font-size: 3em;
    text-align: center;
    margin-top: 0;
}

#content h1 {
    margin: 0.5em 0;
    font-size: 3em;
    text-align: center;
    line-height: 1;
}

#content h2 {
    margin: 0.4em 0;
    font-size: 2em;
    text-align: center;
    line-height: 1;
}

#content h3 {
    font-size: 1.5em;
    text-align: center;
    padding: 0.3em;
    line-height: 1.5em;
    font-weight: normal;
}

.errorImg {
    display: block;
    margin: auto;
    max-width: 40%;
    height: auto;
    margin-top: 1em;
    margin-bottom: 1.5em;
}