/* Rush Creek Ward — Tithing Declaration Appointments
   Hand-rolled, dependency-free stylesheet. System fonts only, no CDN.
   Audience skews older and phone-heavy: high contrast, generous type,
   single column, large touch targets. */

:root {
  --color-bg: #faf8f4;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #4b4b4b;
  --color-primary: #163a5f;
  --color-primary-hover: #0f2740;
  --color-primary-text: #ffffff;
  --color-border: #6b7684;
  --color-focus: #0b5ed7;
  --color-success: #155724;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --radius: 0.5rem;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-stack);
  font-size: 1.125rem; /* 18px comfortable base */
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: var(--space-3) var(--space-2) var(--space-4);
}

.site-header {
  text-align: center;
  margin-bottom: var(--space-3);
}

.site-header h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
  color: var(--color-primary);
}

.ward-name {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
}

main#app {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

h2 {
  font-size: 1.25rem;
  margin-top: 0;
  color: var(--color-primary);
}

p {
  margin: 0 0 var(--space-2);
}

.loading {
  color: var(--color-muted);
}

.noscript-message {
  margin-top: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

/* Form controls inherit the page's font so 18px+ applies everywhere,
   not just paragraph text. */
button,
input,
textarea {
  font: inherit;
}

/* Buttons */
button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--color-primary);
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  display: block;
  width: 100%;
  margin-bottom: var(--space-2);
  text-align: center;
}

button:hover {
  background: #eef3f8;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary-button {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.primary-button:hover {
  background: var(--color-primary-hover);
}

.link-button {
  border: none;
  background: none;
  color: var(--color-primary);
  text-decoration: underline;
  width: auto;
  display: inline-block;
  padding: 0.75rem 0.25rem;
  min-width: 44px;
  min-height: 44px;
  text-align: left;
}

.escape-hatch {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: var(--space-2);
}

.day-list,
.offer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.day-button,
.offer-button {
  font-weight: 600;
}

.no-offers {
  color: var(--color-muted);
}

/* Forms */
.field {
  margin-bottom: var(--space-2);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

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

.char-counter {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Honeypot: kept in the accessibility tree geometry but moved off-screen
   and hidden from assistive tech, never display:none (spec requirement). */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Status / confirmation region */
#status:empty {
  display: none;
  margin: 0;
}

#status {
  margin-bottom: var(--space-2);
}

.confirmation-panel {
  border-left: 4px solid var(--color-success);
  padding-left: var(--space-2);
}

.email-echo strong {
  color: var(--color-primary);
}

/* Focus visibility — never suppressed */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 640px) {
  .page {
    padding-top: var(--space-4);
  }
}
