:root {
  --accent: #0039B8;   /* sampled from the logo */
  --cream: #FEFAF6;    /* logo background */
  --ink: #1a1a1a;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
}


.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 96px;
  padding: 40px 32px;
}

/* print on the left */
.art {
  width: min(38vw, 420px);
}

/* a mailed card: click to flip front ↔ back */
.card {
  position: relative;
  transform: rotate(-4deg);
}

.card-flip {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 1600px;
  border-radius: 0;
}

.card-inner {
  position: relative;
  aspect-ratio: 775 / 1200;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.card.flipped .card-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.card-back { transform: rotateY(180deg); }

/* little flip button sitting on the card's bottom-right corner (stays put while the card turns) */
.flip-icon {
  position: absolute;
  right: -14px;   /* hangs slightly off the card's bottom-right corner */
  bottom: -14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* hidden while the card is mid-flip */
.card.flipping .flip-icon {
  opacity: 0;
  transform: scale(0.6);
}

.flip-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-flip:hover .flip-icon { transform: rotate(-30deg) scale(1.08); }

.card-flip:focus-visible { outline: none; }
.card-flip:focus-visible .card-inner { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 6px; }

/* hand-written date with a pencil arrow pointing at the card */
.note {
  position: absolute;
  right: calc(100% + 10px);   /* sits just outside the card's left edge */
  top: 50%;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #53575c;   /* graphite pencil */
  font-family: "Caveat", cursive;
  font-size: 1.6rem;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%) rotate(4deg);
  pointer-events: none;
}

.note svg {
  width: 56px;
  height: 35px;
  overflow: visible;
}

@media (prefers-reduced-motion: reduce) {
  .card-inner { transition: none; }
}

/* small logo sitting just above the form, left-aligned with it */
.join {
  width: 340px;
}

.logo {
  display: block;
  width: 110px;
  height: auto;
  margin: 0 0 28px;
}

h1 {
  color: var(--accent);
  font-size: 1.6rem;
  margin: 0 0 20px;
}

label {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 16px 0 6px;
}

.optional { font-weight: 400; opacity: 0.7; }

input,
#address-slot gmp-place-autocomplete {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

#address-slot gmp-place-autocomplete {
  padding: 0;
  color-scheme: light;
}

input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

button {
  margin-top: 24px;
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--cream);
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: progress; }

.error { color: #b00020; font-size: 0.9rem; margin: 12px 0 0; }

.thanks p { color: var(--accent); font-size: 1.1rem; margin: 0; }

/* stack on narrower screens */
@media (max-width: 960px) {
  .page {
    flex-direction: column;
    gap: 48px;
    padding: 40px 16px 48px;
  }
  /* card nudged right so the date note fits on its left */
  .art { width: min(58%, 300px); margin-left: 64px; }
  .note { font-size: 1.3rem; right: calc(100% + 6px); }
  .note svg { width: 40px; height: 25px; }
  .join { width: min(100%, 400px); }
  .logo { width: 96px; }
}
