/* ===========================================================================
   Popover "Pedí tu invitación" — Lumbre brand system

   Palette is the five Lumbre tokens only: cream, gold, magenta, teal, purple.
   The brand system has no red and no blue, so validation errors are MAGENTA
   (the documented substitution for "more severe than a gold warning"), not the
   conventional red.

   The landing is light-first, so the card is a light surface over the page's
   own dark sections rather than a dark-on-dark panel.

   Selectors are prefixed with #inv-modal / .inv- because the page ships a
   global `*{box-sizing:border-box;margin:0;padding:0}` reset that would
   otherwise flatten the form controls.
   ======================================================================== */

#inv-modal {
  --cream: #E7E4DE;
  --gold: #EEAA11;
  --magenta: #BB3381;
  --teal: #4FB3B3;
  --purple: #3F1D50;
  --card: #FCFBF9;
  --surface: #F3F1EC;
  --border: rgba(63, 29, 80, .14);
  --border-strong: rgba(63, 29, 80, .22);
  --muted: rgba(63, 29, 80, .62);

  /* The browser's default dialog styling (border, padding, auto margins,
     max-height
     ) all has to go before we can lay the card out ourselves. */
  padding: 0;
  border: none;
  background: none;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  inset: 0;
  overflow: auto;
  display: none;
  color: var(--purple);
  font-family: 'Cairo', system-ui, sans-serif;
}

#inv-modal[open] {
  display: grid;
  place-items: center;
}

#inv-modal::backdrop {
  background: rgba(19, 10, 25, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .35s ease;
}

#inv-modal.is-open::backdrop {
  opacity: 1;
}

/* --- card ---------------------------------------------------------------- */

#inv-modal .inv-card {
  position: relative;
  width: min(660px, 100%);
  margin: auto;
  padding: clamp(24px, 4vw, 40px);
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(19, 10, 25, .45), 0 0 0 1px var(--border);
}

#inv-modal .inv-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--purple);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}

#inv-modal .inv-close:hover {
  background: linear-gradient(90deg, var(--gold), var(--magenta));
  color: #fff;
  transform: translateY(-1px);
}

#inv-modal .inv-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -.15em;
  fill: currentColor;
  font-size: 18px;
}

/* --- header ------------------------------------------------------------- */

#inv-modal .inv-head {
  text-align: center;
  margin-bottom: 26px;
}

#inv-modal .inv-flame {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
}

#inv-modal .inv-head h2 {
  font-family: 'Patua One', Georgia, serif;
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--purple);
  margin-bottom: 10px;
}

#inv-modal .inv-head p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto;
}

/* --- fields ------------------------------------------------------------- */

#inv-modal .inv-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#inv-modal .inv-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

#inv-modal .inv-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--purple);
  margin-bottom: 6px;
}

#inv-modal .inv-req {
  color: var(--magenta);
}

#inv-modal .inv-opt {
  font-weight: 500;
  color: var(--muted);
}

#inv-modal input[type="text"],
#inv-modal input[type="email"],
#inv-modal input[type="tel"],
#inv-modal select,
#inv-modal textarea {
  width: 100%;
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 14.5px;
  color: var(--purple);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#inv-modal textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

#inv-modal select {
  appearance: none;
  /* Chevron drawn as a data URI so the control needs no extra request and no
     absolutely-positioned icon on top of a native select. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%233F1D50' stroke-width='2' stroke-linecap='round' d='m7 10l5 5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}

#inv-modal input::placeholder,
#inv-modal textarea::placeholder {
  color: rgba(63, 29, 80, .38);
}

#inv-modal input:focus,
#inv-modal select:focus,
#inv-modal textarea:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(238, 170, 17, .18);
}

/* Invalid state — magenta, per the brand substitution for red. */
#inv-modal .inv-field.is-invalid input,
#inv-modal .inv-field.is-invalid select,
#inv-modal .inv-field.is-invalid textarea {
  border-color: var(--magenta);
  background: rgba(187, 51, 129, .05);
}

#inv-modal .inv-field.is-invalid input:focus,
#inv-modal .inv-field.is-invalid select:focus,
#inv-modal .inv-field.is-invalid textarea:focus {
  box-shadow: 0 0 0 4px rgba(187, 51, 129, .16);
}

#inv-modal .inv-error {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--magenta);
  margin-top: 5px;
  display: none;
}

#inv-modal .inv-field.is-invalid .inv-error {
  display: block;
}

/* --- consent ------------------------------------------------------------ */

#inv-modal .inv-consent label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 0;
}

#inv-modal .inv-consent input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--magenta);
  cursor: pointer;
}

#inv-modal .inv-consent.is-invalid label span {
  color: var(--magenta);
}

#inv-modal .inv-consent-link {
  margin-top: 7px;
  padding-left: 28px;   /* alineado con el texto, no con el checkbox */
  font-size: 12.5px;
}

#inv-modal .inv-consent-link a {
  color: var(--magenta);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#inv-modal .inv-consent-link a:hover {
  color: var(--purple);
}

/* Honeypot. Kept off-screen rather than display:none — some bots skip hidden
   inputs, but a positioned one still looks fillable to them. */
#inv-modal .inv-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- form-level error --------------------------------------------------- */

#inv-modal .inv-formerror {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--magenta);
  background: rgba(187, 51, 129, .08);
  border: 1.5px solid rgba(187, 51, 129, .35);
  border-radius: 12px;
  padding: 11px 13px;
}

#inv-modal .inv-formerror[hidden] {
  display: none;
}

/* --- submit (cosmic button) --------------------------------------------- */

#inv-modal .inv-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

#inv-modal .inv-cosmic {
  position: relative;
  padding: 2px;
  border-radius: 999px;
  display: inline-block;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
}

#inv-modal .inv-cosmic::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, var(--gold), var(--magenta), var(--teal), var(--purple), var(--gold));
  animation: inv-spin 4s linear infinite;
}

@keyframes inv-spin {
  to { transform: rotate(360deg); }
}

#inv-modal .inv-cosmic:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(238, 170, 17, .35), 0 10px 34px rgba(187, 51, 129, .28);
}

#inv-modal .inv-cosmic:hover::before {
  animation-duration: 1.4s;
}

#inv-modal .inv-submit {
  position: relative;
  display: block;
  font-family: 'Cairo', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  background: var(--purple);
  color: var(--cream);
  cursor: pointer;
  transition: background .25s ease;
}

#inv-modal .inv-cosmic:hover .inv-submit {
  background: #4a2361;
}

#inv-modal .inv-submit[disabled] {
  cursor: progress;
  opacity: .8;
}

#inv-modal .inv-fineprint {
  font-size: 12px;
  color: var(--muted);
}

/* --- success panel ------------------------------------------------------ */

#inv-modal .inv-done {
  text-align: center;
  padding: 18px 0 6px;
}

#inv-modal .inv-done[hidden] {
  display: none;
}

#inv-modal .inv-done-icon {
  width: 56px;
  height: 56px;
  fill: var(--teal);
  margin-bottom: 16px;
}

#inv-modal .inv-done h2 {
  font-family: 'Patua One', Georgia, serif;
  font-weight: 500;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.12;
  color: var(--purple);
  margin-bottom: 12px;
}

#inv-modal .inv-done p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 44ch;
  margin: 0 auto 22px;
}

#inv-modal .inv-done-close {
  font-family: 'Cairo', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid var(--purple);
  background: transparent;
  color: var(--purple);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

#inv-modal .inv-done-close:hover {
  background: var(--purple);
  color: var(--cream);
  box-shadow: 0 6px 18px rgba(63, 29, 80, .35);
}

/* --- focus visibility --------------------------------------------------- */

#inv-modal :focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* --- narrow screens ----------------------------------------------------- */

@media (max-width: 560px) {
  #inv-modal .inv-card {
    width: 100%;
    min-height: 100%;
    border-radius: 0;
    padding: 58px 20px 32px;
  }

  #inv-modal .inv-row {
    grid-template-columns: 1fr;
  }
}

/* --- reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  #inv-modal::backdrop {
    transition: none;
  }

  #inv-modal .inv-cosmic::before {
    animation: none;
  }

  #inv-modal .inv-cosmic,
  #inv-modal .inv-close,
  #inv-modal .inv-submit {
    transition: none;
  }
}
