/* =====================================================================
   Newsletter Subscription Applet — theme
   Carried across from the Advance Information / Expenses applets so the
   suite looks identical: Open Sans for UI, Shadows Into Light Two for the
   brand wordmark, the #1B9413 / #4D8D3F green system on warm off-white,
   12px cards, 8px inputs/buttons, 44px touch targets.
   ===================================================================== */

:root {
  --primary: #1B9413;
  --primary-dark: #157A0F;
  --secondary: #4D8D3F;
  --bg: #F5F5F3;
  --card: #FFFFFF;
  --text: #2C2A26;
  --text-secondary: #4A4A4A;
  --border: #E0E0E0;
  --error: #D32F2F;
  --warning: #F57C00;
  --info: #1976D2;
  --success: #388E3C;
  --shadow: rgba(0, 0, 0, 0.08);
  --panel: #F7F7F5;
  --radius-card: 12px;
  --radius-control: 8px;
  --maxw: 600px;
  --font: "Open Sans", Arial, sans-serif;
  --font-brand: "Shadows Into Light Two", "Open Sans", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 18px calc(56px + env(safe-area-inset-bottom));
}

/* --- Masthead ----------------------------------------------------------- */
.masthead { text-align: center; padding: 6px 0 22px; }
.masthead img.logo { width: 96px; height: auto; display: inline-block; border-radius: 12px; }
.masthead .wordmark {
  margin: 6px 0 0;
  font-family: var(--font-brand);
  font-size: 30px;
  line-height: 1.1;
  color: var(--secondary);
  font-weight: 400;
}
.masthead .wordmark .tm { font-family: var(--font); font-size: 0.35em; vertical-align: super; }

/* --- Headings ----------------------------------------------------------- */
h1.page-title {
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 700;
  margin: 14px 0 2px;
  text-align: center;
}
.subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 22px;
}

/* --- Cards -------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin: 0 0 12px;
  box-shadow: 0 1px 4px var(--shadow);
}
.card h2 {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 12px;
  font-weight: 700;
}
.card h2 .optional-tag {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* --- Form --------------------------------------------------------------- */
label.field-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 6px;
}
.req { color: var(--primary); font-weight: 700; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}
input.invalid, select.invalid { border-color: var(--error); }
.field { margin: 0 0 16px; }
.hint { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; }

/* Paired fields on one row (collapses on mobile) */
.row2 { display: flex; gap: 12px; }
.row2 > .field { flex: 1; }
@media (max-width: 480px) { .row2 { flex-direction: column; gap: 0; } }

/* Checkbox rows and consent wording */
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; }
.check-row input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; }
.check-row label { font-size: 0.9rem; color: var(--text); }
.consent-intro { font-size: 0.9rem; color: var(--text); margin: 0 0 4px; }
.privacy-note { font-size: 0.8rem; color: var(--text-secondary); margin: 14px 0 0; }
.privacy-note a { color: var(--secondary); }

/* Honeypot: moved off-canvas rather than display:none so naive bots still
   fill it in; invisible and non-interactive for everyone else. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* Note under the subscribe button */
.confirm-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 10px 0 0;
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover, .btn:focus { background: var(--primary-dark); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Status banners ----------------------------------------------------- */
.banner { border-radius: var(--radius-control); padding: 14px 16px; font-size: 0.9rem; margin: 0 0 16px; }
.banner.error { background: #fbeeec; color: var(--error); border: 1px solid #efcdc8; }
.banner.ok { background: #eef6ec; color: var(--success); border: 1px solid #cfe6c7; }
.banner .icon { font-weight: 700; margin-right: 6px; }

/* --- Success screen ----------------------------------------------------- */
.success { text-align: center; padding: 8px 0; }
.success .tick {
  width: 56px; height: 56px; border-radius: 50%;
  background: #eef6ec; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 12px;
}

.center { text-align: center; }
.muted { color: var(--text-secondary); }
.hidden { display: none !important; }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer.legal {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
}
footer.legal a { color: var(--text-secondary); }
footer.legal p { margin: 0 0 10px; }
footer.legal .footer-contact { font-size: 0.75rem; color: var(--text); }
footer.legal .footer-contact strong { color: var(--text); }
footer.legal .footer-note { color: var(--text-secondary); }
footer.legal .footer-copyright { margin-bottom: 0; font-size: 0.625rem; color: #8A8A8A; }

@media (max-width: 480px) {
  .wrap { padding: 20px 14px 48px; }
  .masthead .wordmark { font-size: 26px; }
}
