/* SAFC Survey Site — style.css
   Mobile-first, accessible, clean layout.
   Palette: SAFC red #EB172B, white #FFFFFF, dark text #1a1a1a on light bg #f9f9f9.
*/

/* ===== Reset & Base ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #f9f9f9;
}

/* ===== Container ===== */

.container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ===== Typography ===== */

h1, h2, h3 {
  color: #1a1a1a;
  line-height: 1.3;
  margin-top: 0;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 3px solid #EB172B;
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: #EB172B;
  text-decoration: underline;
}

a:hover,
a:focus {
  color: #b8101f;
  outline: 2px solid #EB172B;
  outline-offset: 2px;
}

/* ===== Header accent bar ===== */

.header-bar {
  background-color: #EB172B;
  color: #FFFFFF;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* ===== Section separators (survey form groups) ===== */

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
}

/* ===== Landing page intro & verification sections ===== */

.survey-intro {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.verification {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ===== Form elements ===== */

form {
  margin: 0;
}

fieldset {
  border: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

legend {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
  padding: 0;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Radio buttons and checkboxes */

.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.radio-group label,
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.radio-group label:hover,
.checkbox-group label:hover {
  background-color: #f0f0f0;
}

input[type="radio"],
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #EB172B;
  flex-shrink: 0;
}

/* Text inputs and textareas */

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: #FFFFFF;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus {
  border-color: #EB172B;
  box-shadow: 0 0 0 3px rgba(235, 23, 43, 0.15);
  outline: none;
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

/* Scale input (1-5 rating) */

.scale-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.scale-group label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 3rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.scale-group label:hover {
  background-color: #f0f0f0;
  border-color: #EB172B;
}

.scale-group input[type="radio"]:checked + .scale-label,
.scale-group label:has(input:checked) {
  background-color: #EB172B;
  color: #FFFFFF;
  border-color: #EB172B;
}

.scale-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.scale-endpoints {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.25rem;
}

/* ===== Buttons ===== */

button,
input[type="submit"],
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #FFFFFF;
  background-color: #EB172B;
  border: 2px solid #EB172B;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
  background-color: #c91324;
  border-color: #c91324;
}

button:focus,
input[type="submit"]:focus,
.btn:focus {
  outline: 3px solid #EB172B;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(235, 23, 43, 0.3);
}

button:active,
input[type="submit"]:active,
.btn:active {
  background-color: #a10f1d;
}

.btn-secondary {
  background-color: #FFFFFF;
  color: #EB172B;
  border-color: #EB172B;
}

.btn-secondary:hover {
  background-color: #fef2f3;
}

/* ===== Question styling ===== */

.question {
  margin-bottom: 1.25rem;
}

.question-text {
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  line-height: 1.4;
}

.question-hint {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.4rem;
  font-style: italic;
}

.required-marker {
  color: #EB172B;
  font-weight: 700;
}

/* ===== Validation messages ===== */

.validation-error {
  color: #c91324;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: none;
}

.validation-error.visible {
  display: block;
}

.field-error input,
.field-error textarea {
  border-color: #c91324;
}

/* ===== Utility classes ===== */

.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ===== Turnstile widget area ===== */

.turnstile-wrapper {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
}

/* ===== Confirmation / status pages ===== */

.status-page {
  text-align: center;
  padding: 3rem 1rem;
}

.status-page h1 {
  border-bottom: none;
  font-size: 1.5rem;
}

.status-page p {
  font-size: 1.1rem;
  color: #333;
}

/* ===== Footer ===== */

.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}

/* ===== Responsive — tablet and up ===== */

@media (min-width: 600px) {
  .container {
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .scale-group {
    flex-wrap: nowrap;
  }

  .scale-group label {
    flex: 1;
  }
}
