:root {
  --primary-bg-dark: #0F1C2E;
  --text-dark: #FFFFFF;
  --fieldset-bg-dark: #1C2A3E;
  --border-dark: #3F4F67;
  --accent-dark: #FFFFFF;

  --primary-bg-light: #D6E4F0;
  --text-light: #123654;
  --fieldset-bg-light: #FFFFFF;
  --border-light: #CCCCCC;
  --accent-light: #264653;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: var(--primary-bg-dark);
  color: var(--text-dark);
  transition: background 0.3s, color 0.3s;
}

body.light-mode {
  background: var(--primary-bg-light);
  color: var(--text-light);
}

nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 1em 0 2em;
  flex-wrap: wrap;
}

.nav-button {
  display: inline-block;
  padding: 6px 16px;
  background: var(--text-dark);
  color: var(--primary-bg-dark);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  border: none;
  font-size: 1em;
}

.nav-button:hover,
.nav-button.active {
  background: #44687b;
  color: #fff;
}

body.light-mode .nav-button {
  background: var(--text-light);
  color: var(--primary-bg-light);
}

body.light-mode .nav-button:hover,
body.light-mode .nav-button.active {
  background: var(--accent-light);
  color: #fff;
}

.logo {
  display: block;
  margin: 0.5em auto 0;
  width: 280px;
  max-width: 90%;
  padding-bottom: 10px;
}

.content {
  max-width: 960px;
  margin: 0 auto;
}

.footer {
  text-align: center;
  padding: 1rem 1rem 0.5rem;
  font-size: 0.85rem;
  opacity: 0.85;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
  text-align: left;
}

.full-width {
  width: 100%;
  box-sizing: border-box;
}


.footer-content {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* ← aligns everything to the top */
  gap: 1rem;
  flex-wrap: wrap;
  text-align: left;
}

@media (max-width: 768px) {
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .footer-bottom {
    text-align: center;
  }
}

.footer-note {
  font-size: 0.85rem;
  opacity: 0.7;
}
.footer-bottom {
  text-align: center;
  margin-top: 0.75rem;
}

.coffee-button {
  height: 48px;
  width: auto;
}

.bmc-button img {
  height: 60px !important;
  width: 217px !important;
  border: none;
  margin-top: 8px;
}

.theme-toggle {
  border: none;
  background: var(--button-bg, #444);
  color: var(--button-text, #fff);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.full-width {
  grid-column: 1 / -1;
}

fieldset {
  border-radius: 4px;
  padding: 10px;
  border: 1px solid var(--border-dark);
  background: var(--fieldset-bg-dark);
}

body.light-mode fieldset {
  background: var(--fieldset-bg-light);
  border-color: var(--border-light);
}

legend {
  font-weight: bold;
  color: var(--accent-dark);
}

body.light-mode legend {
  color: var(--accent-light);
}

label {
  display: flex;
  flex-direction: column;
  padding-top: 4px;
  gap: 4px;
  margin: 0;
}

input,
select {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--border-dark);
  border-radius: 2px;
  background: #2E3D52;
  color: var(--text-dark);
  box-sizing: border-box;
}

body.light-mode input,
body.light-mode select {
  background: #fff;
  color: #000;
  border-color: var(--border-light);
}

button:not(.nav-button):not(.theme-toggle) {
  margin-top: 10px;
  margin-right: 10px;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background: var(--text-dark);
  color: var(--primary-bg-dark);
  cursor: pointer;
}

body.light-mode button:not(.nav-button):not(.theme-toggle) {
  background: var(--text-light);
  color: var(--primary-bg-light);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 12px;
}

.result-item {
  padding: 0.75em;
  border-radius: 4px;
  background: var(--fieldset-bg-dark);
  border: 1px solid var(--border-dark);
}

body.light-mode .result-item {
  background: var(--fieldset-bg-light);
  border-color: var(--border-light);
  color: #000;
}

.error {
  color: #E63946;
  font-weight: bold;
  margin: 1em 0;
}

@media (max-width: 768px) {
  .form-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    position: static;
    margin: 0 auto 1em;
  }
}

@media print {
  .theme-toggle,
  nav,
  .footer,
  .logo {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  fieldset,
  .result-item {
    background: #fff;
    color: #000;
    border-color: #ccc;
  }
}
