/* ==========================================================================
   The Rovervelt — Form Pages Stylesheet
   Loaded on /forms.html and all /forms/*.html pages.
   Inherits palette and typography from styles.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hub page card (from forms.html)
   -------------------------------------------------------------------------- */
.form-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.form-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.form-card h3 { margin: 0 0 0.5rem 0; }
.form-card p  { flex: 1; color: var(--muted, #5a7d6a); }
.form-card-cta {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--honey, #e09f3e);
}

/* --------------------------------------------------------------------------
   Form layout
   -------------------------------------------------------------------------- */
.form-page { max-width: 760px; margin: 0 auto; padding: 2rem 1rem; }

.form-section {
  background: #fff;
  border: 1px solid var(--light-border, #dde5d8);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.form-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: var(--forest, #2d6a4f);
}

.form-row { display: grid; gap: 1rem; margin-bottom: 1rem; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 600px) {
  .form-row.cols-2,
  .form-row.cols-3,
  .form-row.cols-4 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Field controls
   -------------------------------------------------------------------------- */
.form-field { display: flex; flex-direction: column; }
.form-field label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}
.form-field .required {
  color: #c0392b;
  margin-left: 0.25rem;
  font-size: 1.35em;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field input[type="file"],
.form-field textarea,
.form-field select {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--light-border, #dde5d8);
  border-radius: 4px;
  background: #fff;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid var(--forest, #2d6a4f);
  outline-offset: 1px;
}
.form-field textarea { min-height: 4em; resize: vertical; }

.form-field .field-error {
  color: #b00020;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: none;
}
.form-field.invalid input,
.form-field.invalid textarea,
.form-field.invalid select { border-color: #b00020; }
.form-field.invalid .field-error { display: block; }

/* Inline yes/no radio groups */
.radio-inline { display: inline-flex; gap: 1rem; align-items: center; }
.radio-inline label { font-weight: 400; }

/* --------------------------------------------------------------------------
   Repeaters (dogs, pickup auth)
   -------------------------------------------------------------------------- */
.repeater-item {
  border: 1px dashed var(--light-border, #dde5d8);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}
.repeater-item .remove-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: none; border: 0; cursor: pointer;
  color: #b00020; font-size: 0.85rem;
}
.repeater-add {
  background: none;
  border: 1px solid var(--forest, #2d6a4f);
  color: var(--forest, #2d6a4f);
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}

/* --------------------------------------------------------------------------
   Contract container (legal forms)
   -------------------------------------------------------------------------- */
.contract {
  background: #fff;
  border: 1px solid var(--light-border, #dde5d8);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  max-height: 440px;
  overflow-y: auto;
  font-family: 'Source Sans 3', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.contract h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; color: var(--forest, #2d6a4f); }
.contract h3:first-child { margin-top: 0; }
.contract p { margin: 0.5rem 0; }
.contract ol, .contract ul { margin: 0.5rem 0 0.5rem 1.25rem; padding: 0; }
.contract .emphasis { text-transform: uppercase; font-weight: 700; }

/* --------------------------------------------------------------------------
   Signature block
   -------------------------------------------------------------------------- */
.signature-block { margin-top: 1.5rem; }
.signature-toggle { display: inline-flex; gap: 1rem; margin-bottom: 0.75rem; }
.signature-pad-wrap {
  border: 1px solid var(--light-border, #dde5d8);
  border-radius: 4px;
  background: #fff;
  position: relative;
}
.signature-pad-wrap canvas { display: block; width: 100%; height: 150px; touch-action: none; }
.signature-pad-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.25rem 0.5rem;
  border-top: 1px solid var(--light-border, #dde5d8);
}
.signature-pad-actions button {
  background: none; border: 0; cursor: pointer; color: #555; font: inherit;
}
.typed-signature-preview {
  margin-top: 0.5rem;
  font-family: 'Brush Script MT', cursive;
  font-size: 1.5rem;
  color: #333;
  min-height: 2rem;
}

/* --------------------------------------------------------------------------
   Submit row
   -------------------------------------------------------------------------- */
.submit-row {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.submit-row .cf-turnstile { margin: 0 auto; }
.submit-row button[type="submit"] {
  background: var(--forest, #2d6a4f);
  color: #fff;
  border: 0;
  padding: 0.75rem 2.5rem;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.05rem;
}
.submit-row button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* Honeypot: visually + screen-reader hidden */
.hp-field {
  position: absolute !important;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Loading + toast feedback */
.form-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #333; color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  z-index: 9999;
  display: none;
}
.form-toast.show { display: block; }
.form-toast.error { background: #b00020; }
