.form-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  box-sizing: border-box;
  border: 0.12rem solid rgba(212, 175, 55, 0.55);
  border-radius: 1.4rem;
  background-color: rgba(23, 24, 31, 0.94);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.35);
}

.form-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(251, 237, 206, 0.1), rgba(17, 17, 20, 0.38)),
    radial-gradient(circle at top right, rgba(214, 163, 84, 0.12), transparent 42%);
  pointer-events: none;
}

.form-component {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.6rem;
}

.form-title {
  margin: 0;
  color: #f5e6c8;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0.08rem;
  text-align: center;
  font-family: "Cinzel", serif;
  font-weight: 700;
}

.form-details-text {
  margin: -0.2rem 0 0;
  color: rgba(245, 231, 205, 0.82);
  font-size: 0.98rem;
  line-height: 1.55;
  text-align: left;
  white-space: pre-line;
  font-family: "Caudex", serif;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.form-field-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.form-field-label-area {
  flex: 0 0 9rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.18rem;
  width: 9rem;
  max-width: 100%;
  padding-top: 0.8rem;
}

.form-field-label {
  margin: 0;
  display: block;
  max-width: calc(100% - 1.7rem);
  color: #e7d6ba;
  font-size: 1rem;
  line-height: 1.3;
  font-family: "Caudex", serif;
}

.form-field-control {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-field-shell {
  position: relative;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  color: #fff7eb;
  border: 0.12rem solid rgba(244, 223, 184, 0.18);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(251, 241, 221, 0.08), rgba(22, 22, 27, 0.45)),
    rgba(14, 15, 22, 0.72);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.form-field-input {
  width: 100%;
  min-width: 0;
  padding: 0.95rem 1rem;
  border: none;
  outline: none;
  box-sizing: border-box;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1.4;
  font-family: "Caudex", serif;
}

.form-field-input::placeholder {
  color: rgba(235, 221, 194, 0.48);
}

.form-field-input:is(:autofill, :-webkit-autofill),
.form-field-input:is(:autofill, :-webkit-autofill):hover,
.form-field-input:is(:autofill, :-webkit-autofill):focus,
.form-field-input:is(:autofill, :-webkit-autofill):active {
  border-radius: inherit;
  background-color: transparent;
  color: inherit;
  caret-color: inherit;
  -webkit-text-fill-color: inherit;
  box-shadow: none;
  -webkit-box-shadow: none;
  transition: background-color 999999s ease-out 0s, color 999999s ease-out 0s;
}

.form-field-input-secret {
  padding-right: 3.8rem;
}

.form-field-shell:focus-within {
  border-color: rgba(214, 163, 84, 0.65);
  box-shadow: 0 0 0.7rem rgba(214, 163, 84, 0.22);
}

.form-secret-toggle {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background-color: transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.form-secret-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.form-secret-toggle:active {
  transform: translateY(-50%) scale(0.96);
}

.form-secret-toggle img {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  pointer-events: none;
  flex: 0 0 auto;
}

.form-helper-overlay-anchor {
  position: relative;
  top: -0.35rem;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.form-helper-toggle {
  width: 1.0rem;
  height: 1.0rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0.08rem solid rgba(244, 223, 189, 0.34);
  border-radius: 999rem;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18), transparent 58%),
    linear-gradient(180deg, rgba(222, 188, 132, 0.2), rgba(74, 50, 24, 0.24)),
    rgba(255, 255, 255, 0.05);
  color: rgba(255, 239, 210, 0.94);
  font-size: 0.96rem;
  line-height: 1;
  font-weight: 700;
  font-style: italic;
  text-indent: -0.04rem;
  font-family: "Baskerville", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  cursor: pointer;
  box-shadow:
    inset 0 0.05rem 0.14rem rgba(255, 255, 255, 0.12),
    0 0.3rem 0.7rem rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-helper-toggle:hover,
.form-helper-toggle:focus-visible {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.24), transparent 56%),
    linear-gradient(180deg, rgba(233, 203, 150, 0.28), rgba(92, 61, 29, 0.28)),
    rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 223, 189, 0.56);
  transform: translateY(-0.04rem) scale(1.03);
  box-shadow:
    inset 0 0.06rem 0.16rem rgba(255, 255, 255, 0.16),
    0 0.45rem 0.95rem rgba(0, 0, 0, 0.24);
  outline: none;
}

.form-helper-overlay-anchor > .overlay-wrapper.overlay-wrapper-passive {
  display: none;
}

.form-helper-overlay-body {
  max-width: 18rem;
  padding: 0.78rem 0.92rem;
  border: 0.08rem solid rgba(94, 84, 73, 0.18);
  border-radius: 0.95rem;
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(238, 230, 216, 0.98));
  box-shadow: 0 0.9rem 2.2rem rgba(16, 18, 24, 0.22);
}

.form-helper-overlay-text {
  margin: 0;
  color: #40372f;
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-line;
  font-family: "Caudex", serif;
}

.form-submit-button {
  align-self: flex-end;
  min-width: 10rem;
  padding: 0.9rem 1.45rem;
  border: 0.12rem solid rgba(241, 209, 152, 0.5);
  border-radius: 999rem;
  background:
    linear-gradient(180deg, rgba(223, 173, 95, 0.95), rgba(144, 96, 36, 0.96));
  color: #fff9f0;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.09rem;
  text-transform: uppercase;
  font-family: "Cinzel Decorative", serif;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.6rem 1.5rem rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.form-submit-button:hover {
  transform: translateY(-0.08rem);
  filter: brightness(1.06);
  box-shadow: 0 0.8rem 1.8rem rgba(0, 0, 0, 0.36);
}

.form-submit-button:active {
  transform: translateY(0);
}

.form-mandatory-floating-text {
  position: absolute;
  margin: 0;
  padding: 0;
  color: #c0392b;
  font-size: 0.82rem;
  line-height: 1.2;
  letter-spacing: 0.03rem;
  max-width: min(14rem, calc(100vw - 1.5rem));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Caudex", serif;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, -50%, 0);
  transform-origin: center center;
  animation: form-mandatory-floating-text-lifecycle 1.9s linear forwards;
  will-change: opacity, transform;
  z-index: 10050;
}

.form-field-shell-error {
  animation: form-field-error-pulse 0.9s ease-in-out infinite;
}

@keyframes form-mandatory-floating-text-lifecycle {
  0% {
    opacity: 0;
    transform: translate3d(0, -50%, 0);
  }

  10.5263% {
    opacity: 1;
    transform: translate3d(0, -50%, 0);
  }

  50% {
    opacity: 1;
    transform: translate3d(0, calc(-50% - 0.2rem), 0);
  }

  89.4737% {
    opacity: 1;
    transform: translate3d(0, -50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate3d(0, -50%, 0);
  }
}

@keyframes form-field-error-pulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-0.04rem);
  }
}

@media (max-width: 48rem) {
  .form-component {
    padding: 1.25rem;
  }

  .form-field-row {
    flex-direction: column;
    gap: 0.55rem;
  }

  .form-field-label-area {
    flex: 0 0 auto;
    width: auto;
    padding-top: 0;
  }

  .form-field-label {
    flex: 0 0 auto;
  }

  .form-submit-button {
    align-self: stretch;
  }
}
