/* ============================================
   ACCESSIBILITY BASICS
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Skip link */
.skip-link {
  position:absolute;
  top:-40px;
  left:0;
  background:#000;
  color:#fff;
  padding:8px 16px;
  z-index:1000;
}
.skip-link:focus {
  top:10px;
}

/* Keyboard-only focus management */
body:not(.user-is-tabbing) *:focus {
  outline: none;
}

/* ============================================
   THEME VARIABLES — LIGHT + DARK + HIGH CONTRAST
   ============================================ */
:root {
  /* Backgrounds */
  --bg: #f5f5f5;
  --header-bg: #010101;
  --container-bg: #ffffff;

  /* Text */
  --text: #222222;

  /* Headings */
  --h1-color: #a3201f;
  --h2-color: #0f8aa7;

  /* FAQ */
  --faq-bg: #27784D;
  --faq-bg-active: #34A56A;
  --faq-answer-bg: #ffffff;
  --faq-answer-border: #bcbcbc;

  /* Forms */
  --form-bg: #ffffff;
  --form-border: #bcbcbc;
  --input-border: #999999;

  /* Buttons */
  --button-bg: #27784D;
  --button-hover-bg: #34A56A;

  /* Focus outline */
  --focus-ring: #16BAD9;

  /* Error colors */
  --error-bg: #fbecec;
  --error-border: #c5413d;
  --error-text: #a3201f;
}

/* DARK MODE — GREEN PRESERVED */
body.dark {
  --bg: #030306;
  --header-bg: #000000;
  --container-bg: #1a1a1a;

  --text: #f2f2f2;

  --h1-color: #ff6b6e;
  --h2-color: #16BAD9;

  --faq-bg: #27784D;
  --faq-bg-active: #34A56A;
  --faq-answer-bg: #2a2a2a;
  --faq-answer-border: #555555;

  --form-bg: #2a2a2a;
  --form-border: #555555;
  --input-border: #777777;

  --button-bg: #27784D;
  --button-hover-bg: #34A56A;

  --focus-ring: #16BAD9;

  --error-bg: #3b1b1b;
  --error-border: #ff6b6e;
  --error-text: #ffaaaa;
}

/* HIGH CONTRAST MODE */
body.high-contrast {
  --bg: #000000;
  --header-bg: #000000;
  --container-bg: #000000;

  --text: #ffffff;

  --h1-color: #ffffff;
  --h2-color: #ffffff;

  --faq-bg: #000000;
  --faq-bg-active: #000000;
  --faq-answer-bg: #000000;
  --faq-answer-border: #ffffff;

  --form-bg: #000000;
  --form-border: #ffffff;
  --input-border: #ffffff;

  --button-bg: #000000;
  --button-hover-bg: #222222;

  --focus-ring: #ffff00;

  --error-bg: #000000;
  --error-border: #ff0000;
  --error-text: #ff0000;
}

/* Smooth transitions between themes (with reduced-motion fallback) */
body,
header,
.container,
.faq-question,
.faq-answer,
button,
input,
textarea,
.footer {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  body,
  header,
  .container,
  .faq-question,
  .faq-answer,
  button,
  input,
  textarea,
  .footer {
    transition: none;
  }
}

/* ============================================
   BASE STYLES USING VARIABLES
   ============================================ */

body {
  font-family: Verdana, Geneva, sans-serif;
  background: var(--bg);
  margin:0;
  padding:0;
  color: var(--text);
}

/* Apply visible outline only when keyboard navigation is detected */
body.user-is-tabbing button:focus,
body.user-is-tabbing input:focus,
body.user-is-tabbing textarea:focus,
body.user-is-tabbing .faq-question:focus,
body.user-is-tabbing a:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

header[role="banner"] {
    background: transparent; 
    padding: 0; 
    margin: 0;  
    text-align:center;
}

header img {
  max-width:900px;
  height:auto;
}

.container {
  max-width:900px;
  margin:30px auto;
  background: var(--container-bg);
  padding:25px;
  border-radius:8px;
  box-shadow:0 0 10px rgba(0,0,0,0.1);
}

h1 {
  color: var(--h1-color);
  text-align:center;
}

h2 {
  color: var(--h2-color);
  margin-top:40px;
}

/* FAQ */
.faq-question {
  width:100%;
  text-align:left;
  padding:12px;
  background: var(--faq-bg);
  color:#fff;
  border:none;
  cursor:pointer;
  margin-top:5px;
  border-radius:5px;
  font-size:16px;
}

.faq-answer {
  display:none;
  padding:12px;
  background: var(--faq-answer-bg);
  border:1px solid var(--faq-answer-border);
  margin-bottom:10px;
}

/* Forms */
form {
  background: var(--form-bg);
  padding:20px;
  border-radius:8px;
  border:1px solid var(--form-border);
  margin-top:20px;
}

label {
  display:block;
  margin-top:15px;
  font-weight:bold;
}

input[type="text"],
input[type="email"],
textarea {
  width:100%;
  padding:10px;
  margin-top:5px;
  border-radius:5px;
  border:1px solid var(--input-border);
  font-size:15px;
  background: var(--container-bg);
  color: var(--text);
  box-sizing: border-box;
}

textarea {
  height:150px;
}

/* Buttons */
button,
input[type="submit"],
input[type="reset"] {
  margin-top:20px;
  padding:12px 20px;
  background: var(--button-bg);
  color:#fff;
  border:none;
  border-radius:5px;
  font-size:16px;
  cursor:pointer;
  font-weight: 700;
}

button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  background: var(--button-hover-bg);
}

/* High-contrast button borders */
body.high-contrast button,
body.high-contrast input[type="submit"],
body.high-contrast input[type="reset"] {
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  background: #000000 !important;
}

body.high-contrast button:hover,
body.high-contrast input[type="submit"]:hover,
body.high-contrast input[type="reset"]:hover {
  background: #222222 !important;
}

/* Error summary and field errors */
.error-summary {
  margin-top:10px;
  margin-bottom:10px;
  padding:10px;
  border-radius:5px;
  border:1px solid transparent;
  background:none;
  color:var(--error-text);
}
.error-summary.active {
  border-color: var(--error-border);
  background: var(--error-bg);
}
.error-summary ul {
  margin:0;
  padding-left:20px;
}
.field-error {
  margin:5px 0 0;
  font-size:0.85rem;
  color:var(--error-text);
}

/* Horizontal rule */
hr {
  margin-top:25px;
  margin-bottom:25px;
}

/* Controls (icon-style toggles) */
.controls {
  position: fixed;
  top: 20px;
  right: 20px;
  display:flex;
  flex-direction: column;
  gap:8px;
  z-index: 999;
}

.controls button {
  margin-top:0;
  padding:8px;
  font-size:18px;
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
}

/* Emoji font for icons */
.controls button span[aria-hidden="true"],
.footer .emoji {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

/* Visually hidden text for icon buttons */
.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  border:0;
}

/* Footer */
.footer {
  text-align:center;
  padding:20px;
  font-size:0.9rem;
  background: var(--container-bg); 
  color: var(--text);
}

/* ============================================
   PRINT STYLESHEET
   ============================================ */
@media print {
  body {
    background:#ffffff;
    color:#000000;
  }
  header,
  .controls,
  .footer {
    display:none !important;
  }
  .container {
    box-shadow:none;
    border:none;
    max-width:100%;
    margin:0;
    padding:0;
  }
  a {
    text-decoration:none;
    color:#000000;
  }
}

/* Mobile responsiveness fix */
@media (max-width: 480px) {
  .container {
    padding: 15px;
  }
  header img {
    max-width: 100%;
  }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--button-bg);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none; /* hidden until scrolled */
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 999;
}

.back-to-top:hover {
  background: var(--button-hover-bg);
}

body.high-contrast .back-to-top {
  border: 2px solid #fff !important;
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast .back-to-top:hover {
  background: #222 !important;
}

/* Keep radio buttons and labels aligned on one line */
#mailingListForm fieldset div {
  display: flex;
  align-items: center;
  gap: 8px; /* small space between radio and label */
}
