/* ------------------------------------------------------------------
   Tips-by-text signup — shared styles
   Calm, mobile-first. One bold motif (the message bubble); everything
   else quiet. Swap the palette by editing the :root tokens below.
------------------------------------------------------------------- */

:root {
  --ink:        #14181f;   /* primary text            */
  --ink-soft:   #4a525e;   /* secondary text          */
  --paper:      #faf9f6;   /* page background         */
  --surface:    #ffffff;   /* cards / form            */
  --line:       #e7e2d8;   /* hairlines, borders      */
  --accent:     #0b6b57;   /* buttons, links, bubble  */
  --accent-ink: #ffffff;   /* text on accent          */
  --accent-tint:#e9f2ee;   /* soft accent surface     */
  --focus:      #0b6b57;
  --radius:     14px;
  --maxw:       28rem;     /* ~448px readable column  */
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: #e6f5fb;
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--maxw);
  margin: 2rem auto 3rem;
  padding: 2rem 1.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  backdrop-filter: blur(10px) saturate(1.05);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(31, 41, 51, 0.18);
}

/* Solid fallback where frosted glass isn't supported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .wrap { background: rgba(255, 255, 255, 0.95); }
}

/* ---- Scene: cartoon house behind everything --------------------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url("house.svg") center bottom / auto 86% no-repeat,
    linear-gradient(to bottom,
      #cfeaf5 0%, #e2f3fb 44%,
      #aadb80 44%, #93c96b 100%);
}

@media (min-width: 820px) {
  body::before { background-size: auto 92%, auto; }
}

/* ---- Hero message bubble (the one bold thing) -------------------- */

.bubble {
  align-self: flex-start;
  max-width: 20rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.85rem 1.1rem;
  border-radius: 20px 20px 20px 6px;
  font-size: 1.02rem;
  line-height: 1.45;
  box-shadow: 0 1px 0 rgba(20,24,31,.04);
}

.bubble .from {
  display: block;
  font-size: 0.78rem;
  opacity: 0.8;
  margin-bottom: 0.15rem;
}

.bubble.delivered {
  border-radius: 20px 20px 6px 20px;
  align-self: flex-end;
}

/* ---- Headline & copy -------------------------------------------- */

h1 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0.6rem;
}

.lede {
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
  max-width: 26rem;
}

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

form { display: block; }

.field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="tel"] {
  width: 100%;
  padding: 0.85rem 0.95rem;
  font-size: 1.05rem;         /* >=16px stops iOS zoom-on-focus */
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder { color: #9aa1ab; }

input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ---- Consent block ---------------------------------------------- */

.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: var(--accent-tint);
  border: 1px solid #d6e6df;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0.5rem 0 1.4rem;
}

.consent input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.consent label {
  font-weight: 400;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

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

/* ---- Button ------------------------------------------------------ */

button[type="submit"] {
  width: 100%;
  padding: 0.95rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s ease;
}

button[type="submit"]:hover { filter: brightness(1.06); }
button[type="submit"]:active { filter: brightness(0.96); }
button[type="submit"]:focus-visible {
  outline: 3px solid var(--accent-tint);
  outline-offset: 2px;
}

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

.error {
  background: #fdecec;
  border: 1px solid #f3c2c2;
  color: #8a1f1f;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ---- Footer / legal --------------------------------------------- */

footer {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

footer a { color: var(--ink-soft); text-decoration: underline; }
footer a:hover { color: var(--ink); }

/* ---- Legal pages (terms / privacy) ------------------------------ */

.doc { max-width: 40rem; }
.doc h1 { font-size: clamp(1.6rem, 6vw, 2rem); }
.doc h2 { font-size: 1.15rem; margin-top: 2rem; }
.doc p, .doc li { color: var(--ink-soft); font-size: 0.98rem; }
.doc .back { display: inline-block; margin-bottom: 1.5rem; color: var(--accent); text-decoration: none; }
.doc .updated { font-size: 0.85rem; color: #9aa1ab; }

/* ---- Thanks page ------------------------------------------------- */

.thanks-actions { margin-top: 2rem; }

@media (prefers-reduced-motion: no-preference) {
  .bubble { animation: rise .5s ease both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
