@font-face {
  font-family: Roboto;
  src: url('fonts/Roboto/Roboto-Regular.ttf');
}

@font-face {
  font-family: 'Roboto Slab';
  src: url('fonts/Roboto_Slab/RobotoSlab-Regular.ttf');
}

* {
  box-sizing: border-box;
}

/* 
Color palette taken from Acorn design system
https://acorn.firefox.com/latest/styles/color.html#section-semantic-color-palette-c2 
*/
:root {
  font-size: 18px;

  --border: #e0e0e6;
  --duration: 300ms;
}

:root.light {
  --accent-primary: #0060df;
  --bg-layer-1: #f9f9fb;
  --bg-layer-2: #ffffff;
  --bg-layer-3: #f0f0f4;
  --text-primary: #15141a;
  --text-secondary: #5b5b66;
  --text-disabled: rgba(21 20 26 / 40%);
  --text-error: #c50042;
}

:root.dark {
  --accent-primary: #00ddff;
  --bg-layer-1: #2b2a33;
  --bg-layer-2: #42414d;
  --bg-layer-3: #1c1b22;
  --text-primary: #fbfbfe;
  --text-secondary: #cfcfd8;
  --text-disabled: rgba(251 251 254 / 40%);
  --text-error: #ff9aa2;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  background-color: var(--bg-layer-1);
}

main {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  min-width: 320px;
  min-height: 480px;
  height: auto;
  padding: 1rem;
  font-family: Roboto, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Roboto Slab', serif;
}

h1 {
  display: flex;
  align-items: baseline;
}

input,
button {
  border-style: solid;
  border-color: var(--border);
  border-radius: 4px;
  font-family: 'Roboto Slab', serif;
  font-size: 1rem;
}

h1 small {
  margin-left: auto;
  color: var(--text-disabled);
}

ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

form,
li {
  display: flex;
}

button.primary {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary);
  color: var(--bg-layer-1);
}

form input {
  width: 100%;
  height: 40px;
  margin-right: 0.5rem;
  padding-left: 0.5rem;
}

ul li {
  display: flex;
  align-items: center;
  height: 40px;
}

input.toggle + label {
  position: relative;
  display: flex;
  align-items: center;
}

input.toggle + label::after {
  position: absolute;
  display: block;
  width: 0;
  height: 1px;
  margin-top: 4px;
  background-color: var(--text-primary);
  transition-duration: var(--duration);
  transition-property: width;
  content: '';
}

input.toggle:checked + label::after {
  width: 100%;
}

ul input {
  margin-right: 0.5rem;
}

button {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  min-width: 60px;
  margin-left: auto;
  padding: 0 1rem;
  border-style: solid;
  border-radius: 4px;
}

button.text {
  transition-duration: var(--duration);
  transition-property: color, background-color;
  border: 0;
  background-color: var(--bg-layer-1);
}

button.text:hover,
button.text:focus {
  background-color: var(--bg-layer-3);
}

button.text.destructive:hover,
button.text.destructive:focus {
  color: var(--text-error);
}

li button.destructive {
  opacity: 0;
  transition-property: opacity;
  transition-duration: var(--duration);
}

button.destructive:focus,
li:hover button.destructive,
input:focus ~ button.destructive {
  opacity: 1;
}

p.empty {
  color: var(--text-disabled);
  line-height: 1.5;
}
