/* Free Morgan Hill — styles. Palette + type from BRAND_WEB.md.
   Rule: bright greens DECORATE (large only), dark green COMMUNICATES (text/small UI),
   clay is the ACTION color. Cream background, never clinical white. */

:root {
  --foundation: #3F6A2E;  /* deep spring green — text, links, small UI */
  --leaf:       #5F9440;  /* lead green — large elements only */
  --new-growth: #7AAD50;  /* fresh shoots — decorative + large only */
  --clay:       #B56A3D;  /* the give / request action color */
  --clay-dark:  #9c5530;  /* clay hover */
  --paper:      #F6F1E7;  /* warm cream background */
  --ink:        #27241F;  /* warm near-black body text */
  --first-light:#E8C583;  /* dawn gold — atmosphere only */

  --font-display: "Spectral", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --rule: rgba(63, 106, 46, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.site-header {
  background:
    radial-gradient(120% 180% at 50% -40%,
      rgba(232, 197, 131, 0.18) 0%,
      rgba(232, 197, 131, 0.06) 22%,
      rgba(246, 241, 231, 0) 55%),
    var(--paper);
  padding: 1.25rem 0;
}
.header-inner {
  width: min(880px, 90vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--foundation);
  text-decoration: none;
}
.lang-toggle {
  font-size: 0.95rem;
  color: var(--foundation);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}
.lang {
  background: none;
  border: none;
  font: inherit;
  color: var(--foundation);
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  opacity: 0.65;
}
.lang-active { font-weight: 600; opacity: 1; }
.lang-divider { color: var(--foundation); opacity: 0.5; }

/* ---- Hero (homepage) ---- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}
.hero-inner {
  width: min(680px, 90vw);
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--leaf);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 1.75rem;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 34ch;
  margin: 0 auto 2rem;
}
.note {
  font-size: 0.95rem;
  color: var(--foundation);
  margin: 2rem auto 0;
  max-width: 40ch;
}
.horizon {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(63, 106, 46, 0.7);
  margin: 1rem auto 0;
  max-width: 42ch;
}

/* ---- Buttons ---- */
.cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.8rem 1.6rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--clay);
  transition: background-color 0.15s ease, color 0.15s ease;
  display: inline-block;
}
.btn-primary {
  background: var(--clay);
  color: #fff;        /* white on clay — verified readable */
}
.btn-primary:hover { background: var(--clay-dark); border-color: var(--clay-dark); }
.btn-secondary {
  background: transparent;
  color: var(--clay);
}
.btn-secondary:hover { background: rgba(181, 106, 61, 0.08); }
.btn-sm { font-size: 0.95rem; padding: 0.5rem 1rem; }
.btn-block { width: 100%; text-align: center; margin-top: 1rem; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ---- Forms ---- */
.form-main {
  flex: 1;
  padding: 2.5rem 0 1rem;
}
.form-inner {
  width: min(560px, 90vw);
  margin: 0 auto;
}
.back-link {
  color: var(--foundation);
  text-decoration: none;
  font-size: 0.95rem;
}
.form-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--leaf);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin: 0.6rem 0 0.5rem;
}
.form-intro {
  color: var(--ink);
  margin: 0 0 2rem;
}
.field { margin-bottom: 1.4rem; }
.field-row {
  display: flex;
  gap: 1rem;
}
.field-row .field { flex: 1; }
.field-label {
  display: block;
  font-weight: 600;
  color: var(--foundation);
  margin-bottom: 0.4rem;
  font-size: 0.98rem;
}
.req { color: var(--clay); }
/* Required-field asterisk. CSS-generated so it survives applyLang() (which rewrites
   each label's textContent) and shows in both EN and ES. Red, per request. */
.field-label.required::after {
  content: " *";
  color: #c0392b;
}
.field-hint {
  font-size: 0.85rem;
  color: rgba(63, 106, 46, 0.8);
  margin: 0.4rem 0 0;
}
input[type="text"], input[type="tel"], input[type="email"], textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf8;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--foundation);
}
textarea { resize: vertical; }

.ack {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--ink);
  margin: 0.5rem 0 0.5rem;
  cursor: pointer;
}
.ack input { margin-top: 0.25rem; flex-shrink: 0; }

/* ---- Photo + AI ---- */
.photo-zone {
  position: relative;
  border: 2px dashed var(--rule);
  border-radius: 12px;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  background: #fffdf8;
}
.photo-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.photo-preview { display: none; max-width: 100%; max-height: 260px; }
.photo-preview.visible { display: block; }
.photo-icon { font-size: 1.8rem; }
.photo-label { color: var(--foundation); font-size: 0.95rem; margin-top: 0.3rem; }
.ai-thinking {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  color: var(--foundation);
  font-style: italic;
}
.ai-result {
  margin-top: 0.8rem;
  padding: 0.9rem 1rem;
  background: rgba(232, 197, 131, 0.18);
  border-radius: 10px;
}
.ai-suggest-label { margin: 0 0 0.2rem; font-size: 0.9rem; color: var(--foundation); }
.ai-suggest-name {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}
.ai-suggest-desc {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  color: var(--ink);
}
.ai-buttons { display: flex; gap: 0.6rem; }
.ai-suggest-foot {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: var(--foundation);
}

/* ---- Form messages ---- */
.form-message {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.form-message.error   { background: rgba(181, 106, 61, 0.12); color: var(--clay-dark); }
.form-message.success { background: rgba(95, 148, 64, 0.15); color: var(--foundation); }
.form-message.notice  { background: rgba(232, 197, 131, 0.22); color: var(--ink); }

/* ---- Footer / roof ---- */
.site-footer { padding: 2.5rem 0 3rem; }
.roof {
  width: min(420px, 90vw);
  margin: 0 auto;
  text-align: center;
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}
.parent-mark { display: block; margin: 0 auto 0.9rem; height: auto; }
.layers-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(63, 106, 46, 0.72);
}

@media (max-width: 460px) {
  .field-row { flex-direction: column; gap: 0; }
}
