:root {
  --paper: #1c1a17;        /* dark fallback behind the background photo */
  --ink: #f7f2e6;          /* main text — cream, sits on the dark photo */
  --muted: #d6cdbb;        /* secondary text — slightly dimmer cream */
  --border: #8f887d;
  --field: #d6d3cb;        /* light card background for the input boxes */
  --field-text: #26211d;   /* dark text used INSIDE the light form fields */
}

* { box-sizing: border-box; }

/* Belt-and-braces: several rules below set display:flex/inline-flex on
   elements that also get toggled with the `hidden` attribute. An author
   rule like that otherwise beats the browser's default
   `[hidden]{display:none}` UA rule, so anything marked hidden would
   still show up. This one line guarantees hidden always wins. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Kalam', cursive;
  color: var(--ink);
  background: var(--paper); /* fallback, covered by .bg-photo once it loads */
  line-height: 1.6;
}

/* Fixed full-viewport background photo — see the comment on this element
   in index.html for why it's a separate element rather than a body
   background. The dark scrim on top guarantees the cream text stays
   readable everywhere, even over the photo's brighter grass highlights. */
.bg-photo {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(10, 8, 6, 0.45), rgba(10, 8, 6, 0.45)),
    url('images/gray-texture.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

main {
  max-width: 680px;
  margin: 0 auto;
}

.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}

/* ---------- readability panel (sits behind copy + the form) ---------- */

.panel {
  width: 100%;
  max-width: 520px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 6px;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- puppy photos ---------- */

.puppy-photo {
  object-fit: contain;
}

.puppy-photo.side {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.puppy-photo.center {
  width: 160px;
  height: auto;
  margin-bottom: 10px;
}

.hero-photos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ---------- title graphics (lucky.png / thanks.png) ---------- */

.title-graphic {
  height: auto;
  margin-bottom: 16px;
}

.title-graphic.lucky {
  width: 260px;
  max-width: 60vw;
}

.title-graphic.thanks {
  width: 300px;
  max-width: 70vw;
}

/* ---------- text ---------- */

.tagline {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 18px 0 22px;
}

.heading {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0 22px;
}

.body-text {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 480px;
  margin: 6px auto;
}

.credit {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 34px;
}

.credit a, a {
  color: var(--ink);
}

/* ---------- form ---------- */

.form-section form {
  width: 100%;
  max-width: 420px;
  text-align: left;
}

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

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--field);
  font-size: 1rem; /* keep at 16px-equivalent — smaller triggers an auto-zoom on iOS */
  font-family: inherit;
  color: var(--field-text); /* dark text on this light field, regardless of page theme */
}

.consent-copy {
  font-size: 1rem;
  color: var(--ink);
  margin: 18px 0 0;
}

.filename-note {
  font-style: italic;
  color: var(--muted);
  margin-top: 24px;
}

.checkbox-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0 8px;
  font-size: 1rem;
}

.checkbox-label input {
  margin-top: 4px;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

/* ---------- image buttons (button_*.png) ---------- */

.img-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  /* Invisible padding around the image so the tap target stays close to
     the ~44px minimum recommended for touch, without changing how big
     the button looks. */
  padding: 10px 8px;
  cursor: pointer;
  margin-top: 20px; /* + the 10px padding above = same 30px gap as before */
  filter: drop-shadow(1px 3px 4px rgba(0,0,0,0.25));
  transition: transform 0.15s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.img-btn img {
  display: block;
  width: 220px;
  height: auto;
  max-width: 100%;
  pointer-events: none; /* clicks/drops always target the wrapping button/label */
}
/* Setting width + height:auto (rather than a fixed height) means the
   browser always scales the image proportionally — it can never get
   squeezed into a container narrower than its natural width, which is
   what was happening to "Attach puppy video" in the cramped side-by-side
   layout below. */

.img-btn:hover {
  transform: translateY(-1px) scale(1.02);
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
}

.img-btn:active {
  transform: translateY(0) scale(0.99);
}

.img-btn.disabled {
  opacity: 0.6;
  pointer-events: none;
}

#final-submit-btn {
  margin-top: 12px; /* + the img-btn padding above = ~22px gap as before */
}

/* ---------- status ---------- */

.status-text {
  font-size: 0.95rem;
  color: var(--muted); /* informational by default — this page has no error-path message left */
  min-height: 1.2em;
  margin-top: 14px;
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
  .title-graphic.lucky { width: 200px; }
  .title-graphic.thanks { width: 230px; }
  /* The two flanking puppy photos don't fit next to the title at this
     width without wrapping awkwardly (one drops to its own line) — the
     form section already has its own puppy photo, so simplest is to
     just show the title alone here rather than a lopsided wrap. */
  .puppy-photo.side { display: none; }
  .img-btn img { width: 170px; } /* height stays auto — never re-introduce a fixed height here */
  .tagline { font-size: 1.2rem; }
  .section { padding: 48px 20px; }
  .panel { padding: 28px 18px; }
}

@media (max-width: 360px) {
  .title-graphic.lucky { width: 170px; }
  .title-graphic.thanks { width: 200px; }
  .img-btn img { width: 150px; }
}
