
@charset "utf-8";
/* CSS Document */

body {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #101010;
  background-color: #edf4ff;
  border-block-start: 10px solid #f1d23a;
  padding: 3rem 1rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-block-end: 0.5em;
}

p:not(:last-child) {
  margin-block-end: 1em;
}

.widget {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
	
  width: 80vw;
  max-width: 600px;
  padding: 1rem;
  margin: 2rem auto;
  border-radius: 1rem;
  background-color: #fff;
  box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.025);
}

.tabs {
  --tab-count: 3;
  --active: 0;

  position: relative;
  isolation: isolate;
  display: flex;
  height: 3.5rem;
  border-block-end: 1px solid #e9ebec;
}

.tabs input {
  display: none;
}

.tabs label {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #656d7b;
  cursor: pointer;
  transition: color 0.5s ease-in-out;
}

.tabs input:checked + label {
  color: #101010;
}

.tabs::after {
  pointer-events: none;
  position: absolute;
  content: "";
  z-index: -1;
  /* inset: 0; */
  inset: 0 0 -1px;
  /* width: 100%; */
  /* width: calc((100% / 3) - 2px); */
  width: calc((100% / var(--tab-count)) - 2px);
  border-radius: 0.5rem 0.5rem 0 0;
  border: 1px solid #e9ebec;
  border-block-end: none;
  background-image: linear-gradient(#DDD, #fff);

  /*
    1st = 0 * 100% = 0%
    2nd = 1 * 100% = 100%
    3rd = 2 * 100% = 200%
  */
  translate: calc(var(--active) * 100%);
  transition: translate 0.5s ease-in-out;
}

.tabs:has(:checked:nth-of-type(1)) {
  --active: 0;
}

.tabs:has(:checked:nth-of-type(2)) {
  --active: 1;
}

.tabs:has(:checked:nth-of-type(3)) {
  --active: 2;
}

.tab-content {
  padding: 1rem;
}

[class^="tab-content-"] {
  display: none;
}

.widget:has(:checked:nth-of-type(1)) .tab-content-1,
.widget:has(:checked:nth-of-type(2)) .tab-content-2,
.widget:has(:checked:nth-of-type(3)) .tab-content-3 {
  display: block;
}
