/* styles.css */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f2f2f2;
}

form {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn {
  flex: 1; /* works only if parent uses display:flex */
  position: fixed; /* fixes element to the viewport */
  top: 10px; /* position from top */
  left: 10px; /* position from left */
  display: inline-block;
  padding: 8px 16px;
  background: #444;
  color: #fff;
  border-radius: 5px;
  text-decoration: none;
}

.btn:hover {
  background: #666;
}

h2 {
  margin-top: 0;
  text-align: center;
}

/* Form structure */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  padding-top: 8px;
  min-width: 250px;
  display: flex;
  flex-direction: column;
}

/* Label and input styling */
label {
  margin-bottom: 5px;
  font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  padding: 10px;
  font-size: 1em;
  border: 1.5px solid #bbb;
  border-radius: 5px;
  transition: border-color 0.3s ease;
  letter-spacing: normal; /* <-- THIS fixes the visual change */
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: #0066cc;
}

.validatable-input {
  font-family: inherit !important;
  font-size: 1em !important;
  padding: 10px !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  border: 1.5px solid #bbb !important;
  border-radius: 5px !important;
  box-sizing: border-box !important;
}

/* Only show red borders if the field has been touched and is invalid */
input.invalid:not(.touched) {
  border: 1.5px solid #bbb;
}

input.invalid.touched {
  border: 2px solid red;
}

/* Error message styling */
.error-msg {
  color: red;
  font-size: 0.9em;
  display: none;
  margin-top: 5px;
}

/* Success indicator */
.valid {
  border: 2px solid green;
}

/* Submit button */
button[type="submit"] {
  background-color: #0066cc;
  color: white;
  padding: 12px 20px;
  font-size: 1em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
  background-color: #004a99;
}

/* Shared style for add buttons */
.add-button {
  margin-top: 4px;
  padding: 10px 4px;
  font-size: 1em;
  font-weight: 600;
  color: white;
  background-color: #0077cc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.add-button:disabled {
  background-color: #a1a1a1;
  cursor: not-allowed;
}

.add-button:hover:not(:disabled) {
  background-color: #005fa3;
}

/* Remove buttons */
.remove-btn {
  height: 36px;
  margin-left: auto; /* aligns the button to the right */
  background-color: #d43f3a;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0 12px;
  font-weight: 600;
  font-size: 1em;
  line-height: 1;
  transition: background-color 0.3s ease;
}

.remove-btn:hover {
  background-color: #a92f2c;
}

/* Facility row styling */
.facility-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.facility-row input {
  flex: 1 1 200px; /* flexible, min 200px */
}

.facility-group {
  flex: 1;
}

.facility-label {
  display: block;
  margin-bottom: 4px;
}

.facility-input {
  width: 100%;
}

/* Fieldset and legend */
fieldset {
  margin-top: 30px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 20px;
  font-family: Arial, sans-serif;
}

legend {
  font-weight: 700;
  font-size: 1.2em;
  color: #004a99;
  padding: 0 10px;
}

/* Nursing container and member */
#nursing-container {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.nursing-member {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px 20px;
  background-color: #fafafa;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 20px;
  align-items: end;
  position: relative;
}

.nursing-member > div {
  display: flex;
  flex-direction: column;
}

.nursing-member label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.nursing-member input,
.nursing-member select {
  padding: 8px 10px;
  border-radius: 5px;
  border: 1.5px solid #ccc;
  font-size: 1em;
  transition: border-color 0.25s ease;
}

.nursing-member input:focus,
.nursing-member select:focus {
  outline: none;
  border-color: #0077cc;
  box-shadow: 0 0 5px rgba(0, 119, 204, 0.4);
}

/* Error messages */
.error-message {
  color: #d43f3a;
  font-size: 0.85em;
  margin-top: 4px;
}

/* Input validation states */
input.invalid,
select.invalid {
  border-color: #d43f3a !important;
  background-color: #ffe5e5;
}

input.valid,
select.valid {
  border-color: #3ca34d !important;
  background-color: #e7f8e7;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .nursing-member {
    grid-template-columns: 1fr;
  }

  .remove-btn {
    position: static;
    margin-top: 12px;
    align-self: start;
    width: 100%;
  }
}

/*pricvate insurance */
#private-insurance-container {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.private-insurance-row {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px 20px;
  background-color: #fafafa;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 20px;
  align-items: end;
  position: relative; /* IMPORTANT for absolute remove btn */
}

.private-insurance-row > div {
  display: flex;
  flex-direction: column;
}

.private-insurance-row label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.private-insurance-row input {
  padding: 8px 10px;
  border-radius: 5px;
  border: 1.5px solid #ccc;
  font-size: 1em;
  transition: border-color 0.25s ease;
}

.private-insurance-row input:focus {
  outline: none;
  border-color: #0077cc;
  box-shadow: 0 0 5px rgba(0, 119, 204, 0.4);
}

.remove-btn {
  position: absolute; /* absolute inside container */
  top: 125px;
  right: 12px;
  background-color: #d43f3a;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 12px;
  font-weight: bold;
  font-size: 1.1em;
  line-height: 1;
  transition: background-color 0.2s ease;
  margin: 0;
  height: 36px;
}

.remove-btn:hover {
  background-color: #a92f2c;
}

.error-message {
  color: #d43f3a;
  font-size: 0.85em;
  margin-top: 4px;
  display: none;
}

input.invalid {
  border-color: #d43f3a !important;
  background-color: #ffe5e5;
}

input.valid {
  border-color: #3ca34d !important;
  background-color: #e7f8e7;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .private-insurance-row {
    grid-template-columns: 1fr;
  }

  .remove-btn {
    position: static;
    margin-top: 12px;
    align-self: start;
    width: 100%;
  }
}

.form-background-image {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 150px; /* Adjust as needed */
  opacity: 0.1; /* Low opacity so it's subtle */
  z-index: 0; /* Ensure it's behind the form */
  pointer-events: none; /* So it doesn't block form interaction */
}

form {
  position: relative;
  z-index: 1; /* Ensures it's on top of the image */
  background-color: rgba(
    255,
    255,
    255,
    0
  ); /* Optional: semi-transparent background for the form */
  padding: 20px;
}

input.input-error {
  border: 2px solid red !important;
}

input.input-valid {
  border: 2px solid green !important;
}

.recaptcha-wrapper {
  text-align: center;
  padding-top: 15px;
  padding-bottom: 60px;
}

.recaptcha-large {
  transform: scale(1.5);
  transform-origin: top center;
  display: inline-block;
}

.recaptcha-large iframe {
  border-radius: 8px;
  border: 2px solid #005aa7;
}

@media (max-width: 500px) {
  .recaptcha-large {
    transform: scale(1);
  }
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.form-navigation {
  display: flex;
  justify-content: center;
  /* CENTER buttons */
  gap: 20px;
  /* space between buttons */
  margin-top: 30px;
}

/* Shared button base */
.btn-next,
.btn-back {
  padding: 12px 24px;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  style: center;
  transition: all 0.2s ease;
}

/* NEXT — Primary Action */
.btn-next {
  background: linear-gradient(135deg, #005aa7, #004a8c);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 90, 167, 0.25);
}

.btn-next:hover {
  background: linear-gradient(135deg, #004a8c, #003a6f);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 90, 167, 0.35);
}

.btn-next:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0, 90, 167, 0.25);
}

/* BACK — Secondary Action */
.btn-back {
  background: #ffffff;
  color: #005aa7;
  border: 2px solid #005aa7;
}

.btn-back:hover {
  background: #f0f6ff;
}

.btn-back:active {
  background: #e2edff;
}

/* Disabled */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.box {
  display: block;
  width: fit-content;
  margin: 20px auto;
  background-color: #444;
  border: 3px solid #eeff00;
  padding: 15px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 2em;
  font-family: "Fredoka One", cursive;
  font-weight: bold;
  margin: 0;
  color: #000;
  -webkit-text-stroke: 1px #eeff00;
}

.ambulance {
  position: relative;
  /* so smoke can be positioned relative to it */
  display: inline-block;
  transition: transform 1.5s ease-in-out;
  will-change: transform;
}

/* initial facing */
.ambulance.left {
  transform: scaleX(1);
}

.ambulance.right {
  transform: scaleX(-1);
}

/* animate drive away */
.box:hover .ambulance.left {
  transform: scaleX(1) translateX(-250%) rotate(10deg);
}

.box:hover .ambulance.right {
  transform: scaleX(-1) translateX(-250%) rotate(10deg);
}

/* smoke puffs */
.ambulance::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 90%;
  width: 8px;
  height: 8px;
  background: rgba(200, 200, 200, 0.8);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-100%, 0) scale(0.5);
}

/* trigger smoke when box is hovered */
.box:hover .ambulance::after {
  animation: smoke 0.7s ease-out infinite;
}

/* keyframes for smoke puff rising/fading */
@keyframes smoke {
  0% {
    opacity: 0.7;
    transform: translate(-0%, -0) scale(0.5);
  }

  50% {
    opacity: 0.5;
    transform: translate(-0%, -15px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-0%, -30px) scale(1.5);
  }
}

/* GROUPING */
.survey-group {
  margin-bottom: 20px;
}

/* LABELS */
.survey-label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

/* INPUTS */
.survey-input,
.survey-textarea,
.survey-select {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border: 1.5px solid #bbb;
  border-radius: 6px;
  transition: all 0.25s ease;
}

/* FOCUS EFFECT */
.survey-input:focus,
.survey-textarea:focus,
.survey-select:focus {
  outline: none;
  border-color: #0077cc;
  box-shadow: 0 0 5px rgba(0, 119, 204, 0.3);
}

/* TEXTAREA */
.survey-textarea {
  resize: vertical;
}

/* OPTIONS (RADIO / CHECKBOX) */
.survey-options label {
  display: block;
  margin-bottom: 6px;
  font-weight: normal;
  cursor: pointer;
}

.survey-options input {
  margin-right: 6px;
}

/* RANGE SLIDER */
.survey-range {
  width: 100%;
}

/* TOGGLE SWITCH */
.survey-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.survey-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.survey-switch .slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 24px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.3s;
}

.survey-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.survey-switch input:checked + .slider {
  background-color: #0077cc;
}

.survey-switch input:checked + .slider:before {
  transform: translateX(26px);
}

/* SUBMIT BUTTON */
.survey-submit {
  background-color: #28a745;
  color: white;
  padding: 12px;
  font-size: 1em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s ease;
}

.survey-submit:hover {
  background-color: #218838;
}

/* VALIDATION STATES */
input.invalid,
select.invalid,
textarea.invalid {
  border-color: #d43f3a;
  background-color: #ffe5e5;
}

input.valid,
select.valid,
textarea.valid {
  border-color: #3ca34d;
  background-color: #e7f8e7;
}

/* ERROR MESSAGE */
.error-msg {
  color: #d43f3a;
  font-size: 0.85em;
  margin-top: 5px;
  display: none;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .survey-form {
    padding: 20px;
  }
}

/* Container to keep things together */
.survey-header {
  position: relative;
  cursor: pointer;
  margin-bottom: 20px;
}

/* Description starts hidden */
.description-box {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease-in-out;
  margin-top: 0 !important; /* Prevent gap when hidden */
  transform: translateY(-10px);
}

/* Show on Hover */
.survey-header:hover .description-box,
.survey-header.is-active .description-box {
  max-height: 500px; /* Large enough for any text */
  opacity: 1;
  margin-top: 10px !important;
  transform: translateY(0);
}

/* Optional: Subtle glow on the title box when active/hovered */
.survey-header:hover .title-box {
  border-color: #ffcc00;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}
.description-area {
  background: rgba(40, 40, 40, 0.8); /* Dark gray to match your theme */
  border-left: 5px solid #ffcc00; /* BCEMS Yellow accent */
  margin: 20px auto;
  padding: 15px 20px;
  border-radius: 4px;
  max-width: 800px; /* Match your container width */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.description-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.info-icon {
  background: #ffcc00;
  color: #1a1a1a;
  font-family: "Fredoka One", cursive;
  font-style: normal;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  flex-shrink: 0;
}

.description-content p {
  margin: 0;
  color: #e0e0e0;
  font-size: 1.1rem;
  line-height: 1.5;
  font-weight: 400;
}

.survey-file {
    width: 100%;
    padding: 10px;
    border: 1px solid #555;
    background: #222;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.survey-file::-webkit-file-upload-button {
    background: #ffcc00;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
    border-radius: 4px;
}

.survey-file::-webkit-file-upload-button:hover {
    background: #e6b800;
}