/* Epa Café — reusable lead-capture popup.
   Every class is namespaced `epa-lp-*` and every rule is scoped under
   `.epa-lp` so it can be dropped onto ANY page (index.html, guide.html, …)
   without colliding with that page's own .btn / .progress / form styles.
   Colours/fonts inherit from assets/theme.css — never re-declare tokens. */

.epa-lp,
.epa-lp * { box-sizing: border-box; }

/* ---- Overlay -------------------------------------------------------------- */
.epa-lp {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(43, 39, 32, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.epa-lp.epa-lp-open { opacity: 1; visibility: visible; }

/* ---- Card ----------------------------------------------------------------- */
.epa-lp-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
  background: #FCF9F2;
  border: 1px solid rgba(43, 39, 32, .08);
  border-radius: var(--radius, 20px);
  box-shadow: var(--shadow, 0 20px 60px -24px rgba(43, 39, 32, .4));
  padding: 2.25rem 1.9rem 2rem;
  text-align: center;
  font-family: var(--sans, "Hanken Grotesk", system-ui, sans-serif);
  color: var(--ink, #2B2720);
  transform: translateY(14px) scale(.98);
  transition: transform .34s cubic-bezier(.2, .7, .2, 1);
}
.epa-lp.epa-lp-open .epa-lp-card { transform: translateY(0) scale(1); }

/* ---- Close --------------------------------------------------------------- */
.epa-lp-close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft, #6A6151);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.epa-lp-close:hover { background: rgba(43, 39, 32, .07); color: var(--ink, #2B2720); }

/* ---- Header -------------------------------------------------------------- */
.epa-lp-eyebrow {
  font-family: var(--script, "Grand Hotel", cursive);
  color: var(--terracotta, #C06B3E);
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: .35rem;
}
.epa-lp-title {
  font-family: var(--serif, "Fraunces", Georgia, serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 6.5vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0 0 .5rem;
}
.epa-lp-sub {
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ink-soft, #6A6151);
  max-width: 32ch;
  margin: 0 auto 1.4rem;
}

/* ---- Form ---------------------------------------------------------------- */
.epa-lp-form { display: flex; flex-direction: column; gap: .7rem; text-align: left; }

.epa-lp-field { display: flex; flex-direction: column; gap: .3rem; }
.epa-lp-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft, #6A6151);
}
.epa-lp-label .epa-lp-opt { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .7; }

.epa-lp-input {
  width: 100%;
  padding: .72rem .85rem;
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink, #2B2720);
  background: #fff;
  border: 1px solid rgba(43, 39, 32, .16);
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.epa-lp-input::placeholder { color: rgba(106, 97, 81, .6); }
.epa-lp-input:focus {
  outline: none;
  border-color: var(--terracotta, #C06B3E);
  box-shadow: 0 0 0 3px rgba(192, 107, 62, .14);
}
.epa-lp-input.epa-lp-err { border-color: #C0463E; box-shadow: 0 0 0 3px rgba(192, 70, 62, .12); }

/* ---- Interest chips (stacked vertical column) ---------------------------- */
.epa-lp-chips { display: flex; flex-direction: column; gap: .5rem; }
.epa-lp-chip {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .55rem;
  padding: .72rem .9rem;
  font-size: .92rem;
  font-weight: 500;
  border: 1.5px solid rgba(43, 39, 32, .16);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .12s ease;
}
.epa-lp-chip:hover { border-color: var(--olive, #5F6B3E); }
.epa-lp-chip input { position: absolute; opacity: 0; pointer-events: none; }
.epa-lp-chip.epa-lp-on {
  border-color: var(--terracotta, #C06B3E);
  background: rgba(192, 107, 62, .1);
  color: var(--terracotta-deep, #A85730);
}
.epa-lp-chip .epa-lp-emoji { font-size: 1.2rem; }

/* ---- Submit -------------------------------------------------------------- */
.epa-lp-submit {
  margin-top: .4rem;
  width: 100%;
  padding: .85rem 1rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  background: var(--terracotta, #C06B3E);
  border: 1px solid var(--terracotta, #C06B3E);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s ease, transform .12s ease, box-shadow .2s ease;
}
.epa-lp-submit:hover {
  background: var(--terracotta-deep, #A85730);
  border-color: var(--terracotta-deep, #A85730);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(192, 107, 62, .32);
}
.epa-lp-submit:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }

.epa-lp-msg { min-height: 1.1rem; margin: .2rem 0 0; font-size: .82rem; color: #C0463E; text-align: center; }
.epa-lp-consent { margin: .55rem 0 0; font-size: .68rem; line-height: 1.4; color: var(--ink-soft, #6A6151); text-align: center; opacity: .85; }

/* ---- Success ------------------------------------------------------------- */
.epa-lp-success { display: none; text-align: center; }
.epa-lp.epa-lp-done .epa-lp-form,
.epa-lp.epa-lp-done .epa-lp-sub { display: none; }
.epa-lp.epa-lp-done .epa-lp-success { display: block; }

.epa-lp-check {
  width: 52px; height: 52px;
  margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(95, 107, 62, .14);
  color: var(--olive, #5F6B3E);
}
.epa-lp-code-box {
  margin: 1.1rem auto 0;
  max-width: 260px;
  padding: .9rem 1rem;
  border: 1.5px dashed var(--terracotta, #C06B3E);
  border-radius: 12px;
  background: rgba(192, 107, 62, .06);
}
.epa-lp-code-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft, #6A6151); }
.epa-lp-code {
  font-family: var(--serif, "Fraunces", Georgia, serif);
  font-size: 1.7rem;
  letter-spacing: .12em;
  color: var(--terracotta-deep, #A85730);
  margin: .2rem 0 .5rem;
}
.epa-lp-copy {
  font-family: inherit;
  font-size: .74rem;
  font-weight: 600;
  color: var(--olive, #5F6B3E);
  background: transparent;
  border: 1px solid rgba(95, 107, 62, .4);
  border-radius: 8px;
  padding: .35rem .7rem;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.epa-lp-copy:hover { background: var(--olive, #5F6B3E); color: var(--cream, #F6F1E6); }

/* ---- Mobile: compact so it never fills the whole screen (text stays legible).
   Scoped to phones only — desktop/tablet keep the base styles above. -------- */
@media (max-width: 480px) {
  .epa-lp { padding: 1rem; }
  .epa-lp-card {
    max-width: 360px;
    max-height: calc(100dvh - 2rem);
    padding: 1.35rem 1.15rem 1.25rem;
    border-radius: 16px;
  }
  .epa-lp-close { top: .45rem; right: .45rem; }

  .epa-lp-title { font-size: 1.6rem; line-height: 1.12; margin-bottom: .4rem; padding: 0 1.2rem; }
  .epa-lp-sub { font-size: .92rem; line-height: 1.42; margin-bottom: .95rem; }

  .epa-lp-form { gap: .5rem; }
  .epa-lp-field { gap: .2rem; }
  .epa-lp-label { font-size: .68rem; }
  .epa-lp-input { padding: .58rem .8rem; font-size: .9rem; border-radius: 10px; }

  .epa-lp-chips { gap: .4rem; }
  .epa-lp-chip { padding: .55rem .85rem; font-size: .88rem; border-radius: 10px; }
  .epa-lp-chip .epa-lp-emoji { font-size: 1.1rem; }

  .epa-lp-submit { margin-top: .25rem; padding: .72rem 1rem; font-size: .92rem; border-radius: 10px; }
  .epa-lp-consent { margin-top: .45rem; font-size: .66rem; }

  /* Success state stays compact too */
  .epa-lp-check { width: 44px; height: 44px; margin-bottom: .7rem; }
  .epa-lp-code-box { margin-top: .85rem; padding: .75rem .9rem; }
  .epa-lp-code { font-size: 1.5rem; margin: .15rem 0 .45rem; }
}

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