/* ---------------------------------------------------------------
   Leaf Check — elder-friendly styles
   Palette: cream #FAF9F2 / white #FFFFFF / forest #1B4332
            leaf #2D6A4F / marigold #E9C46A / secondary text #2F5D4A
   Base 18px, Extra Large 22.5px (+25%). Every control >= 56px tall.
   --------------------------------------------------------------- */

:root {
  --cream: #FAF9F2;
  --white: #FFFFFF;
  --forest: #1B4332;
  --leaf: #2D6A4F;
  --leaf-dark: #245741;
  --marigold: #E9C46A;
  --marigold-dark: #D9AE4F;
  --text-soft: #2F5D4A;
  --border: #C9D6CB;
  --focus: #1D4ED8;
  --error-bg: #FDF1EC;
  --error-border: #C2410C;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(27, 67, 50, 0.10);
}

html {
  font-size: 18px;
}

html.xl {
  font-size: 22.5px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1rem 3rem;
  background: var(--cream);
  color: var(--forest);
  font-family: "Segoe UI", Tahoma, Verdana, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  color: var(--forest);
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

h1 { font-size: 1.55rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

/* ---------- Accessibility helpers ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--forest);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Layout ---------- */

.site-header,
main,
.site-footer {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  padding: 1.75rem 0 0.5rem;
}

.tagline {
  color: var(--text-soft);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

/* ---------- Text size toggle ---------- */

.text-size {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.size-btn {
  flex: 1 1 auto;
  min-height: 3.2rem;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--forest);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.size-btn.is-active {
  background: var(--marigold);
  border-color: var(--marigold-dark);
}

/* ---------- Cards ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.step-head h2 {
  margin: 0;
}

.badge {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  background: var(--marigold);
  color: var(--forest);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 50%;
}

.hint {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */

.big-button {
  display: block;
  width: 100%;
  min-height: 3.2rem;
  padding: 0.9rem 1.25rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: var(--white);
  background: var(--leaf);
  border: 2px solid var(--leaf);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.big-button:hover {
  background: var(--leaf-dark);
  border-color: var(--leaf-dark);
}

.big-button:disabled {
  background: #8FA79A;
  border-color: #8FA79A;
  cursor: not-allowed;
}

.secondary-button {
  display: block;
  width: 100%;
  min-height: 3.2rem;
  margin-top: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--forest);
  background: var(--marigold);
  border: 2px solid var(--marigold-dark);
  border-radius: var(--radius);
  cursor: pointer;
}

.secondary-button:hover {
  background: var(--marigold-dark);
}

/* ---------- Photo preview ---------- */

.preview-wrap {
  margin-top: 1rem;
}

.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: contain;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Soil options ---------- */

.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  color: var(--forest);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.option:hover {
  border-color: var(--leaf);
}

.option[aria-checked="true"] {
  background: var(--marigold);
  border-color: var(--marigold-dark);
}

.option-note {
  font-weight: 400;
  color: var(--text-soft);
}

/* ---------- Location ---------- */

.status {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.status.is-error {
  color: var(--error-border);
  font-weight: 600;
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

#place-input {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--forest);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Action ---------- */

.action-wrap {
  margin: 1.5rem 0;
}

/* ---------- Results ---------- */

.result-card h3 {
  margin-bottom: 0.6rem;
}

.result-lead {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.result-sub {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.step-list,
.care-list {
  margin: 0;
  padding-left: 1.4rem;
}

.step-list li,
.care-list li {
  margin-bottom: 0.75rem;
}

.care-list strong {
  display: block;
  color: var(--forest);
}

.warning-card {
  background: #FFF8E6;
  border-color: var(--marigold-dark);
}

.weather-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  margin: 0;
}

.weather-list dt {
  color: var(--text-soft);
}

.weather-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

/* ---------- Error ---------- */

.error-card {
  background: var(--error-bg);
  border-color: var(--error-border);
}

.error-card h3 {
  color: var(--error-border);
}

/* ---------- Small screens ---------- */

@media (max-width: 420px) {
  body { padding-left: 0.75rem; padding-right: 0.75rem; }
  .card { padding: 1rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
