/* Form controls adapted from Uiverse.io (MIT, https://github.com/uiverse-io/galaxy).
 * All of them sit on the painting or on the deep-blue drawer, so they default to light-on-dark.
 * Native inputs stay in the DOM (visually hidden, still focusable) so keyboards and screen readers work. */

fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ── Uiverse.io by alexruix: Toggle-switches/alexruix_splendid-liger-23 ─ day / night ─ */
.uv-daynight {
  position: relative;
  display: inline-block;
  flex: none;
  width: 3.5em;
  height: 2em;
  margin-block: 5px;
  font-size: 17px;
}

.uv-daynight__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.uv-daynight__slider {
  --bg: #2f5fe6;
  position: absolute;
  inset: 0;
  border: 1px solid rgb(246 244 238 / 0.55);
  border-radius: 30px;
  background-color: var(--bg);
  transition: background-color 0.5s;
}

.uv-daynight__slider::before {
  content: "";
  position: absolute;
  bottom: 15%;
  left: 10%;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 15px -4px 0 15px #ffd24a;
  transition: transform 0.5s, box-shadow 0.5s, background-color 0.5s;
}

.uv-daynight__input:checked + .uv-daynight__slider {
  --bg: #10194f;
}

.uv-daynight__input:checked + .uv-daynight__slider::before {
  transform: translateX(100%);
  box-shadow: inset 8px -4px 0 0 var(--cream-100);
}

.uv-daynight__input:focus-visible + .uv-daynight__slider,
.uv-switch__input:focus-visible + .uv-switch__slider {
  outline: 3px solid var(--art-focus);
  outline-offset: 3px;
}

/* ── Uiverse.io by gharsh11032000: Toggle-switches/gharsh11032000_brave-pug-20 ─ switch ─ */
.uv-switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 3.5em;
  height: 2em;
  margin-block: 5px;
  font-size: 17px;
}

.uv-switch__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.uv-switch__slider {
  position: absolute;
  inset: 0;
  border: 2px solid rgb(246 244 238 / 0.75);
  border-radius: 50px;
  transition: border-color 0.4s, background-color 0.4s;
}

.uv-switch__slider::before {
  content: "";
  position: absolute;
  bottom: 0.2em;
  left: 0.2em;
  width: 1.4em;
  height: 1.4em;
  border-radius: inherit;
  background: var(--cream-100);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.4s;
}

.uv-switch__input:checked + .uv-switch__slider {
  border-color: var(--gold-500);
  background: rgb(244 183 49 / 0.2);
}

.uv-switch__input:checked + .uv-switch__slider::before {
  transform: translateX(1.5em);
  background: var(--gold-500);
}

/* ── Uiverse.io by andrew-demchenk0: Radio-buttons/andrew-demchenk0_stupid-seahorse-9 ─ segmented ─ */
.uv-segment {
  display: flex;
  width: min(100%, 340px);
  padding: 2px;
  border: 2px solid var(--text);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--accent);
}

.uv-segment__option {
  position: relative;
  flex: 1;
  min-height: 44px;
}

.uv-segment__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 50px;
  appearance: none;
  cursor: pointer;
}

.uv-segment__label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 8px;
  border-radius: 50px;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: normal;
  transition: background-color 0.2s, color 0.2s;
}

.uv-segment__input:checked + .uv-segment__label {
  background: var(--text);
  color: var(--bg);
}

.uv-segment__input:focus-visible + .uv-segment__label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── Uiverse.io by rricol: Inputs/rricol_moody-cow-18 ─ underline field ─ */
.uv-field {
  position: relative;
  display: flex;
  flex: 1 1 260px;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.uv-field__label {
  margin: 0 0 2px 1px;
  color: var(--on-art);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.uv-field__input {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 2px 0 0 rgb(246 244 238 / 0.8);
  color: var(--on-art);
  font-size: 1.0625rem;
  transition: box-shadow 0.2s ease-in-out;
}

.uv-field__input::placeholder {
  color: rgb(246 244 238 / 0.72);
}

.uv-field__input:focus {
  outline: none;
  box-shadow: 0 3px 0 0 var(--gold-500);
}

.uv-field__input:-webkit-autofill {
  -webkit-text-fill-color: var(--on-art);
  caret-color: var(--on-art);
  transition: background-color 600000s 0s;
}

.uv-field__help {
  position: absolute;
  top: 100%;
  left: 1px;
  margin-top: 5px;
  color: var(--on-art-muted);
  font-size: 0.75rem;
  line-height: 1.3;
  visibility: hidden;
  transform: translateY(-0.4rem);
  transition: transform 0.1s linear;
}

.uv-field__input:focus + .uv-field__help,
.uv-field[data-invalid="true"] .uv-field__help {
  visibility: visible;
  transform: none;
}

.uv-field[data-invalid="true"] .uv-field__input {
  box-shadow: 0 3px 0 0 var(--gold-500);
}

.uv-field[data-invalid="true"] .uv-field__help {
  color: var(--gold-500);
  font-weight: 600;
}

.uv-field[data-invalid="true"] .uv-field__help::before {
  content: "! ";
}

/* ── Uiverse.io by Gautammsharma: Checkboxes/Gautammsharma_massive-rabbit-40 ─ consent ─ */
.uv-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--on-art);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}

.uv-check__input {
  position: absolute;
  left: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.uv-check__box {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--cream-100);
  border-radius: 4px;
  transition: border-color 0.3s, background-color 0.3s;
}

.uv-check:hover .uv-check__box {
  border-color: var(--gold-500);
}

.uv-check__input:checked + .uv-check__box {
  border-color: var(--cream-100);
  background: var(--cream-100);
}

.uv-check__input:checked + .uv-check__box::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 6px;
  width: 5px;
  height: 11px;
  border: solid var(--ink-900);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.uv-check__input:focus-visible + .uv-check__box,
.uv-burst__input:focus-visible + .uv-burst__mark {
  box-shadow: 0 0 0 3px var(--art-focus);
}

.uv-check[data-invalid="true"] .uv-check__box,
.uv-burst[data-invalid="true"] .uv-burst__mark {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgb(244 183 49 / 0.45);
}

/* ── Uiverse.io by liyaxu123: Inputs/liyaxu123_warm-eel-62 ─ field with a jumping label ─ */
.uv-wavelabel {
  position: relative;
  margin: 24px 0 6px;
  text-align: left;
}

.uv-wavelabel__input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 0;
  border: 0;
  border-bottom: 2px solid var(--cream-100);
  border-radius: 0;
  background: transparent;
  color: var(--cream-50);
  font-size: 1.125rem;
}

.uv-wavelabel__input:focus,
.uv-wavelabel__input:not(:placeholder-shown) {
  outline: 0;
  border-bottom-color: var(--gold-500);
}

.uv-wavelabel__input:focus-visible {
  outline: 3px solid var(--art-focus);
  outline-offset: 4px;
}

.uv-wavelabel__label {
  position: absolute;
  top: 14px;
  left: 0;
  color: var(--cream-100);
  pointer-events: none;
}

.uv-wavelabel__chars {
  display: inline-block;
  min-width: 5px;
  font-size: 1.125rem;
  transition: transform 0.3s var(--ease), color 0.3s;
}

.uv-wavelabel__input:focus + .uv-wavelabel__label .uv-wavelabel__chars,
.uv-wavelabel__input:not(:placeholder-shown) + .uv-wavelabel__label .uv-wavelabel__chars {
  color: var(--gold-500);
  transform: translateY(-30px);
}

.uv-wavelabel__help {
  display: block;
  margin-top: 6px;
  color: var(--on-art-muted);
  font-size: 0.75rem;
  visibility: hidden;
}

.uv-wavelabel[data-invalid="true"] .uv-wavelabel__help {
  visibility: visible;
  color: var(--gold-500);
  font-weight: 600;
}

.uv-wavelabel[data-invalid="true"] .uv-wavelabel__help::before {
  content: "! ";
}

.uv-wavelabel[data-invalid="true"] .uv-wavelabel__input {
  border-bottom-color: var(--gold-500);
}

/* ── Uiverse.io by escannord: Radio-buttons/escannord_purple-gecko-48 ─ radio cards ─ */
.uv-radiocards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.uv-radiocards__item {
  position: relative;
}

.uv-radiocards__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.uv-radiocards__label {
  --border: rgb(246 244 238 / 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.06);
  color: var(--cream-50);
  text-align: left;
  transition: border-color 0.2s, background-color 0.2s;
}

.uv-radiocards__item:hover .uv-radiocards__label {
  --border: var(--cream-100);
}

.uv-radiocards__dot {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgb(246 244 238 / 0.35);
}

.uv-radiocards__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.uv-radiocards__text strong {
  font-size: 0.9375rem;
  font-weight: 600;
}

.uv-radiocards__text small {
  font-size: 0.75rem;
  opacity: 0.88;
}

.uv-radiocards__input:checked + .uv-radiocards__label {
  --border: var(--gold-500);
  padding: 11px 13px;
  border-width: 2px;
  background: rgb(244 183 49 / 0.12);
}

.uv-radiocards__input:checked + .uv-radiocards__label .uv-radiocards__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold-500);
  transform: translate(-50%, -50%);
}

.uv-radiocards__input:focus-visible + .uv-radiocards__label {
  outline: 3px solid var(--art-focus);
  outline-offset: 2px;
}

/* ── Uiverse.io by catraco: Checkboxes/catraco_hungry-squid-59 ─ consent with a burst ─ */
.uv-burst {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--cream-100);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}

.uv-burst__input {
  position: absolute;
  left: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.uv-burst__mark {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--cream-100);
  border-radius: 50%;
  background: rgb(246 244 238 / 0.14);
}

.uv-burst__tick {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--gold-500);
  transform: scale(0);
  transition: transform 0.3s;
}

.uv-burst__tick::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 8px;
  width: 4px;
  height: 9px;
  border: solid var(--ink-900);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.uv-burst__input:checked + .uv-burst__mark .uv-burst__tick {
  transform: scale(1);
}

.uv-burst__celebrate {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  translate: -50% -50%;
  fill: none;
  stroke: var(--gold-500);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.uv-burst__input:checked + .uv-burst__mark .uv-burst__celebrate {
  display: block;
  animation: uv-celebrate 0.4s forwards;
}

@keyframes uv-celebrate {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}
