:root {
  --font-main: "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;

  --overlay: rgba(0, 0, 0, 0.68);

  --surface: #1f1f1f;
  --surface-2: #252525;
  --text: #f7f7f7;
  --muted: rgba(255, 255, 255, 0.78);

  --brand: mediumseagreen;
  --brand-hover: #1f7a4a;

  --radius: 18px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.22);

  --ring: 0 0 0 3px rgba(60, 179, 113, 0.35);
}

/* Overlay */
#popup {
  position: fixed;
  inset: 0; /*ocupo toda la pantalla*/
  background: var(--overlay);
  display: grid; /*centro el contendor*/
  place-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;

  padding: 28px;
  box-sizing: border-box;

  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}

#popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Card */
#popup #popup-content {
  width: min(520px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;

  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;

  padding: 34px;
  text-align: center;

  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: center;

  transform: translateY(10px) scale(0.98);
  transition: transform 0.25s ease;
}

#popup.show #popup-content {
  transform: translateY(0) scale(1);
}

#popup #popup-content.image-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#popup #popup-content.image-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.72));
}

#popup #popup-content > * {
  position: relative;
  z-index: 1;
}

/* Botón cerrar */
#popup #closeButton {
  position: absolute;
  right: 12px;
  top: 12px;

  width: 40px;
  height: 40px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);

  font-size: 22px;
  line-height: 1;
  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
  backdrop-filter: blur(6px);
  z-index: 9999;
}

#popup #closeButton:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

#popup #closeButton:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Título / texto */
#popup .popup-title {
  margin: 5%;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: 0.2px;
}

#popup #popup-text-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#popup #popup-text-content p {
  margin: 0;
  color: var(--muted);
}

/* Form */
#popup #popup-text-content div {
  width: 100%;
}

#popup #popup-text-content label {
  display: block;
  text-align: left;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

#popup #popup-text-content .input-mail input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  outline: none;
}

#popup #popup-text-content .input-mail input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

#popup #popup-text-content .input-mail input:focus {
  border-color: rgba(60, 179, 113, 0.55);
  box-shadow: var(--ring);
  background: rgba(255, 255, 255, 0.1);
}

/* Botón principal */
#popup #popup-text-content .btn {
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;

  font-size: 16px;
  font-weight: 700;
  color: #ffffff;

  background: linear-gradient(180deg, var(--brand), #2ea86a);
  cursor: pointer;

  transition:
    transform 0.15s ease,
    filter 0.2s ease;
  text-transform: none;
}

#popup #popup-text-content .btn:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

#popup #popup-text-content .btn:active {
  transform: translateY(0);
}

#popup #popup-text-content .btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}