:root {
  --green: #7CA644;
  --green-dark: #5E8030;
  --green-deep: #486325;
  --brown: #3D2A1F;
  --brown-soft: #6b513f;
  --cream: #FAF6EE;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: rgba(255, 255, 255, 0.94);
  --field-bg: #fffdf7;
  --field-border: #d9cdb8;
  --shadow: 0 18px 50px -12px rgba(61, 42, 31, 0.28);
  --radius-card: 28px;
  --radius-field: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Nunito', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--brown);
  line-height: 1.5;
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* Watercolor block-party scene as fixed full-bleed background. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('/bg.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-color: var(--cream);
}

/* Soft cream wash on top of the image to keep form text easy to read. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(250, 246, 238, 0.35) 0%, rgba(250, 246, 238, 0.55) 100%);
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 32px 16px 56px;
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(61, 42, 31, 0.15);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
}

@media (min-width: 600px) {
  .card { padding: 44px 44px 36px; }
  .page { padding: 56px 24px 80px; }
}

/* ---------- Hero ---------- */

.hero { text-align: center; margin-bottom: 28px; }

.eyebrow {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--brown-soft);
  font-size: 18px;
  margin: 0 0 4px;
}

.hero h1 {
  font-family: 'Sniglet', system-ui, sans-serif;
  font-weight: 800;
  color: var(--green);
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1.02;
  letter-spacing: 0.5px;
  margin: 0 0 16px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.lede {
  font-size: 16px;
  color: var(--brown);
  margin: 0 auto;
  max-width: 44ch;
}

.lede strong { color: var(--green-deep); }

/* ---------- Progress bar ---------- */

.progress {
  margin: 0 0 26px;
  padding: 18px 18px 14px;
  background: var(--card-strong);
  border: 1.5px solid var(--field-border);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.progress-label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.progress-label strong {
  font-family: 'Sniglet', system-ui, sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  color: var(--green);
  letter-spacing: 0.5px;
}

.progress-of {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--brown-soft);
  font-size: 14px;
}

.progress-percent {
  font-family: 'Sniglet', system-ui, sans-serif;
  font-size: 18px;
  color: var(--green-dark);
  letter-spacing: 0.4px;
}

.progress-bar-wrap {
  position: relative;
  padding-bottom: 22px;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 18px;
  background: #ece4d0;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(61, 42, 31, 0.12);
  box-shadow: inset 0 1px 2px rgba(61, 42, 31, 0.10);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
  border-radius: 999px;
  transition: width 1100ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 14px rgba(124, 166, 68, 0.45);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%);
  animation: progressShimmer 2.6s ease-in-out infinite;
  animation-delay: 1.2s;
  border-radius: 999px;
}

@keyframes progressShimmer {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

.progress-tick {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 2px;
  height: 24px;
  background: var(--brown-soft);
  opacity: 0.45;
  transform: translateX(-50%);
}

.progress-tick-label {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Sniglet', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--brown-soft);
  white-space: nowrap;
}

.progress-note {
  margin: 6px 0 0;
  text-align: center;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--brown-soft);
  font-size: 14px;
  transition: color 200ms ease;
}

.progress-note.is-celebrating {
  color: var(--green-dark);
  font-family: 'Sniglet', system-ui, sans-serif;
  font-style: normal;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.3px;
}

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

form { display: flex; flex-direction: column; gap: 18px; }

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

@media (max-width: 420px) {
  .row.two { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field > span {
  font-weight: 700;
  font-size: 14px;
  color: var(--brown);
  letter-spacing: 0.2px;
}

.field > span em {
  font-style: italic;
  font-weight: 500;
  color: var(--brown-soft);
}

.field input[type="text"],
.field input[type="email"] {
  font: inherit;
  color: var(--brown);
  background: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-field);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(124, 166, 68, 0.22);
}

/* ---------- Checkboxes ---------- */

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-strong);
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-field);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.check:hover { border-color: var(--green); }

.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--field-border);
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 120ms ease, border-color 120ms ease;
}

.check input[type="checkbox"]:checked {
  background: var(--green);
  border-color: var(--green);
}

.check input[type="checkbox"]:checked::after {
  content: '';
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.check span {
  font-size: 15px;
  font-weight: 600;
  color: var(--brown);
  line-height: 1.35;
}

/* ---------- Signature ---------- */

.sig-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.sig-label > span {
  font-weight: 700;
  font-size: 14px;
}

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--green-dark);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.link:hover { color: var(--green-deep); }

.sig-wrap {
  position: relative;
  background: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-field);
  height: 180px;
  overflow: hidden;
  touch-action: none;
}

.sig-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.sig-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--brown-soft);
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 150ms ease;
}

.sig-wrap.signed .sig-hint { opacity: 0; }

/* ---------- Submit ---------- */

.submit {
  appearance: none;
  border: 0;
  font-family: 'Sniglet', system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.6px;
  color: white;
  background: var(--green);
  padding: 16px 20px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 18px -6px rgba(94, 128, 48, 0.55);
  transition: background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  margin-top: 6px;
}

.submit:hover { background: var(--green-dark); }
.submit:active { transform: translateY(1px); }
.submit:disabled {
  background: #b8c79a;
  cursor: not-allowed;
  box-shadow: none;
}

.submit:focus-visible {
  outline: 3px solid var(--green-deep);
  outline-offset: 3px;
}

.error {
  margin: 0;
  padding: 12px 14px;
  background: #fdecea;
  border: 1.5px solid #f0b4ae;
  color: #842018;
  border-radius: var(--radius-field);
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Callout ---------- */

.callout {
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--card-strong);
  border: 1px solid rgba(61, 42, 31, 0.12);
  border-radius: 20px;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--brown);
  text-align: center;
}

.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
.callout strong {
  font-style: normal;
  font-weight: 700;
  color: var(--green-deep);
}

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

.thanks-card { text-align: center; }
.thanks-card h1 {
  font-family: 'Sniglet', system-ui, sans-serif;
  color: var(--green);
  font-size: clamp(40px, 9vw, 56px);
  margin: 4px 0 14px;
  letter-spacing: 0.5px;
}

/* ---------- Share section ---------- */

.share { margin-top: 22px; text-align: center; }

.share h2 {
  font-family: 'Sniglet', system-ui, sans-serif;
  font-size: 22px;
  color: var(--green);
  margin: 0 0 12px;
  letter-spacing: 0.4px;
}

.share-url {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.share-url input {
  flex: 1;
  min-width: 0;
  font: 600 15px/1.2 'Nunito', system-ui, sans-serif;
  color: var(--brown);
  background: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-field);
  padding: 12px 14px;
  text-overflow: ellipsis;
}

.share-url input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(124, 166, 68, 0.22);
}

.copy-btn {
  appearance: none;
  border: 0;
  font: 700 15px/1 'Nunito', system-ui, sans-serif;
  color: white;
  background: var(--green);
  padding: 0 18px;
  border-radius: var(--radius-field);
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover { background: var(--green-dark); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn.is-flash { background: var(--green-deep); }

.share-btn {
  appearance: none;
  border: 1.5px solid var(--green);
  background: transparent;
  color: var(--green-dark);
  font: 700 15px/1 'Nunito', system-ui, sans-serif;
  padding: 12px 18px;
  border-radius: var(--radius-field);
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  transition: background 120ms ease, color 120ms ease;
}

.share-btn:hover {
  background: var(--green);
  color: white;
}

.share-hint {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--brown-soft);
  font-size: 14px;
  margin: 12px 0 0;
}
