/*
 * Shared styling for forms.mindmusings.com
 *
 * Deliberately minimal. These pages are embedded in the WordPress site via
 * iframe, so the goal is a clean, neutral form that doesn't fight the host page.
 */

:root {
  --fg: #1a1a1a;
  --fg-muted: #5b5b5b;
  --border: #d4d4d4;
  --border-focus: #2563eb;
  --bg: #ffffff;
  --bg-subtle: #f7f7f7;
  --success-fg: #14532d;
  --success-bg: #dcfce7;
  --success-border: #86efac;
  --error-fg: #7f1d1d;
  --error-bg: #fee2e2;
  --error-border: #fca5a5;
  --radius: 6px;
}

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

body {
  margin: 0;
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.form-container {
  max-width: 34rem;
  margin: 0 auto;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.form-intro {
  margin: 0 0 1.5rem;
  color: var(--fg-muted);
}

/* --- Fields ---------------------------------------------------------------- */

.field {
  margin-bottom: 1.125rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.field .hint {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
  border-color: var(--border-focus);
}

/* Checkbox / radio groups (e.g. volunteer availability, poll options) */
.field-group {
  border: 0;
  padding: 0;
  margin: 0 0 1.125rem;
}

.field-group legend {
  padding: 0;
  margin-bottom: 0.375rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
}

.choice input {
  margin: 0;
  width: auto;
  accent-color: var(--border-focus);
}

/* --- Submit ---------------------------------------------------------------- */

button[type="submit"] {
  padding: 0.6875rem 1.5rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  cursor: pointer;
}

button[type="submit"]:hover:not(:disabled) {
  background: #000;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Status messages ------------------------------------------------------- */

.form-status {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.form-status[hidden] {
  display: none;
}

.form-status--success {
  color: var(--success-fg);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.form-status--error {
  color: var(--error-fg);
  background: var(--error-bg);
  border-color: var(--error-border);
}

/*
 * --- Honeypot ---------------------------------------------------------------
 * Positioned off-screen rather than display:none / visibility:hidden on purpose.
 * Better bots skip fields hidden the obvious way; off-screen fields still get
 * filled in, which is exactly the signal we want.
 */
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Index page ------------------------------------------------------------ */

.form-index {
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-index li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.form-index a {
  color: var(--border-focus);
  font-weight: 600;
  text-decoration: none;
}

.form-index a:hover {
  text-decoration: underline;
}
