/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink:        #1a1a1a;
  --ink-light:  #444;
  --rule:       #c8b89a;
  --paper:      #f9f5ef;
  --paper-dark: #f0e8d8;
  --accent:     #1a1a1a;
  --serif:      'Georgia', 'Times New Roman', Times, serif;
  --sans:       system-ui, -apple-system, sans-serif;
  --radius:     3px;
}

html {
  font-size: 16px;
  background: var(--paper-dark);
  color: var(--ink);
}

body {
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Masthead ──────────────────────────────────────────────────── */
header {
  background: var(--paper);
  border-bottom: 3px double var(--ink);
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}

.masthead {
  max-width: 700px;
  margin: 0 auto;
}

.date-line {
  font-family: var(--serif);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}

.masthead h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 0.3em 0;
  margin: 0.25rem 0;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-top: 0.4rem;
}

/* ─── Main layout ───────────────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem 3rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 640px;
}

.card h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.intro {
  color: var(--ink-light);
  font-size: 0.92rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.25rem;
}

/* ─── Fieldsets ─────────────────────────────────────────────────── */
fieldset {
  border: none;
  margin-bottom: 1.75rem;
}

legend {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  width: 100%;
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

/* ─── Fields ────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.required {
  color: #b00;
}

.optional {
  font-weight: 400;
  color: var(--ink-light);
}

.hint {
  font-size: 0.78rem;
  color: var(--ink-light);
  line-height: 1.4;
}

input[type="text"],
input[type="email"] {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bbb;
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(26,26,26,0.12);
}

input[type="text"]:invalid:not(:placeholder-shown),
input[type="email"]:invalid:not(:placeholder-shown) {
  border-color: #b00;
}

/* ─── ZIP field ─────────────────────────────────────────────────── */
.zip-field {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--paper-dark);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.zip-field input {
  max-width: 140px;
}

/* ─── Checkboxes ────────────────────────────────────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  transition: background 0.1s;
}

.checkbox-label:hover {
  background: var(--paper-dark);
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ink);
  flex-shrink: 0;
  cursor: pointer;
}

/* ─── Submit button ─────────────────────────────────────────────── */
.actions {
  margin-top: 0.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

button[type="submit"] {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  width: 100%;
}

button[type="submit"]:hover {
  opacity: 0.85;
}

button[type="submit"]:active {
  transform: translateY(1px);
}

/* ─── Success state ─────────────────────────────────────────────── */
.success {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

.success h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.success p {
  color: var(--ink-light);
  font-size: 0.95rem;
}

/* ─── Footer ────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--ink-light);
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--serif);
  font-style: italic;
}

/* ─── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .card {
    padding: 1.5rem 1.25rem;
  }

  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
}
