@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #f2f2f2;
    font-family: "Barlow", system-ui;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    width: clamp(3rem, 5rem, 8rem);
    height: clamp(3rem, 5rem, 8rem);
    object-fit: cover;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;

    min-height: 100vh;
    min-height: 100dvh;
}

.user,
.info-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-field,
.login,
.errors-msg {
    display: grid;
    place-items: center;
    gap: 1rem;
    width: 100%;
}

.login-field {
    background-color: #fff;
    padding-block: 2rem;
    border-radius: 6px;
    box-shadow: 2px 10px 10px #999;
}

.errors-msg,
.success-msg {
    font-size: 1.25rem;
    font-weight: 700;
}

.errors-msg {
    color: #ad102f;
}

.success-msg {
    color: hsl(120 100% 25% / .8);
}

.login-form,
.update-form,
.create-form {
    display: grid;
    gap: 1rem;
}

.input {
    position: relative;
    display: grid;
    gap: .5rem;

    label {
        font-size: 1rem;
        /* letter-spacing: .85px; */
    }
}

input,
textarea {
    min-height: 3rem;
    font-size: 1.125rem;
    padding: .5rem .7rem;
    border: 1px solid #333;
    border-radius: 6px;
    outline: none;
}

input:focus,
textarea:focus {
    outline: 1px solid #181919; 
}

input::placeholder {
    opacity: 0;
}

input + label {
    position: absolute;
    top: 30%;
    left: 5%;
    pointer-events: none;
    transition: .2s ease;

}

input:not(:placeholder-shown) + label, input:focus + label {
    top: .375rem;
    left: .625rem;
    font-size: .5rem;
    color: #181919;
    /* color: #1d9bf0; */
}

.create-label {
    position: relative;
}

.create-input::placeholder {
    opacity: 1;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.category {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;

    label {
        width: 100%;
    }
}

.create {
    display: grid;
    place-items: center;
}
.update-title {
    text-align: center;
}

.btn {
    display: grid;
    place-items: center;
    width: 100%;
    border-radius: 1.25rem;
    padding: .5rem .3rem;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #536471;
    background-color: #333;
    color: #fff;
    cursor: pointer;
}

.btn:hover,
.btn:focus {
    background-color: #181919;
}

.edit-btn,
.delete-btn {
    width: clamp(3.5rem, 4.5rem, 6rem);
    border-radius: 6px;
}

.create-btn, .update-btn, .logout-btn, .back-btn {
    width: clamp(6rem, 8rem, 10rem);
    border-radius: 6px;
    font-size: 1.15rem;
}

.back-btn {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: .3rem;
}

.edit-btn,
.update-btn,
.create-btn {
    background-color: #4f7fd2;
    border: none;
}

.edit-btn:hover, .edit-btn:focus,
.update-btn:hover, .update-btn:focus,
.create-btn:hover, .create-btn:focus {
    background-color: #3064be;
}

.delete-btn {
    background-color: #dc143c;
    border: none;
}

.delete-btn:hover, .delete-btn:focus{
    background-color: #ad102f;
}

.content {
    width: 90%;
    display: grid;
    gap: 1rem;
}

.content h2 {
    text-align: center;
    letter-spacing: 1px;
}

table {
    width: 100%;
}

th,
td {
    padding: .7rem;
}

th {
    background-color: hsl(0 0% 60%);
}

tr:nth-of-type(2n) {
    background-color: hsl(0 0% 60% / .3);
}

td:last-child {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22rem,1fr));
    gap: 1rem;
}

.flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.btn-container {
    display: flex;
    gap: 1rem;
}

@media (max-width: 760px) {
    th {
        display: none;
    }

    td {
        display: grid;
        gap: .5rem;
        grid-template-columns: 11ch auto;
        /* padding: .5rem 1rem; */
    }

    td::before {
        content: attr(data-cell) ": ";
        font-weight: 700;
        text-transform: capitalize;
    }

    td:last-child {
        flex-direction: row;
        align-items: center;
    }
}

@media (min-width: 750px) {
    .login-field {
        width: 50%;
    }
}

@media (min-width: 1100px) {
    .login-field {
        width: 30%;
    }
}