:root {
  --bg: #f6f5f0;
  --card-bg: #ffffff;
  --text: #24291f;
  --muted: #5c6152;
  --border: #d8d6c8;
  --accent: #2f6b3a;
  --irrigate: #b4232a;
  --wait: #2f6b3a;
  --flood: #1f5f8b;
  --drain: #8a6a1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("/static/images/background.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
}

.site-header {
  background: var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px;
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-logo {
  display: block;
  height: 60px;
  width: auto;
}

.site-wordmark {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
}

.site-tagline {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.site-footer {
  max-width: 1080px;
  margin: 24px auto 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 12px 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--accent);
}

.footer-disclaimer {
  margin-top: 6px;
}

.page {
  max-width: 480px;
  margin: 24px auto 0;
  padding: 24px 16px 40px;
  background: rgba(255, 255, 255, 0.93);
  border-radius: 16px;
  box-shadow: 0 1px 24px rgba(36, 41, 31, 0.12);
}

.page.page-home {
  max-width: 1080px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 420px);
  gap: 40px;
  align-items: start;
}

.form-column,
.info-column {
  min-width: 0;
}

.form-column {
  order: 2;
}

.info-column {
  order: 1;
}

.info-lede {
  font-size: 1.05rem;
  color: var(--text);
  background: rgba(47, 107, 58, 0.07);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 24px;
}

.info-column h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.info-column h3 {
  margin: 20px 0 6px;
  font-size: 1.05rem;
}

.info-column p {
  margin: 0 0 4px;
}

.source-note {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 820px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .form-column {
    order: 1;
  }

  .info-column {
    order: 2;
  }
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}

legend {
  font-weight: 600;
  padding: 0 0 8px;
}

label {
  display: block;
  font-weight: 600;
  margin: 16px 0 6px;
  font-size: 0.95rem;
}

label .optional {
  font-weight: 400;
  color: var(--muted);
}

select,
input[type="date"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
}

.coord-row {
  display: flex;
  gap: 12px;
}

.coord-row > div {
  flex: 1;
  min-width: 0;
}

.small-label {
  font-weight: 400;
  font-size: 0.85rem;
  margin: 8px 0 4px;
  color: var(--muted);
}

.secondary-button {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
}

.secondary-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.location-status {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
  margin: 6px 0 0;
}

details {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

details summary {
  font-weight: 600;
  cursor: pointer;
}

button {
  width: 100%;
  padding: 14px;
  margin-top: 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button:active {
  opacity: 0.85;
}

.error {
  background: #fbe3e2;
  border: 1px solid var(--irrigate);
  color: #6e1116;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.result-card {
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  margin-bottom: 20px;
}

.result-card.irrigate_now {
  background: var(--irrigate);
}
.result-card.safe_to_wait {
  background: var(--wait);
}
.result-card.keep_flooded {
  background: var(--flood);
}
.result-card.drain_for_harvest {
  background: var(--drain);
}
.result-card.not_transplanted,
.result-card.harvested {
  background: var(--muted);
}

.result-action {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.result-meta {
  opacity: 0.9;
  font-size: 0.9rem;
  margin: 0;
}

.rationale {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding: 6px 12px;
  margin-bottom: 10px;
}

a.back-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
