:root {
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

/* Make body full height and flex column for sticky footer */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.tagline {
  color: var(--muted);
  margin: 0.25rem 0 1rem 0;
}

nav a {
  margin-right: 1.25rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

nav a:hover {
  color: var(--accent);
}

/* Make main grow to fill available space, pushing footer down */
main {
  flex: 1;
  max-width: 800px;
  padding: 2rem;
  margin: 0 auto;
}

main h2 {
  margin-top: 0;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- Form Styles ---------- */

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

label {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text);
}

fieldset {
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 6px;
}

legend {
  font-weight: 600;
  padding: 0 0.5rem;
}

input[type="checkbox"],
input[type="radio"] {
  margin-right: 0.5rem;
  accent-color: var(--accent);
}

button,
input[type="submit"],
input[type="button"] {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: #1e40af; /* slightly darker accent */
}

button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
  background: var(--border);
  cursor: not-allowed;
  color: var(--muted);
}

img {
  max-width: 100%;   /* Never exceed the container width */
  height: auto;      /* Keep aspect ratio */
  display: block;    /* Remove inline spacing under image */
  margin: 0 auto;    /* Optional: center image */
  border-radius: 6px; /* Optional: rounded corners for style */
  object-fit: contain; /* Ensure image scales nicely if used in fixed containers */
}

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
