@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100..800&display=swap');

*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --dark-color: #222;
  --light-color: #ddd;

  --dark-text: #222;
  --light-text: white;

  --primary: #007bff;
  --primary-hover: #0056b3;
  --error: #d9534f;

  --bg: #f4f7f9;
  --light-bg: white;

  --shadow: rgba(0, 0, 0, 0.1);
}

body {
  font-family: "JetBrains Mono", monospace;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
  color: var(--dark-text);
}

input, select, textarea {
  font-size: 1rem;
}

input, button, select, textarea {
  font: inherit;
  color: inherit;
}

.card {
  background: var(--light-bg);
  padding: 1.75rem;
  border-radius: 1rem;
  border: 3px solid var(--dark-color);
  box-shadow: 4px 4px 0 var(--shadow);
  width: 100%;
  max-width: 400px;
}
#login-box, #reg-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 0.5rem;
}

.hidden {
  display: none !important;
}

.counter-container {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: column;
}

#counter-header {
  flex: 0 0 auto;

  padding: 0.5rem;
  align-self: stretch;

  display: flex;
  justify-content: right;
  align-items: center;
  gap: 1rem;
}

#counting-number {
  flex: 1 1 auto;

  font-size: min(30vw, 30vh);
  display: flex;
  justify-content: center;
  align-items: center;
}

#counter-actions {
  flex: 0 0 auto;

  padding: 0.5rem;
  width: min(100%, 414px);

  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#btn-plus, #btn-minus {
  flex: 1 0 calc(50% - (0.5rem / 2));
  border-radius: 100vw;
  height: revert;
}
#btn-plus svg, #btn-minus svg {
  width: 2rem;
  height: 2rem;
}
.options-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
input#final-number {
  width: 5rem;
}

.error {
  color: var(--error);
  padding: 0.75rem;
  font-size: 0.75rem;
  display: none;
}

/* ========== UI elements ========== */

input {
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--light-color);
  border-radius: 6px;
  box-sizing: border-box;
}
button {
  padding: 1rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
  font-size: 1rem;
  background: var(--dark-color);
  color: var(--light-text);
  height: 2rem;

  display: flex;
  justify-content: center;
  align-items: center;
}
.btn-main {
  /* background: var(--primary);
  color: var(--light-text); */
  padding: 0.75rem;
  height: auto;
}
/* .btn-main:hover {
  background: var(--primary-hover);
} */
.btn-link {
  background: none;
  color: var(--dark-text);
  text-decoration: underline;
}

/* The switcher */
.switcher-container {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--dark-color);
  gap: 2px;
  padding: 2px;
  border-radius: calc(0.25rem + 4px);
  background-color: var(--light-bg);
}
.switcher-btn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  border-radius: 0.25rem;
  color: var(--light-color);

  display: flex;
  justify-content: center;
  align-items: center;
}
.switcher-btn svg,
button svg {
  width: 1rem;
  height: 1rem;
}
.switcher-btn input {
  display: none;
}

/* on/off state */
.switcher-btn:has(input:checked) {
	background-color: var(--dark-color);
  color: var(--light-text);
}