* {
  box-sizing: border-box;
}

body {
  transition: background 0.3s;
}

.calculator {
  height: 43.125rem;
  width: 21.875rem;
  overflow: hidden;

  background: #e0e0e0;
  box-shadow: 0.5rem 0.5rem 0.938rem #bebebe, -0.5rem -0.5rem 0.938rem #ffffff;
  border-radius: 1.563rem;

  margin: 3.125rem auto;
  padding-inline: 1.25rem;

  align-self: center;
  justify-self: center;
}

.display {
  height: 9.375rem;
  width: 19.375rem;

  background: #e0e0e0;

  display: flex;
  align-items: center;

  margin: 0;
  position: relative;
}

.display-input {
  height: 6.25rem;
  width: 19.375rem;
  font-size: 2em;
  text-align: right;
  background: #9e9e9e;
  color: #000000;

  border: none;
  border-radius: 0.625rem;
  padding: 0.625rem;

  box-shadow: inset 0.5rem 0.5rem 0.938rem #7c7c7c,
    -0.5rem -0.5rem 0.938rem #a5a5a5;
}

.display-operator {
  position: absolute;
  top: -0.313rem;
  right: 0.625rem;
  font-size: 2em;
  color: #000000;
  text-align: center;
}

.multiplying {
  top: 0px;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.buttons-backspace,
.toggle-light {
  grid-column: span 2;
  padding: 0.25rem;
}

.buttons-backspace img {
  height: 2rem;
  width: 2rem;

  margin-top: 0.313rem;
}

.buttons-erase {
  background-color: orangered;
  border-color: orange;
  color: rgb(250, 194, 89);
}

.buttons-equal {
  grid-column: span 4;
  background-color: #ff4500;
  border-color: orange;
  color: rgb(250, 194, 89);
}

.toggle-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  transition: flex-direction 0.3s ease, transform 0.3s ease;
}

.icon {
  font-size: 1.2em;
  transition: transform 0.3s ease;

  margin-right: 0.313rem;
  margin-bottom: 0.313rem;
}

.label {
  font-size: 1em;
  font-weight: bold;
  color: #000;
  transition: color 0.3s ease;

  margin-right: 0.375rem;
  margin-bottom: 0.063rem;
}

button {
  font-size: 1.5em;
  padding: 1.25rem;
  border: 1px solid #ccc;
  cursor: pointer;

  background: #e0e0e0;
  border-radius: 0.75rem;
  box-shadow: 0.125rem 0.125rem 0.25rem #bebebe,
    -0.125rem -0.125rem 0.25rem #ffffff;
  margin: 0.625rem;
  transition: all 0.1s ease-in-out;
}

button:active {
  box-shadow: inset 0.375rem 0.375rem 0.625rem #bebebe,
    inset -0.375rem -0.375rem 0.625rem #ffffff;
}

button:hover {
  background: #eee;
}

/* DARK THEME */

body.dark {
  background-color: #353230;
}

body.dark .calculator {
  background-color: #272727;
  box-shadow: 0.5rem 0.5rem 0.938rem #111, -0.5rem -0.5rem 0.938rem #333;
}

body.dark .display {
  background-color: #272727;
}

body.dark .display-operator {
  color: #ffa500;
}

body.dark .display-input {
  background: #3c3c3c;
  color: #ffa500;
  box-shadow: inset 0.5rem 0.5rem 0.938rem #1f1f1f,
    -0.5rem -0.5rem 0.938rem #181818;
}

body.dark button {
  background-color: #3a3a3a;
  color: #fff;
  box-shadow: 0.125rem 0.125rem 0.25rem #111, -0.125rem -0.125rem 0.25rem #444;
}

body.dark button:active {
  box-shadow: inset 0.375rem 0.375rem 0.625rem #111,
    inset -0.375rem -0.375rem 0.625rem #444;
}

body.dark button:hover {
  background-color: #444;
}

body.dark .buttons-erase,
body.dark .buttons-equal {
  background-color: darkorange;
  border-color: orange;
  color: white;
}

body.dark .theme-toggle {
  background: #2c2c2c;
  box-shadow: 0.125rem 0.125rem 0.25rem #111, -0.125rem -0.125rem 0.25rem #444;
}

body.dark .icon {
  margin-bottom: 0.375rem;
}

body.dark .label {
  color: #fff;

  margin-left: 0.438rem;
}

body.dark .toggle-inner {
  flex-direction: row-reverse;
}

@media (min-width: 601px) and (max-width: 1023px) {
  .calculator {
    height: 44.375rem;
    width: 28.125rem;
  }

  .display {
    height: 10.625rem;
    width: 25rem;
  }

  .display-input {
    height: 7.5rem;
    width: 26.25rem;
  }

  .display-operator {
    top: 0px;
    right: 0px;
  }

  .multiplying {
    top: 0.313rem;
  }

  .icon {
    margin-left: 0.313rem;
  }

  .label {
    margin-right: 0.625rem;
  }

  body.dark .icon {
    margin-bottom: 0.313rem;
  }

  body.dark .label {
    margin-left: 0.625rem;
  }
}

@media (min-width: 1024px) and (max-width: 1100px) {
  .calculator {
    height: 50.625rem;
    width: 37.5rem;
  }

  .display {
    height: 13.125rem;
    width: 35rem;
  }

  .display-input {
    height: 9.375rem;
    width: 36.25rem;
  }

  .display-operator {
    top: -0.938rem;
    right: 0.438rem;
    font-size: 3em;
  }

  .multiplying {
    top: -0.313rem;
  }

  .icon {
    margin-left: 0.625rem;
  }

  .label {
    margin-right: 1.125rem;
  }

  body.dark .icon {
    margin-right: 0.938rem;
  }

  body.dark .label {
    margin-left: 0.938rem;
  }

  button {
    padding: 1.563rem;
  }
}

@media (min-width: 1101px) {
  .calculator {
    height: 50rem;
    width: 37.5rem;
  }

  .display {
    height: 13.125rem;
    width: 35rem;
  }

  .display-input {
    height: 9.375rem;
    width: 36.25rem;
  }

  .display-operator {
    top: -0.938rem;
    right: 0.438rem;
    font-size: 3em;
  }

  .multiplying {
    top: -0.313rem;
  }

  .icon {
    margin-left: 0.938rem;
  }

  .label {
    margin-right: 0.938rem;
  }

  body.dark .icon {
    margin-right: 0.938rem;
  }

  body.dark .label {
    margin-left: 0.938rem;
  }

  button {
    padding: 1.563rem;
  }
}
