@import url('https://fonts.googleapis.com/css?family=Montserrat:400|Inconsolata:400');
*,
::after,
::before {
  box-sizing: border-box;
}
:root {
  /* COLORS  */
  /* primary */
  --primary-0: #f0efff;
  --primary-50: #d8d6ff;
  --primary-100: #c1beff;
  --primary-200: #aaa5ff;
  --primary-300: #938dff;
  --primary-400: #7b74ff;
  /* main */
  --primary-500: #645cff;
  --primary-600: #554ed9;
  --primary-700: #4640b3;
  --primary-800: #37338c;
  --primary-900: #282566;
  --primary-1000: #191740;
  --primary-1100: #0a0919;
  /* grey */
  --grey-0: #fafbfc;
  --grey-50: #f2f4f8;
  --grey-100: #eaedf3;
  --grey-200: #e2e7ef;
  --grey-300: #dbe0ea;
  --grey-400: #d3dae6;
  --grey-500: #cbd3e1;
  --grey-600: #adb3bf;
  --grey-700: #8e949e;
  --grey-800: #70747c;
  --grey-900: #51545a;
  --grey-1000: #333538;
  --grey-1100: #141516;

  /* rest */
  --black: #222;
  --white: #fff;
  --red-light: #f8d7da;
  --red-dark: #842029;
  --green-light: #d1e7dd;
  --green-dark: #0f5132;

  /* typography */
  --headingFont: 'Inconsolata', monospace;
  --bodyFont: 'Montserrat', sans-serif;
  --smallText: 0.7em;
  /* rest */
  --backgroundColor: var(--grey-50);
  --textColor: var(--grey-1000);
  --borderRadius: 0.25rem;
  --letterSpacing: 1px;
  --transition: 0.3s ease-in-out all;
  --max-width: 1120px;
  --fixed-width: 600px;
  /* box shadows */
  --shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-2: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-3: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-4: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
  font-size: 112.5%;
}

body {
  background: var(--backgroundColor);
  color: var(--textColor);
  font-family: var(--bodyFont);
  font-weight: 400;
  line-height: 1.75;
}

p {
  margin-bottom: 1.5rem;
  max-width: 40em;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  margin-bottom: 1.38rem;
  font-family: var(--headingFont);
  font-weight: 400;
  line-height: 1.3;
  text-transform: capitalize;
  letter-spacing: var(--letterSpacing);
}

h1 {
  font-size: 3.052rem;
}

h2 {
  font-size: 2.441rem;
}

h3 {
  font-size: 1.953rem;
}

h4 {
  font-size: 1.563rem;
}

h5 {
  font-size: 1.25rem;
}

small,
.text-small {
  font-size: var(--smallText);
}

ul {
  padding: 0;
  list-style-type: none;
}
a {
  text-decoration: none;
}
/*************
     Buttons 
*************/

.btn {
  cursor: pointer;
  appearance: none;
  color: var(--white);
  background: var(--primary-500);
  border: none;
  border-radius: var(--borderRadius);
  letter-spacing: var(--letterSpacing);
  padding: 0.375rem 0.75rem;
  box-shadow: var(--shadow-1);
  transition: var(--transition);
  text-transform: capitalize;
}

.btn:hover {
  color: var(--white);
  background: var(--primary-700);
  box-shadow: var(--shadow-2);
}
button.small {
  padding: 0.25rem 0.5rem;
  font-size: var(--smallText);
}
button.hipster {
  color: var(--primary-500);
  background: var(--primary-50);
  box-shadow: var(--shadow-1);
}
button.hipster:hover {
  background: var(--primary-100);
  box-shadow: var(--shadow-2);
}
button.block {
  width: 100%;
}

/*************
     FORM 
*************/
form {
  width: 100%;
  background: var(--white);
  border-radius: var(--borderRadius);
  box-shadow: var(--shadow-2);
  padding: 2rem 2.5rem;
}
label {
  display: block;
  font-size: var(--smallText);
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

input,
textarea {
  width: 100%;
  padding: 0.375rem 0.75rem;
  border-radius: var(--borderRadius);
  background: var(--grey-50);
  border-color: transparent;
  border: 1px solid var(--grey-300);
}
.form-row {
  margin-bottom: 1rem;
}
textarea {
  width: 100%;
  height: 7rem;
}

::placeholder {
  color: var(--grey-600);
}
.form-alert {
  color: var(--red-dark);
  letter-spacing: var(--letterSpacing);
  text-transform: capitalize;
}

.task-form,
.single-task-form {
  width: 90vw;
  max-width: var(--fixed-width);
  margin: 0 auto;
  margin-top: 6rem;
}
.task-form h4 {
  text-align: center;
}
.task-form .form-alert {
  margin-top: 1rem;
}
.submit-btn {
  width: 100%;
  margin-top: 1rem;
}
@media screen and (min-width: 576px) {
  .form-control {
    display: flex;
  }
  .task-input {
    border-radius: 0;
    border-top-left-radius: var(--borderRadius);
    border-bottom-left-radius: var(--borderRadius);
  }
  .submit-btn {
    margin-top: 0;
    width: 175px;
    border-radius: 0;
    border-top-right-radius: var(--borderRadius);
    border-bottom-right-radius: var(--borderRadius);
  }
}
form > :first-child {
  margin-top: 0;
}
form > :last-child {
  margin-bottom: 0;
}
/* Basic Classes */
.alert {
  padding: 0.375rem 0.75rem;
  margin-bottom: 1rem;
  border-color: transparent;
  border-radius: var(--borderRadius);
}

.alert-success {
  color: var(--green-dark);
  background-color: var(--green-light);
}
.alert-danger {
  color: var(--red-dark);
  background-color: var(--red-light);
}
.text-danger {
  color: var(--red-dark);
}
.text-success {
  color: var(--green-dark);
}
/* loading */
@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  border: 3px solid #ccc;
  border-top-color: var(--clr-primary-5);
  animation: spinner 0.6s linear infinite;
}
.loading {
  margin: 0 auto;
}
/* form loading */

.form-loading {
  position: relative;
}
.form-loading::before {
  background: var(--white);
  position: absolute;
  content: '';
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  border-radius: var(--borderRadius);
  opacity: 0.8;
}

.form-loading::after {
  content: '';
  position: absolute;
  top: calc(50% - 3rem);
  left: calc(50% - 3rem);
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  border: 3px solid #ccc;
  border-top-color: var(--clr-primary-5);
  animation: spinner 0.6s linear infinite;
}

/*************
     TASKS
*************/
.empty-list {
  text-align: center;
}
.tasks-container {
  width: 100%;
  width: 90vw;
  max-width: var(--fixed-width);
  margin: 0 auto;
  margin-top: 2rem;
  padding-bottom: 4rem;
}
.tasks {
  display: grid;
  gap: 1rem;
}
.single-task {
  padding: 1rem 2.5rem;
  background: var(--white);
  border-radius: var(--borderRadius);
  box-shadow: var(--shadow-2);
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.single-task:hover {
  box-shadow: var(--shadow-4);
}
.single-task h5 {
  margin-bottom: 0;
}
.single-task span {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-left: -1.25rem;
  margin-right: 1.5rem;
}
.single-task .fa-check-circle {
  font-size: 1rem;
  color: var(--green-dark);
  visibility: hidden;
}
.task-completed h5 {
  text-decoration: line-through;
}
.task-completed .fa-check-circle {
  visibility: visible;
}
.loading-text {
  visibility: hidden;
}
/* Task Links */
.task-links {
  display: flex;
  align-items: center;
  gap: 0 0.5rem;
}
.delete-btn,
.edit-link {
  background: transparent;
  font-size: 0.75rem;
  border: transparent;
  cursor: pointer;
}
.edit-link {
  color: var(--green-dark);
}
.delete-btn {
  color: var(--red-dark);
}

/*************
   SINGLE TASK
*************/

.single-task-form h4 {
  text-align: center;
}

.single-task-form p {
  margin-bottom: 0;
  margin-top: 0;
}

.single-task-form .form-control {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  justify-items: start;
  gap: 0 1rem;
  margin-bottom: 0.75rem;
}

.single-task-form label {
  margin-bottom: 0;
  font-size: 1rem;
}

.task-edit-completed {
  width: auto;
}
.back-link {
  display: block;
  width: 250px;
  margin: 0 auto;
  text-align: center;
  margin-top: 6rem;
  background: var(--black);
}
.back-link:hover {
  background: var(--black);
  opacity: 0.75;
}

.single-task-form .form-alert {
  text-align: center;
  margin-top: 1rem;
}
