:root {
  --font: var(--font-sans-serif);
  --color-accent: var(--color-red);

  --font-sans-serif: "Poppins", sans-serif;
  --font-serif: "Aleo", serif;
  --font-mono: "JetBrains Mono", monospace;

  --color-red: rgb(250, 111, 113);
  --color-cyan: rgb(112, 243, 248);
  --color-violet: rgb(216, 129, 248);
}

*::before,
*::after,
* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font-size: 62.5%;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  min-height: 90vh;
  font-family: var(--font);
  background-color: #1e2140;
  color: #fff;
}

label {
  display: block;
}

.radio-btn {
  position: relative;
  border: 0;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  background-color: rgb(239, 241, 250);
  color: rgb(30, 33, 63);
  font-size: 1.6rem;
  cursor: pointer;
  transition: background-color 150ms ease-in-out;

  &[data-font].active {
    background-color: rgb(22, 25, 50);
    color: #fff;
  }
}

[data-accent-color].active {
  &::before {
    content: url("../assets/check.svg");
    position: absolute;
    transform: translate(-50%, -40%);
  }
}

.font-sans-serif {
  font-family: var(--font-sans-serif);
}

.font-serif {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

.bg-red {
  background-color: var(--color-red);
}

.bg-cyan {
  background-color: var(--color-cyan);
}

.bg-violet {
  background-color: var(--color-violet);
}

.icon {
  width: 3rem;
  height: 3rem;
  cursor: pointer;
}

.main-heading {
  font-size: 3.2rem;
  font-weight: 400;
}

main {
  width: 40rem;
  height: 40rem;
  border-radius: 50%;
  text-align: center;
}

.modes {
  font-size: 1.8rem;
  padding: 1.6rem 1rem;
  background: #151932;
  border-radius: 10rem;
}

.mode {
  margin-right: 2em;
  text-decoration: none;
  font-weight: 400;
  color: #484c67;
  cursor: pointer;
  transition: all 300ms ease-out;

  &.active {
    padding: 0.5em 1em;
    border-radius: 50px;
    background-color: var(--color-accent);
    color: #1c2244;
  }
}

.mode:last-child {
  margin-right: 0;
}

.get-started {
  background: var(--color-accent);
  padding: 1.2rem 2rem;
  border-radius: 0.4rem;
  font-size: 1.8rem;
  margin-top: 2rem;
}

.pomodoro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  position: relative;
  margin: 2.5rem 0;
  text-align: center;
  border-radius: 50%;
  background: #151932;
  box-shadow: 50px 50px 82px #0e1021, -50px -50px 82px #1c2244;

  &::before {
    content: "";
    position: absolute;
    border: 10px solid var(--color-accent);
    border-radius: 50%;
    width: 35rem;
    height: 35rem;
  }
}

.pomodoro__time {
  font-size: 7rem;
  font-weight: 400;
}

.settings-btn__wrap {
  position: fixed;
  top: 2.5rem;
  right: 5.5rem;

  & button {
    border: 0;
    background-color: transparent;
  }
}

.settings-modal__container {
  position: relative;
  border-radius: 1.5rem;
  margin: auto;
  opacity: 0;
  overflow: visible;
  transition: opacity 200ms, transform 200ms allow-discrete;

  &, &::backdrop {
    transition:
      display 250ms allow-discrete,
      overlay 250ms allow-discrete,
      opacity 250ms;
    opacity: 0;
  }

  &::backdrop {
    background: color-mix(in srgb, #020617, transparent 40%);
  }

  &:popover-open {
    opacity: 1;

    &::backdrop {
      opacity: 1;
    }
  }

  @starting-style {
    &:popover-open,
    &:popover-open::backdrop {
      opacity: 0;
    }
  }
}

.settings-modal__header {
  padding: 2rem 3rem;
  border-bottom: 2px solid #eef1f9;
  display: flex;
  justify-content: space-between;
  align-items: center;

  & h3 {
    font-size: 2.2rem;
    font-weight: 600;
  }

  & button {
    background-color: transparent;
    border: 0;
  }
}

.settings-modal__settings-wrap {
  padding: 2rem 3rem;
}

.settings-modal__row-wrap {
  &:not(:last-of-type) {
    border-bottom: 2px solid #eef1f9;
  }

  &:not(:first-of-type) {
    padding: 2rem 0;
  }

  &:first-of-type {
    padding-bottom: 2rem;
  }

  &[class$="inline"] {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  & h4 {
    font-size: 1.6rem;
    color: #1e2140;
  }

  & input[type="number"] {
    padding: 1rem;
    border-radius: 8px;
    width: 15ch;
    border: 0;
    background-color: #eef1f9;

    &:user-invalid {
      outline: 2px solid red;
    }
  }
}

.settings-modal__inputs-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;

  &[class$="--top-spacer"] {
    margin-top: 1.5rem;
  }

  & label {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: #afaeb4;
  }
}

.settings-modal__btn {
  position: absolute;
  padding: 1rem 4rem;
  border: 0;
  background-color: var(--color-accent);
  font: inherit;
  font-size: 1.8rem;
  bottom: 0;
  left: 50%;
  translate: -50% 50%;
  border-radius: 10rem;
  color: #fff;
  cursor: pointer;
  transition: background-color 120ms ease-in-out;

  &:hover {
    background-color: color-mix(in srgb, var(--color-accent) 85%, #000);
  }
}

@media screen and (max-width: 480px) {
  main {
    transform: scale(0.85);
  }

  .modes {
    font-size: 1.5rem;
  }

  .settings-btn__wrap {
    top: unset;
    left: 1.5rem;
    bottom: 1.5rem;
  }

  .settings-modal__row-wrap input[type="number"] {
    width: 10ch;
  }
}
