/* The new visitor popup (views/partials/promo-popup.ejs). Built on landing.css's tokens so every
 * offer looks like the site it sits on; the offer's own photo carries the season. A centered card
 * on desktop, a bottom sheet on phones. */

.pm { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.pm[hidden] { display: none; }
.pm-scrim {
  position: absolute; inset: 0;
  background: rgba(17, 38, 48, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s ease;
}
.pm.is-open .pm-scrim { opacity: 1; }

.pm-card {
  position: relative; display: grid; grid-template-columns: 42% minmax(0, 1fr);
  width: min(880px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  overflow: hidden; border-radius: 24px; background: var(--ld-white, #FFFFFF);
  box-shadow: 0 40px 90px -20px rgba(12, 50, 66, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0; transform: translateY(18px) scale(0.98);
  transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pm.is-open .pm-card { opacity: 1; transform: none; }
.pm-card:focus { outline: none; }

.pm-x {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: var(--ld-ink, #33475B); cursor: pointer;
  box-shadow: 0 4px 14px rgba(12, 50, 66, 0.16); transition: transform 0.2s ease, background 0.2s ease;
}
.pm-x:hover { transform: rotate(90deg); background: #FFFFFF; }
.pm-x svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ photo side */
.pm-media { position: relative; min-height: 100%; background: var(--ld-soft, #F2F9FB); }
.pm-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pm-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12, 50, 66, 0) 45%, rgba(12, 50, 66, 0.55) 100%);
}
.pm-badge {
  position: absolute; left: 22px; bottom: 22px; z-index: 2;
  display: flex; flex-direction: column; gap: 2px; padding: 14px 18px 13px;
  border-radius: 18px; color: #FFFFFF;
  background: linear-gradient(135deg, var(--ld-green, #6FBF4E), var(--ld-green-deep, #5AA83D));
  box-shadow: 0 16px 30px -10px rgba(40, 90, 20, 0.6);
  transform: rotate(-3deg);
}
.pm-badge-amt { font-family: 'Montserrat', sans-serif; font-style: italic; font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -0.5px; color: var(--ld-on-green, #10250F); }
.pm-badge-on { font-size: 12px; font-weight: 700; letter-spacing: 0.2px; color: var(--ld-on-green, #10250F); opacity: 0.85; }

/* ------------------------------------------------------------------ content side */
.pm-body { display: flex; flex-direction: column; padding: 38px 38px 22px; overflow-y: auto; }
.pm-step[hidden] { display: none; }
.pm-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 6px 12px; margin-bottom: 14px; border-radius: 999px;
  background: #EAF6E4; color: #3E7F27; font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
}
.pm-eyebrow svg { width: 15px; height: 15px; }
.pm-title {
  margin: 0 0 10px; font-family: 'Montserrat', sans-serif; font-style: italic; font-weight: 900;
  font-size: clamp(26px, 3.2vw, 34px); line-height: 1.08; letter-spacing: -0.5px; color: var(--ld-navy, #2C3E50);
}
.pm-title:focus { outline: none; }
.pm-text { margin: 0 0 20px; font-size: 15px; line-height: 1.6; color: var(--ld-ink-soft, #5B6F80); }

.pm-form { display: grid; gap: 12px; }
.pm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; padding: 0; border: 0; }
.pm-chips legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--ld-ink, #33475B); }
.pm-chips label { position: relative; cursor: pointer; }
.pm-chips input { position: absolute; opacity: 0; pointer-events: none; }
.pm-chips span {
  display: inline-block; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--ld-line, #DCE9EE);
  font-size: 14px; font-weight: 700; color: var(--ld-ink, #33475B); background: #FFFFFF;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pm-chips label:hover span { border-color: var(--ld-cyan, #5AB3C9); }
.pm-chips input:checked + span { border-color: var(--ld-ocean, #0C85C2); background: var(--ld-ocean, #0C85C2); color: #FFFFFF; }
.pm-chips input:focus-visible + span { outline: 3px solid var(--ld-ocean, #0C85C2); outline-offset: 2px; }

.pm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Name gets the room; a zip is five digits. */
.pm-row-name { grid-template-columns: minmax(0, 1fr) 112px; }
.pm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pm-field label { font-size: 13px; font-weight: 700; color: var(--ld-ink, #33475B); }
.pm-field input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--ld-line, #DCE9EE); background: #FBFDFE;
  font: inherit; font-size: 16px; color: var(--ld-navy, #2C3E50);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.pm-field input:focus { outline: none; border-color: var(--ld-ocean, #0C85C2); background: #FFFFFF; box-shadow: 0 0 0 4px rgba(12, 133, 194, 0.14); }
.pm-field.has-err input { border-color: #C9333B; }
.pm-err { min-height: 0; font-size: 12.5px; font-weight: 600; color: #B4232A; }
.pm-err:empty { display: none; }

.pm-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 54px; margin-top: 4px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ld-green, #6FBF4E); color: var(--ld-on-green, #10250F);
  font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 800; text-decoration: none;
  box-shadow: 0 12px 24px -10px rgba(70, 140, 40, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.pm-cta:hover { background: var(--ld-green-deep, #5AA83D); transform: translateY(-1px); box-shadow: 0 16px 28px -10px rgba(70, 140, 40, 0.8); }
.pm-cta:focus-visible { outline: 3px solid var(--ld-ocean, #0C85C2); outline-offset: 3px; }
.pm-cta svg { width: 18px; height: 18px; }
.pm-cta[disabled] { opacity: 0.7; cursor: progress; transform: none; }

.pm-formerr { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FBE9EA; color: #8E1C22; font-size: 14px; font-weight: 600; }
.pm-consent { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ld-ink-soft, #5B6F80); text-align: center; }

.pm-skip {
  display: block; margin: 8px auto 0; padding: 8px 12px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ld-ink-soft, #5B6F80); text-decoration: underline; text-underline-offset: 3px;
}
.pm-skip:hover { color: var(--ld-ink, #33475B); }

.pm-fine { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ld-line, #DCE9EE); }
.pm-fine summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ld-ink-soft, #5B6F80); list-style-position: inside; }
.pm-fine p { margin: 8px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--ld-ink-soft, #5B6F80); }

/* ------------------------------------------------------------------ success */
.pm-done { text-align: center; padding-top: 18px; }
.pm-check {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ld-green, #6FBF4E), var(--ld-green-deep, #5AA83D)); color: #FFFFFF;
  box-shadow: 0 14px 28px -10px rgba(70, 140, 40, 0.7);
}
.pm-check svg { width: 30px; height: 30px; stroke-dasharray: 24; stroke-dashoffset: 24; }
.pm-done:not([hidden]) .pm-check { animation: pm-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; }
.pm-done:not([hidden]) .pm-check svg { animation: pm-draw 0.45s 0.25s ease forwards; }
@keyframes pm-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pm-draw { to { stroke-dashoffset: 0; } }

.pm-code {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; padding: 14px 14px 14px 18px;
  border: 2px dashed var(--ld-cyan, #5AB3C9); border-radius: 16px; background: var(--ld-soft, #F2F9FB); text-align: left;
}
.pm-code-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ld-ink-soft, #5B6F80); }
.pm-code-val { flex: 1; font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 900; letter-spacing: 1.5px; color: var(--ld-navy, #2C3E50); }
.pm-copy {
  padding: 9px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ld-ocean, #0C85C2); color: #FFFFFF; font: inherit; font-size: 13px; font-weight: 800;
}
.pm-copy:hover { background: var(--ld-ocean-deep, #085E8A); }
.pm-done-actions { display: grid; gap: 10px; }
.pm-call { font-size: 14px; font-weight: 700; color: var(--ld-ocean-text, #0A6C9E); text-decoration: none; padding: 6px; }
.pm-call:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ phones: a bottom sheet */
@media (max-width: 720px) {
  .pm { padding: 0; place-items: end stretch; }
  .pm-card {
    grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr);
    width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 24px 24px 0 0;
    transform: translateY(100%);
  }
  .pm.is-open .pm-card { transform: none; }
  .pm-media { min-height: 0; height: 150px; }
  .pm-media img { object-position: center 40%; }
  .pm-badge { left: 16px; bottom: -18px; padding: 10px 14px; }
  .pm-badge-amt { font-size: 26px; }
  .pm-media::after { background: linear-gradient(180deg, rgba(12, 50, 66, 0) 30%, rgba(12, 50, 66, 0.35) 100%); }
  .pm-media { height: 120px; }
  .pm-body { padding: 30px 20px calc(14px + env(safe-area-inset-bottom)); }
  /* The badge already says what the offer is, so the label makes way for the button. */
  .pm-eyebrow { display: none; }
  .pm-title { font-size: 25px; margin-bottom: 6px; }
  .pm-text { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
  .pm-form { gap: 10px; }
  .pm-chips { flex-wrap: nowrap; gap: 6px; }
  .pm-chips legend { margin-bottom: 6px; }
  .pm-chips span { padding: 8px 11px; font-size: 13px; white-space: nowrap; }
  .pm-field input { height: 44px; }
  .pm-cta { height: 50px; }
}
@media (max-width: 360px) { .pm-row, .pm-row-name { grid-template-columns: 1fr; } }
/* The badge hangs over the photo's bottom edge on phones, so the photo must not clip it. */
@media (max-width: 720px) { .pm-media { overflow: visible; z-index: 2; } }

@media (prefers-reduced-motion: reduce) {
  .pm-scrim, .pm-card, .pm-x, .pm-cta { transition: none; }
  .pm-done:not([hidden]) .pm-check, .pm-done:not([hidden]) .pm-check svg { animation: none; stroke-dashoffset: 0; }
}

body.pm-locked { overflow: hidden; }

/* ------------------------------------------------------------------ compact sizing (October 2026)
 * The first version took over most of the screen. Same layout, about a fifth smaller everywhere. */
.pm-card { width: min(700px, 100%); grid-template-columns: 38% minmax(0, 1fr); border-radius: 20px; }
.pm-body { padding: 26px 28px 16px; }
.pm-eyebrow { margin-bottom: 10px; padding: 5px 10px; font-size: 11px; }
.pm-title { font-size: clamp(22px, 2.4vw, 26px); margin-bottom: 6px; }
.pm-text { font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.pm-form { gap: 9px; }
.pm-chips legend { margin-bottom: 6px; font-size: 12.5px; }
.pm-chips span { padding: 7px 12px; font-size: 13px; }
.pm-field label { font-size: 12.5px; }
.pm-field input { height: 42px; font-size: 15px; border-radius: 10px; }
.pm-cta { height: 46px; font-size: 15px; }
.pm-consent { font-size: 11px; }
.pm-skip { margin-top: 4px; font-size: 13px; }
.pm-fine { margin-top: 10px; padding-top: 8px; }
.pm-badge { left: 16px; bottom: 16px; padding: 10px 14px; border-radius: 14px; }
.pm-badge-amt { font-size: 26px; }
.pm-badge-on { font-size: 11px; }
.pm-x { width: 32px; height: 32px; top: 10px; right: 10px; }
.pm-check { width: 52px; height: 52px; margin-bottom: 12px; }
.pm-code { padding: 10px 10px 10px 14px; margin-bottom: 14px; }
.pm-code-val { font-size: 19px; }
@media (max-width: 720px) {
  .pm-card { grid-template-columns: 1fr; width: 100%; max-height: 85vh; max-height: 85dvh; border-radius: 20px 20px 0 0; }
  .pm-media { height: 96px; }
  .pm-body { padding: 26px 18px calc(12px + env(safe-area-inset-bottom)); }
  .pm-title { font-size: 22px; }
  .pm-text { font-size: 13.5px; margin-bottom: 10px; }
  .pm-badge { bottom: -14px; padding: 8px 12px; }
  .pm-badge-amt { font-size: 22px; }
  .pm-field input { height: 42px; }
}
