/* --- Your original font classes --- */
.caudex-regular {
  font-family: "Caudex", serif;
  font-weight: 400;
  font-style: normal;
}
.caudex-bold {
  font-family: "Caudex", serif;
  font-weight: 700;
  font-style: normal;
}
.caudex-regular-italic {
  font-family: "Caudex", serif;
  font-weight: 400;
  font-style: italic;
}
.caudex-bold-italic {
  font-family: "Caudex", serif;
  font-weight: 700;
  font-style: italic;
}

body {
  font-family: "Work Sans", sans-serif;
  font-weight: 500;
  margin: auto;
  background-image: url(/johnsonFamily_bg_1920.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 60vh;
  color: white;
  text-shadow: 2px 2px 5px black;
  font-size: 1.125rem;
}

/* LIGHTER card; remove dark overlay */
.content {
  border: 2px solid black;
  border-radius: 10px;
  width: 40%;
  height: auto;
  margin: 20px;
  padding: 10px;
  justify-self: center;
  align-self: center;
  background: transparent; /* was rgba(0,0,0,0.55) */
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: 5px 5px 15px black;
}

h1 {
  text-align: center;
  color: rgb(214, 145, 42);
  text-shadow: 1px 1px 2px black;
}

.intro {
  text-align: center;
  font-style: italic;
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: rgb(214, 145, 42);
  text-shadow: 1px 1px 2px black;
}

fieldset {
  margin: 10px;
  padding: 10px;
  text-align: left;
}

label {
  display: inline-block;
  text-align: right;
  width: 30%;
  margin-bottom: 20px;
  white-space: nowrap;
}

input {
  width: 50%;
  margin-bottom: 20px;
}

#funFact {
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}

.message {
  font-size: 1.25rem;
  justify-self: center;
  text-align: center;
}

textarea {
  width: 100%;
  max-width: 100%;
  min-width: 200px;
  box-sizing: border-box;
  resize: vertical;
}

.submitBtn {
  background-color: green;
  color: white;
  font-weight: bold;
  border: none;
  padding: 10px;
  margin-top: 10px;
  cursor: pointer;
  box-shadow: 1px 1px 5px black;
}
.clearBtn {
  background-color: red;
  color: white;
  font-weight: bold;
  border: none;
  padding: 10px;
  margin-top: 10px;
  cursor: pointer;
  box-shadow: 1px 1px 5px black;
}
.buttons {
  justify-self: center;
  text-align: center;
  width: 50%;
}

.red {
  color: red;
}

/* === Mobile-first fixes === */
.content {
  width: min(92vw, 820px);
  margin: 20px auto;
  padding: 16px;
}
input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
}
label {
  display: block;
  width: auto;
  text-align: left;
  margin: 0 0 6px;
  white-space: normal;
}
fieldset {
  margin: 12px 0;
  padding: 12px;
}
.message {
  text-align: left;
}
#funFact {
  text-align: left;
}
.buttons {
  width: 100%;
}
.submitBtn,
.clearBtn {
  width: 100%;
  display: block;
  padding: 12px 14px;
  margin: 10px 0;
  border-radius: 8px;
}
h1 {
  font-size: clamp(1.4rem, 3.5vw + 0.8rem, 2.2rem);
}
.intro {
  font-size: clamp(1rem, 2.5vw + 0.6rem, 1.25rem);
}

@media (min-width: 720px) {
  label {
    display: inline-block;
    width: 30%;
    text-align: right;
    margin: 0 12px 14px 0;
    white-space: nowrap;
  }
  input,
  select {
    width: 60%;
    display: inline-block;
    margin-bottom: 14px;
  }
  .message,
  #funFact {
    text-align: center;
  }
  .submitBtn,
  .clearBtn {
    width: auto;
    display: inline-block;
    margin: 10px 6px 0;
  }
}
@media (max-width: 360px) {
  body {
    font-size: 1rem;
  }
  fieldset {
    padding: 10px;
  }
}

/* === Non-shifting error indicators === */
.input-error {
  border: 2px solid #ff6666 !important;
  outline: none;
}

.error-label::after {
  content: " (required)";
  color: #ff6666;
  position: absolute;
  right: 0;
  top: 0;
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
  pointer-events: none;
}
