/*
* Global
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-dark: rgb(10, 10, 40);
  --color-darker: rgb(5, 5, 40);
  --color-darkest: rgb(1, 1, 20);

  --color-light: #7f80c1;
  --color-lighter: #babbfc;
  --color-lightest: #fff;

  --color-green: #2ed157;
  --color-blue: #4449c9;
  --color-red: #ff443b;
  --color-yellow: #ffa00a;

  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: var(--color-lightest);
  background-color: var(--color-darker);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: var(--color-blue);
  text-decoration: inherit;
  transition: opacity 200ms;
}

a:hover {
  opacity: 0.7;
}

code {
  color: var(--color-yellow);
  background: var(--color-darker);
  padding: 1px 4px;
  margin: -2px 1px;
  border-radius: 4px;
  display: inline-block;
}

body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 24px;
}

p {
  font-size: 0.8rem;
  color: var(--color-lighter);
}

p+p {
  margin-top: 12px;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

h2 {
  font-weight: 500;
  font-size: 1.4em;
  line-height: 1.1;
}

h3 {
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.1;
}

.button-row {
  display: flex;
}

.button-row>.button,
.button-row>button {
  flex: 1 1 auto;
}

.button-row>.button:not(:first-child),
.button-row>button:not(:first-child) {
  margin-left: 12px;
}

button,
.button,
select,
input {
  line-height: 1;
  border-radius: 5px;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-size: .8rem;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--color-dark);
  color: var(--color-light);
  transition: all 150ms;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  flex: 1;
}


input::placeholder {
  color: var(--color-light);
  opacity: 0.5;
}

select {
  padding: 0.6em;
}

button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button span {
  display: block;
  font-weight: 300;
}

button img,
.button img {
  height: 20px;
  width: 20px;
  object-fit: contain;
}

button:has(img),
.button:has(img) {
  display: flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.button:hover {
  background: var(--color-blue);
  color: var(--color-lightest);
}

button:focus,
.button:focus,
button:focus-visible,
.button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo__show-mine {
  display: none;
}

body:has(.auth) .todo__show-mine {
  display: block;
}

input[type="text"] {
  cursor: text;
}

#root {
  opacity: 0;
  animation: fadeIn 300ms ease-out 300ms forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/*
* Intro
*/

.intro.tile {
  background: radial-gradient(circle farthest-corner at 50% -50%,
      #05052f00 25%,
      #0c0f75 85%,
      #7042b5 92%);
}

.intro h3 {
  font-size: 1.4rem;
}

@keyframes pulseAnimation {

  0%,
  100% {
    background-size: 100% 100%;
  }

  50% {
    background-size: 150% 150%;
  }
}

.intro p {
  color: rgba(255, 255, 255, 0.7);
}

.intro__stack {
  display: flex;
  justify-content: stretch;
  width: 100%;
  gap: 8px;
  margin-top: 12px;
}

.intro__stack-item {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(9, 9, 54, 0.2);
  line-height: 1.4;
  flex: 1;

  span {
    margin-top: 2px;
    display: block;
    text-transform: uppercase;
    font-size: 11px;
    opacity: 0.5;
  }
}

/*
* Tiles
*/
.tiles {
  max-width: 580px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-left: -6px;
  /* half of gap */
  margin-right: -6px;
  /* half of gap */
}

.tile {
  position: relative;
  background: var(--color-darkest);
  padding: 12px;
  border-radius: 5px;
  flex-grow: 1;
  flex-shrink: 0;
  margin: 6px;
  /* half of gap */
  flex-basis: calc(100% - 24px);
  opacity: 0;
  transform: translateY(16px);
  /* Initial transform state */
  animation: fadeIn 1200ms cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
}

.tile__content {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.tile__content>p {
  min-height: 3em;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tile:first-child {
  animation-delay: 100ms;
}

.tile:nth-child(2) {
  animation-delay: 150ms;
}

.tile:nth-child(3) {
  animation-delay: 200ms;
}

.tile:nth-child(4) {
  animation-delay: 250ms;
}

.tile:nth-child(5) {
  animation-delay: 300ms;
}

.tile:nth-child(6) {
  animation-delay: 350ms;
}

.tile__header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 6px;
}

.tile__title:last-child,
.tile__subtitle:last-child {
  margin-bottom: 12px;
}

.tile__subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-lighter);
  margin-top: 4px;
}

.tile__icon {
  opacity: 0.9;
  position: absolute;
  right: 0;
  top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.tile__status-indicator {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulse-animation 2s infinite;
  color: var(--accent-color, var(--color-green));
  background-color: var(--accent-color, var(--color-green));
}

@keyframes pulse-animation {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 currentColor;
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 currentColor;
  }
}

.tile.success {
  --accent-color: var(--color-green);
}

.tile.error {
  --accent-color: var(--color-red);
}

.tile.warning {
  --accent-color: var(--color-yellow);
}

.tile.loading {
  --accent-color: var(--color-yellow);
}

.tile.info {
  --accent-color: var(--color-blue);
}

.tile.info {
  --accent-color: var(--color-blue);
}

.tile.success .tile__status-indicator,
.tile.error .tile__status-indicator,
.tile.warning .tile__status-indicator,
.tile.info .tile__status-indicator {
  box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb, 0, 0, 0), 0.497);
}

.tile.half {
  flex-basis: calc(50% - 24px);
}

.tile.third {
  flex-basis: calc(33.33% - 24px);
}

.tile.quarter {
  flex-basis: calc(25% - 24px);
}

/*
* Todo
*/

.todo {
  display: flex;
  flex-direction: column;
}

.todo form {
  margin-top: 12px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
}

.todo form input[type="text"] {
  flex: 1;
}

.todo footer {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.todo footer span {
  font-size: 12px;
  color: var(--color-light);
}

.todo__task {
  display: flex;
  font-size: 1rem;
  font-weight: 300;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-darker);
  background: var(--color-darkest);
}

.todo__task.completed {
  text-decoration: line-through;
  color: var(--color-light);
}

.todo__task span {
  flex: 1;
  cursor: pointer;
}

.todo__empty {
  color: var(--color-light);
  padding: 12px;
  text-align: center;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 0 0 100%;
  padding: 0.5rem;
  border-radius: 0.25rem;
  background-color: var(--color-darker);
  border: 1px solid var(--color-dark);
}

.message.error p {
  color: var(--color-red);
}

.message.success p {
  color: var(--color-green);
}